com.puppycrawl.tools.checkstyle.checks.header
Class HeaderCheck

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.AbstractHeaderCheck
                  extended bycom.puppycrawl.tools.checkstyle.checks.header.HeaderCheck
All Implemented Interfaces:
Configurable, Contextualizable

public class HeaderCheck
extends AbstractHeaderCheck

Checks the header of the source against a fixed header file.

Author:
Lars Kühne

Constructor Summary
HeaderCheck()
           
 
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.
protected  boolean isMatch(int aLineNumber)
          Checks if a code line matches the required header line.
 void setIgnoreLines(int[] aList)
          Set the lines numbers to ignore in the header check.
 
Methods inherited from class com.puppycrawl.tools.checkstyle.checks.AbstractHeaderCheck
finishLocalSetup, getDefaultTokens, getHeaderLines, setHeader, setHeaderFile
 
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
getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, setSeverity
 
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
configure, contextualize, getConfiguration, setupChild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeaderCheck

public HeaderCheck()
Method Detail

isMatch

protected boolean isMatch(int aLineNumber)
Checks if a code line matches the required header line.

Parameters:
aLineNumber - the linenumber to check against the header
Returns:
true if and only if the line matches the required header line

setIgnoreLines

public void setIgnoreLines(int[] aList)
Set the lines numbers to ignore in the header check.

Parameters:
aList - comma separated list of line numbers to ignore in header.

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