com.puppycrawl.tools.checkstyle.checks.header

Class CrossLanguageRegexpHeaderCheck

Implemented Interfaces:
Configurable, Contextualizable, FileSetCheck

public final class CrossLanguageRegexpHeaderCheck
extends AbstractFileSetCheck

A FileSetCheck similar to RegexpHeaderCheck, but works for all text files, not just java code.
Author:
lk

Constructor Summary

CrossLanguageRegexpHeaderCheck()
Creates a new instance and initializes the file extentions to the default value, which represents most of the typical text files that require a copyright header.

Method Summary

protected void
finishLocalSetup()
Checks that required args were specified.
void
process(File[] aFiles)
void
setHeader(String aHeader)
Set the header to check against.
void
setHeaderFile(String aFileName)
Set the header file to check against.
void
setMultiLines(int[] aList)
Set the lines numbers to repeat in the header check.

Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck

destroy, filter, fireErrors, getCharset, getMessageCollector, getMessageDispatcher, log, log, setCharset, setFileExtensions, setMessageDispatcher

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

Constructor Details

CrossLanguageRegexpHeaderCheck

public CrossLanguageRegexpHeaderCheck()
Creates a new instance and initializes the file extentions to the default value, which represents most of the typical text files that require a copyright header.

Method Details

finishLocalSetup

protected void finishLocalSetup()
            throws CheckstyleException
Checks that required args were specified.
Overrides:
finishLocalSetup in interface AutomaticBean

process

public void process(File[] aFiles)
Specified by:
process in interface FileSetCheck

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.

setHeaderFile

public void setHeaderFile(String aFileName)
            throws ConversionException
Set the header file to check against.
Parameters:
aFileName - the file that contains the header to check against.

setMultiLines

public void setMultiLines(int[] aList)
Set the lines numbers to repeat in the header check.
Parameters:
aList - comma separated list of line numbers to repeat in header.