com.puppycrawl.tools.checkstyle.checks.header

Class AbstractHeaderCheck

public abstract class AbstractHeaderCheck extends Check

Abstract super class for header checks. Provides support for headerFile property.

Author: o_sukhosolsky

Method Summary
protected abstract HeaderInfocreateHeaderInfo()
Abstract factory method to create an unconfigured header info bean.
protected voidfinishLocalSetup()
Checks that required args were specified.
int[]getDefaultTokens()
protected HeaderInfogetHeaderInfo()
Return the header info to check against.
protected String[]getHeaderLines()
Return the header lines to check against.
voidsetHeader(String aHeader)
Set the header to check against.
voidsetHeaderFile(String aFileName)
Set the header file to check against.

Method Detail

createHeaderInfo

protected abstract HeaderInfo createHeaderInfo()
Abstract factory method to create an unconfigured header info bean. Note that the actual type of the return value can be subclass specific.

Returns: a header info bean for this check.

finishLocalSetup

protected final void finishLocalSetup()
Checks that required args were specified.

Throws: CheckstyleException {@inheritDoc }

See Also: AutomaticBean

getDefaultTokens

public final int[] getDefaultTokens()
{@inheritDoc }

getHeaderInfo

protected HeaderInfo getHeaderInfo()
Return the header info to check against.

Returns: the header info to check against.

getHeaderLines

protected String[] getHeaderLines()
Return the header lines to check against.

Returns: the header lines to check against.

setHeader

public void setHeader(String aHeader)
Set the header to check against. Individual lines in the header must be separated by '\n' characters.

Parameters: aHeader header content to check against.

Throws: ConversionException if the header cannot be interpreted

setHeaderFile

public void setHeaderFile(String aFileName)
Set the header file to check against.

Parameters: aFileName the file that contains the header to check against.

Throws: ConversionException if the file cannot be loaded