com.puppycrawl.tools.checkstyle.checks.coding

Class IllegalTokenCheck

Implemented Interfaces:
Configurable, Contextualizable

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>
 
Authors:
Simon Harris
Rick Giles

Method Summary

int[]
getAcceptableTokens()
int[]
getDefaultTokens()
void
visitToken(DetailAST aAST)

Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check

beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getDefaultTokens, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens, visitToken

Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter

getId, getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, log, log, setId, setSeverity

Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean

configure, contextualize, finishLocalSetup, getConfiguration, setupChild

Method Details

getAcceptableTokens

public int[] getAcceptableTokens()
Overrides:
getAcceptableTokens in interface Check

getDefaultTokens

public int[] getDefaultTokens()
Overrides:
getDefaultTokens in interface Check

visitToken

public void visitToken(DetailAST aAST)
Overrides:
visitToken in interface Check