com.puppycrawl.tools.checkstyle.checks

Class AbstractFormatCheck

Implemented Interfaces:
Configurable, Contextualizable
Known Direct Subclasses:
AbstractClassNameCheck, AbstractNameCheck, GenericIllegalRegexpCheck, IllegalTypeCheck, MutableExceptionCheck, PackageNameCheck, RequiredRegexpCheck, ReturnCountCheck, TodoCommentCheck, TrailingCommentCheck

public abstract class AbstractFormatCheck
extends Check

Abstract class for checks that verify strings using a regular expression. It provides support for setting the regular expression using the property name format.

Version:
1.0

Author:
Oliver Burn

Constructor Summary

AbstractFormatCheck(String aDefaultFormat)
Creates a new AbstractFormatCheck instance.

Method Summary

String
getFormat()
RE
getRegexp()
void
setFormat(String aFormat)
Set the format to the specified regular expression.

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

getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, log, log, setSeverity

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

configure, contextualize, finishLocalSetup, getConfiguration, setupChild

Constructor Details

AbstractFormatCheck

public AbstractFormatCheck(String aDefaultFormat)
            throws ConversionException
Creates a new AbstractFormatCheck instance.

Parameters:
aDefaultFormat - default format

Method Details

getFormat

public String getFormat()

Returns:
the regexp format


getRegexp

public RE getRegexp()

Returns:
the regexp to match against


setFormat

public void setFormat(String aFormat)
            throws ConversionException
Set the format to the specified regular expression.

Parameters:
aFormat - a String value