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. UseAbstractCheckinstead.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 intcompileFlagsDeprecated.The flags to create the regular expression with.private java.lang.StringformatDeprecated.The format string of the regexp.private java.util.regex.PatternregexpDeprecated.The regexp to match against.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractFormatCheck(java.lang.String defaultFormat)Deprecated.Creates a newAbstractFormatCheckinstance.protectedAbstractFormatCheck(java.lang.String defaultFormat, int compileFlags)Deprecated.Creates a newAbstractFormatCheckinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.StringgetFormat()Deprecated.Gets the regexp format.java.util.regex.PatterngetRegexp()Deprecated.Gets the regexp.voidsetCompileFlags(int compileFlags)Deprecated.Set the compile flags for the regular expression.voidsetFormat(java.lang.String format)Deprecated.Set the format to the specified regular expression.private voidupdateRegexp(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 newAbstractFormatCheckinstance. 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 newAbstractFormatCheckinstance.- 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- aStringvalue- 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.
-
-