com.puppycrawl.tools.checkstyle.checks
Class AbstractFormatCheck
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.AbstractFormatCheck
- All Implemented Interfaces:
- Configurable, Contextualizable
- Direct Known Subclasses:
- AbstractClassNameCheck, AbstractNameCheck, GenericIllegalRegexpCheck, IllegalTypeCheck, MutableExceptionCheck, PackageNameCheck, RegexpCheck, 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
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, setSeverity |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractFormatCheck
public AbstractFormatCheck(String aDefaultFormat)
throws org.apache.commons.beanutils.ConversionException
- Creates a new
AbstractFormatCheck
instance.
- Parameters:
aDefaultFormat
- default format
- Throws:
org.apache.commons.beanutils.ConversionException
- unable to parse aDefaultFormat
setFormat
public void setFormat(String aFormat)
throws org.apache.commons.beanutils.ConversionException
- Set the format to the specified regular expression.
- Parameters:
aFormat
- a String
value
- Throws:
org.apache.commons.beanutils.ConversionException
- unable to parse aFormat
getRegexp
public Pattern getRegexp()
- Returns:
- the regexp to match against
getFormat
public String getFormat()
- Returns:
- the regexp format