Class AbstractOptionCheck<T extends java.lang.Enum<T>>
- 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.AbstractOptionCheck<T>
-
- Type Parameters:
T
- the type of the option.
- All Implemented Interfaces:
Configurable
,Contextualizable
@Deprecated public abstract class AbstractOptionCheck<T extends java.lang.Enum<T>> extends AbstractCheck
Deprecated.Checkstyle will not support abstract checks anymore. UseAbstractCheck
instead.Abstract class for checks with a parameter named option, where the option is identified by aEnum
. The logic to convert from a string representation to theEnum
is toString.trim()
the string and convert usingString.toUpperCase()
and then look up usingEnum.valueOf(java.lang.Class<T>, java.lang.String)
.
-
-
Field Summary
Fields Modifier and Type Field Description private T
abstractOption
Deprecated.The policy to enforce.private java.lang.Class<T>
optionClass
Deprecated.Since I cannot get this by going T.class.protected static java.lang.String
SEMICOLON
Deprecated.Semicolon literal.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractOptionCheck(T literalDefault, java.lang.Class<T> optionClass)
Deprecated.Creates a newAbstractOptionCheck
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description T
getAbstractOption()
Deprecated.Gets AbstractOption set.void
setOption(java.lang.String optionStr)
Deprecated.Set the option to enforce.-
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
-
-
-
-
Field Detail
-
SEMICOLON
protected static final java.lang.String SEMICOLON
Deprecated.Semicolon literal.- See Also:
- Constant Field Values
-
optionClass
private final java.lang.Class<T extends java.lang.Enum<T>> optionClass
Deprecated.Since I cannot get this by going T.class.
-
-
Method Detail
-
setOption
public void setOption(java.lang.String optionStr)
Deprecated.Set the option to enforce.- Parameters:
optionStr
- string to decode option from- Throws:
java.lang.IllegalArgumentException
- if unable to decode
-
getAbstractOption
public T getAbstractOption()
Deprecated.Gets AbstractOption set.- Returns:
- the
AbstractOption
set
-
-