com.puppycrawl.tools.checkstyle.checks
Class TodoCommentCheck

java.lang.Object
  extended bycom.puppycrawl.tools.checkstyle.api.AutomaticBean
      extended bycom.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
          extended bycom.puppycrawl.tools.checkstyle.api.Check
              extended bycom.puppycrawl.tools.checkstyle.checks.AbstractFormatCheck
                  extended bycom.puppycrawl.tools.checkstyle.checks.TodoCommentCheck
All Implemented Interfaces:
Configurable, Contextualizable

public class TodoCommentCheck
extends AbstractFormatCheck

A check for TODO comments. Actually it is a generic regular expression matcher on Java comments. To check for other patterns in Java comments, set property format.

An example of how to configure the check is:

 <module name="TodoComment"/>
 

An example of how to configure the check for comments that contain WARNING is:

 <module name="TodoComment">
    <property name="format" value="WARNING"/>
 </module>
 

Version:
1.0
Author:
Oliver Burn

Constructor Summary
TodoCommentCheck()
          Creates a new TodoCommentCheck instance.
 
Method Summary
 void beginTree(DetailAST aRootAST)
          Called before the starting to process a tree. Ideal place to initialise information that is to be collected whilst processing a tree.
 int[] getDefaultTokens()
          Returns the default token a check is interested in. Only used if the configuration for a check does not define the tokens.
 
Methods inherited from class com.puppycrawl.tools.checkstyle.checks.AbstractFormatCheck
getFormat, getRegexp, setCompileFlags, setFormat
 
Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check
destroy, finishTree, getAcceptableTokens, getClassLoader, 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, setId, setSeverity
 
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TodoCommentCheck

public TodoCommentCheck()
Creates a new TodoCommentCheck instance.

Method Detail

getDefaultTokens

public int[] getDefaultTokens()
Returns the default token a check is interested in. Only used if the configuration for a check does not define the tokens.

Specified by:
getDefaultTokens in class Check
Returns:
the default tokens
See Also:
TokenTypes

beginTree

public void beginTree(DetailAST aRootAST)
Called before the starting to process a tree. Ideal place to initialise information that is to be collected whilst processing a tree.

Overrides:
beginTree in class Check
Parameters:
aRootAST - the root of the tree

Back to the Checkstyle Home Page