com.puppycrawl.tools.checkstyle.checks

Class RequiredRegexpCheck

Implemented Interfaces:
Configurable, Contextualizable

public class RequiredRegexpCheck
extends AbstractFormatCheck

A check that makes sure that a specified pattern exists in the code.

An example of how to configure the check to make sure a copyright statement is included in the file (but without requirements on where in the file it should be):

 <module name="RequiredRegexp">
    <property name="format" value="This code is copyrighted"/>
 </module>
 
Author:
Daniel Grenner

Constructor Summary

RequiredRegexpCheck()
Instantiates an new GenericIllegalRegexpCheck.

Method Summary

void
beginTree(DetailAST aRootAST)
int[]
getDefaultTokens()

Methods inherited from class com.puppycrawl.tools.checkstyle.checks.AbstractFormatCheck

getFormat, getRegexp, setCompileFlags, setFormat

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

Constructor Details

RequiredRegexpCheck

public RequiredRegexpCheck()
Instantiates an new GenericIllegalRegexpCheck.

Method Details

beginTree

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

getDefaultTokens

public int[] getDefaultTokens()
Overrides:
getDefaultTokens in interface Check