com.puppycrawl.tools.checkstyle.checks.design

Class InterfaceIsTypeCheck

public final class InterfaceIsTypeCheck extends Check

Implements Bloch, Effective Java, Item 17 - Use Interfaces only to define types.

An interface should describe a type, it is therefore inappropriate to define an interface that does not contain any methods but only constants.

The check can be configured to also disallow marker interfaces like java.io.Serializable, that do not contain methods or constants at all.

Version: $Revision: 1.6 $

Author: lkuehne

Method Summary
int[]getDefaultTokens()
{@inheritDoc}
int[]getRequiredTokens()
{@inheritDoc}
voidsetAllowMarkerInterfaces(boolean aFlag)
Controls whether marker interfaces like Serializable are allowed.
voidvisitToken(DetailAST aAST)
{@inheritDoc}

Method Detail

getDefaultTokens

public int[] getDefaultTokens()
{@inheritDoc}

getRequiredTokens

public int[] getRequiredTokens()
{@inheritDoc}

setAllowMarkerInterfaces

public void setAllowMarkerInterfaces(boolean aFlag)
Controls whether marker interfaces like Serializable are allowed.

Parameters: aFlag whether to allow marker interfaces or not

visitToken

public void visitToken(DetailAST aAST)
{@inheritDoc}