public final class InterfaceIsTypeCheck extends Check
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.
Constructor and Description |
---|
InterfaceIsTypeCheck() |
Modifier and Type | Method and Description |
---|---|
int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
int[] |
getRequiredTokens()
The tokens that this check must be registered for.
|
void |
setAllowMarkerInterfaces(boolean flag)
Controls whether marker interfaces like Serializable are allowed.
|
void |
visitToken(DetailAST ast)
Called to process a token.
|
beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getFileContents, getLine, getLines, getTabWidth, getTokenNames, init, isCommentNodesRequired, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
public InterfaceIsTypeCheck()
public int[] getDefaultTokens()
Check
getDefaultTokens
in class Check
TokenTypes
public int[] getRequiredTokens()
Check
getRequiredTokens
in class Check
TokenTypes
public void visitToken(DetailAST ast)
Check
visitToken
in class Check
ast
- the token to processpublic void setAllowMarkerInterfaces(boolean flag)
flag
- whether to allow marker interfaces or notCopyright © 2001–2015. All rights reserved.