com.puppycrawl.tools.checkstyle.checks.header

Class HeaderCheck

Implemented Interfaces:
Configurable, Contextualizable

public class HeaderCheck
extends AbstractHeaderCheck

Checks the header of the source against a fixed header file.
Author:
Lars Kühne

Method Summary

void
beginTree(DetailAST aRootAST)
protected com.puppycrawl.tools.checkstyle.checks.header.HeaderInfo
createHeaderInfo()
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.header.AbstractHeaderCheck

createHeaderInfo, finishLocalSetup, getDefaultTokens, getHeaderInfo, getHeaderLines, setHeader, setHeaderFile

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

beginTree

public void beginTree(DetailAST aRootAST)
Overrides:
beginTree in interface Check

createHeaderInfo

protected com.puppycrawl.tools.checkstyle.checks.header.HeaderInfo createHeaderInfo()
Overrides:
createHeaderInfo in interface AbstractHeaderCheck

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.