## 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.header.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

Constructor Summary
`RegexpHeaderCheck()`

Method Summary
`void` `beginTree(DetailAST aRootAST)` Called before the starting to process a tree.
`protected com.puppycrawl.tools.checkstyle.checks.header.HeaderInfo` `createHeaderInfo()` Abstract factory method to create an unconfigured header info bean.
`protected com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderInfo` `getRegexpHeaderInfo()` Provides typesafe access to the subclass specific HeaderInfo.
`void` `init()` Initialse the check.
`void` `setMultiLines(int[] aList)` Set the lines numbers to repeat in the header check.

Methods inherited from class com.puppycrawl.tools.checkstyle.checks.header.AbstractHeaderCheck
`finishLocalSetup, getDefaultTokens, getHeaderInfo, getHeaderLines, setHeader, setHeaderFile`

Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check
`destroy, finishTree, getAcceptableTokens, getClassLoader, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, 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, setId, 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

### RegexpHeaderCheck

    public RegexpHeaderCheck()

Method Detail

### getRegexpHeaderInfo

    protected com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderInfo getRegexpHeaderInfo()

  Provides typesafe access to the subclass specific HeaderInfo.

  Returns:
    the result of `createHeaderInfo()`

### 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.

### init

    public void init()

  Description copied from class: `Check`
  Initialse the check. This is the time to verify that the check has everything required to perform it job.

  Overrides:
    `init` in class `Check`
  See Also:
    `Check.init()`

### 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

### createHeaderInfo

    protected com.puppycrawl.tools.checkstyle.checks.header.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.

  Specified by:
    `createHeaderInfo` in class `AbstractHeaderCheck`
  Returns:
    a header info bean for this check.

Back to the Checkstyle Home Page