public class IllegalTokenCheck extends Check
Checks for illegal tokens.
Rational: Certain language features are often lead to hard to maintain code or are non-obvious to novice developers. Others may be discouraged in certain frameworks, such as not having native methods in EJB components.
An example of how to configure the check is:
<module name="IllegalToken"/>
An example of how to configure the check to forbid
a LITERAL_NATIVE
token is:
<module name="IllegalToken"> <property name="tokens" value="LITERAL_NATIVE"/> </module>
Constructor and Description |
---|
IllegalTokenCheck() |
Modifier and Type | Method and Description |
---|---|
int[] |
getAcceptableTokens()
The configurable token set.
|
int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
void |
visitToken(DetailAST ast)
Called to process a token.
|
beginTree, destroy, finishTree, getClassLoader, getFileContents, getLine, getLines, getRequiredTokens, 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 IllegalTokenCheck()
public int[] getDefaultTokens()
Check
getDefaultTokens
in class Check
TokenTypes
public int[] getAcceptableTokens()
Check
getAcceptableTokens
in class Check
TokenTypes
public void visitToken(DetailAST ast)
Check
visitToken
in class Check
ast
- the token to processCopyright © 2001–2015. All rights reserved.