com.puppycrawl.tools.checkstyle.checks.design
Class InterfaceIsTypeCheck
- Configurable, Contextualizable
public final class InterfaceIsTypeCheck
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:
- lkuehne
beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getDefaultTokens, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens, visitToken |
getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, log, log, setSeverity |
getDefaultTokens
public int[] getDefaultTokens()
- getDefaultTokens in interface Check
Check
getRequiredTokens
public int[] getRequiredTokens()
- getRequiredTokens in interface Check
Check
setAllowMarkerInterfaces
public void setAllowMarkerInterfaces(boolean aFlag)
Controls whether marker interfaces like Serializable are allowed.
aFlag - whether to allow marker interfaces or not