com.puppycrawl.tools.checkstyle.checks.header
Class RegexpHeaderCheck
java.lang.Object
com.puppycrawl.tools.checkstyle.api.AutomaticBean
com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
com.puppycrawl.tools.checkstyle.api.Check
com.puppycrawl.tools.checkstyle.checks.AbstractHeaderCheck
com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck
- All Implemented Interfaces:
- Configurable, Contextualizable
public class RegexpHeaderCheck
- extends AbstractHeaderCheck
Checks the header of the source against a header file that contains a
regular expression
for each line of the source header.
- Author:
- Lars Kühne, o_sukhodolsky
|
Method Summary |
void |
beginTree(DetailAST aRootAST)
Called before the starting to process a tree. |
void |
setHeader(String aHeader)
Set the header to check against. |
void |
setHeaderFile(String aFileName)
Sets the file that contains the header 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.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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RegexpHeaderCheck
public RegexpHeaderCheck()
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.
setHeaderFile
public void setHeaderFile(String aFileName)
throws org.apache.commons.beanutils.ConversionException
- Sets the file that contains the header to check against.
- Overrides:
setHeaderFile in class AbstractHeaderCheck
- Parameters:
aFileName - the file that contains the header to check against.
- Throws:
org.apache.commons.beanutils.ConversionException - if the file
cannot be loaded or one line is not a regexp.
setHeader
public void setHeader(String aHeader)
- Set the header to check against. Individual lines in the header
must be separated by '\n' characters.
- Overrides:
setHeader in class AbstractHeaderCheck
- Parameters:
aHeader - header content to check against.
- Throws:
org.apache.commons.beanutils.ConversionException - if the header
cannot be loaded or one line is not a regexp.
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