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.
| Modifier and Type | Field and Description |
|---|---|
static String |
MSG_KEY
A key is pointing to the warning message text in "messages.properties"
file.
|
| Constructor and Description |
|---|
InterfaceIsTypeCheck() |
| Modifier and Type | Method and Description |
|---|---|
int[] |
getAcceptableTokens()
The configurable token set.
|
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, getClassLoader, getFileContents, getLine, getLines, getTabWidth, getTokenNames, init, isCommentNodesRequired, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokensgetCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverityconfigure, contextualize, finishLocalSetup, getConfiguration, setupChildpublic static final String MSG_KEY
public InterfaceIsTypeCheck()
public int[] getDefaultTokens()
CheckgetDefaultTokens in class CheckTokenTypespublic int[] getRequiredTokens()
CheckgetRequiredTokens in class CheckTokenTypespublic int[] getAcceptableTokens()
CheckgetAcceptableTokens in class CheckTokenTypespublic void visitToken(DetailAST ast)
CheckvisitToken in class Checkast - the token to processpublic void setAllowMarkerInterfaces(boolean flag)
flag - whether to allow marker interfaces or notCopyright © 2001-2015. All Rights Reserved.