Class AbstractParenPadCheck
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
-
- com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
-
- com.puppycrawl.tools.checkstyle.api.AbstractCheck
-
- com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck
-
- All Implemented Interfaces:
Configurable
,Contextualizable
- Direct Known Subclasses:
ParenPadCheck
,TypecastParenPadCheck
public abstract class AbstractParenPadCheck extends AbstractCheck
Abstract class for checking the padding of parentheses. That is whether a space is required after a left parenthesis and before a right parenthesis, or such spaces are forbidden.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
AbstractAutomaticBean.OutputStreamOptions
-
-
Field Summary
Fields Modifier and Type Field Description private static char
CLOSE_PARENTHESIS
Close parenthesis literal.static String
MSG_WS_FOLLOWED
A key is pointing to the warning message text in "messages.properties" file.static String
MSG_WS_NOT_FOLLOWED
A key is pointing to the warning message text in "messages.properties" file.static String
MSG_WS_NOT_PRECEDED
A key is pointing to the warning message text in "messages.properties" file.static String
MSG_WS_PRECEDED
A key is pointing to the warning message text in "messages.properties" file.private static char
OPEN_PARENTHESIS
Open parenthesis literal.private PadOption
option
The policy to enforce.
-
Constructor Summary
Constructors Constructor Description AbstractParenPadCheck()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
processLeft(DetailAST ast)
Process a token representing a left parentheses.protected void
processRight(DetailAST ast)
Process a token representing a right parentheses.void
setOption(String optionStr)
Specify policy on how to pad parentheses.-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheck
beginTree, clearViolations, destroy, finishTree, getAcceptableTokens, getDefaultTokens, getFileContents, getFilePath, getLine, getLineCodePoints, getLines, getRequiredTokens, getTabWidth, getTokenNames, getViolations, init, isCommentNodesRequired, leaveToken, log, log, log, setFileContents, setTabWidth, setTokens, visitToken
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverity
-
Methods inherited from class com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
configure, contextualize, getConfiguration, setupChild
-
-
-
-
Field Detail
-
MSG_WS_FOLLOWED
public static final String MSG_WS_FOLLOWED
A key is pointing to the warning message text in "messages.properties" file.- See Also:
- Constant Field Values
-
MSG_WS_NOT_FOLLOWED
public static final String MSG_WS_NOT_FOLLOWED
A key is pointing to the warning message text in "messages.properties" file.- See Also:
- Constant Field Values
-
MSG_WS_PRECEDED
public static final String MSG_WS_PRECEDED
A key is pointing to the warning message text in "messages.properties" file.- See Also:
- Constant Field Values
-
MSG_WS_NOT_PRECEDED
public static final String MSG_WS_NOT_PRECEDED
A key is pointing to the warning message text in "messages.properties" file.- See Also:
- Constant Field Values
-
OPEN_PARENTHESIS
private static final char OPEN_PARENTHESIS
Open parenthesis literal.- See Also:
- Constant Field Values
-
CLOSE_PARENTHESIS
private static final char CLOSE_PARENTHESIS
Close parenthesis literal.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractParenPadCheck
public AbstractParenPadCheck()
-
-
Method Detail
-
setOption
public void setOption(String optionStr)
Specify policy on how to pad parentheses.- Parameters:
optionStr
- string to decode option from- Throws:
IllegalArgumentException
- if unable to decode
-
processLeft
protected void processLeft(DetailAST ast)
Process a token representing a left parentheses.- Parameters:
ast
- the token representing a left parentheses
-
processRight
protected void processRight(DetailAST ast)
Process a token representing a right parentheses.- Parameters:
ast
- the token representing a right parentheses
-
-