com.puppycrawl.tools.checkstyle.checks.design

Class DesignForExtensionCheck

public class DesignForExtensionCheck extends Check

Checks that classes are designed for inheritance.

More specifically, it enforces a programming style where superclasses provide empty "hooks" that can be implemented by subclasses.

The exact rule is that nonprivate, nonstatic methods in nonfinal classes (or classes that do not only have private constructors) must either be

This protects superclasses against beeing broken by subclasses. The downside is that subclasses are limited in their flexibility, in particular they cannot prevent execution of code in the superclass, but that also means that subclasses can't forget to call their super method.

Version: $Revision: 1.11 $

Author: lkuehne

Method Summary
int[]getDefaultTokens()
{@inheritDoc}
voidvisitToken(DetailAST aAST)
{@inheritDoc}

Method Detail

getDefaultTokens

public int[] getDefaultTokens()
{@inheritDoc}

visitToken

public void visitToken(DetailAST aAST)
{@inheritDoc}