com.puppycrawl.tools.checkstyle.checks.coding

Class IllegalTokenTextCheck

public class IllegalTokenTextCheck extends GenericIllegalRegexpCheck

Checks for illegal token text.

An example of how to configure the check to forbid String literals containing "a href" is:

 <module name="IllegalTokenText">
     <property name="tokens" value="STRING_LITERAL"/>
     <property name="format" value="a href"/>
 </module>
 

An example of how to configure the check to forbid leading zeros in an integer literal, other than zero and a hex literal is:

 <module name="IllegalTokenText">
     <property name="tokens" value="NUM_INT,NUM_LONG"/>
     <property name="format" value="^0[^lx]"/>
     <property name="ignoreCase" value="true"/>
 </module>
 

Author: Rick Giles

Method Summary
voidbeginTree(DetailAST aRootAST)
{@inheritDoc}
int[]getAcceptableTokens()
{@inheritDoc}
voidvisitToken(DetailAST aAST)
{@inheritDoc}

Method Detail

beginTree

public void beginTree(DetailAST aRootAST)
{@inheritDoc}

getAcceptableTokens

public int[] getAcceptableTokens()
{@inheritDoc}

visitToken

public void visitToken(DetailAST aAST)
{@inheritDoc}