Class AbstractFormatCheck
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.api.AutomaticBean
-
- com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
-
- com.puppycrawl.tools.checkstyle.api.AbstractCheck
-
- com.puppycrawl.tools.checkstyle.checks.AbstractFormatCheck
-
- All Implemented Interfaces:
Configurable
,Contextualizable
@Deprecated public abstract class AbstractFormatCheck extends AbstractCheck
Deprecated.Checkstyle will not support abstract checks anymore. UseAbstractCheck
instead.Abstract class for checks that verify strings using a
regular expression
. It provides support for setting the regular expression using the property nameformat
.
-
-
Field Summary
Fields Modifier and Type Field Description private int
compileFlags
Deprecated.The flags to create the regular expression with.private java.lang.String
format
Deprecated.The format string of the regexp.private java.util.regex.Pattern
regexp
Deprecated.The regexp to match against.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractFormatCheck(java.lang.String defaultFormat)
Deprecated.Creates a newAbstractFormatCheck
instance.protected
AbstractFormatCheck(java.lang.String defaultFormat, int compileFlags)
Deprecated.Creates a newAbstractFormatCheck
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
getFormat()
Deprecated.Gets the regexp format.java.util.regex.Pattern
getRegexp()
Deprecated.Gets the regexp.void
setCompileFlags(int compileFlags)
Deprecated.Set the compile flags for the regular expression.void
setFormat(java.lang.String format)
Deprecated.Set the format to the specified regular expression.private void
updateRegexp(java.lang.String regexpFormat, int compileFlagsParam)
Deprecated.Updates the regular expression using the supplied format and compiler flags.-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheck
beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getDefaultTokens, getFileContents, getLine, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, isCommentNodesRequired, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens, visitToken
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
-
-
-
-
Constructor Detail
-
AbstractFormatCheck
protected AbstractFormatCheck(java.lang.String defaultFormat)
Deprecated.Creates a newAbstractFormatCheck
instance. Defaults the compile flag to 0 (the default).- Parameters:
defaultFormat
- default format- Throws:
org.apache.commons.beanutils.ConversionException
- unable to parse defaultFormat
-
AbstractFormatCheck
protected AbstractFormatCheck(java.lang.String defaultFormat, int compileFlags)
Deprecated.Creates a newAbstractFormatCheck
instance.- Parameters:
defaultFormat
- default formatcompileFlags
- the Pattern flags to compile the regexp with. SeePattern.compile(String, int)
- Throws:
org.apache.commons.beanutils.ConversionException
- unable to parse defaultFormat
-
-
Method Detail
-
setFormat
public final void setFormat(java.lang.String format)
Deprecated.Set the format to the specified regular expression.- Parameters:
format
- aString
value- Throws:
org.apache.commons.beanutils.ConversionException
- unable to parse format
-
setCompileFlags
public final void setCompileFlags(int compileFlags)
Deprecated.Set the compile flags for the regular expression.- Parameters:
compileFlags
- the compile flags to use.
-
getRegexp
public final java.util.regex.Pattern getRegexp()
Deprecated.Gets the regexp.- Returns:
- the regexp to match against
-
getFormat
public final java.lang.String getFormat()
Deprecated.Gets the regexp format.- Returns:
- the regexp format
-
updateRegexp
private void updateRegexp(java.lang.String regexpFormat, int compileFlagsParam)
Deprecated.Updates the regular expression using the supplied format and compiler flags. Will also update the member variables.- Parameters:
regexpFormat
- the format of the regular expression.compileFlagsParam
- the compiler flags to use.
-
-