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
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
FieldsModifier and TypeFieldDescriptionprivate static final charClose parenthesis literal.private final StringMessage key for followed whitespace.private final StringMessage key for not followed whitespace.private final StringMessage key for not preceded whitespace.private final StringMessage key for preceded whitespace.private static final charOpen parenthesis literal.private PadOptionThe policy to enforce. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractParenPadCheck(String msgWsFollowed, String msgWsNotFollowed, String msgWsPreceded, String msgWsNotPreceded) Creates a newAbstractParenPadCheckinstance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprocessLeft(DetailAST ast) Process a token representing a left parentheses.protected voidprocessRight(DetailAST ast) Process a token representing a right parentheses.voidSpecify 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, visitTokenMethods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverityMethods inherited from class com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
configure, contextualize, getConfiguration, setupChild
-
Field Details
-
OPEN_PARENTHESIS
Open parenthesis literal.- See Also:
-
CLOSE_PARENTHESIS
Close parenthesis literal.- See Also:
-
msgWsFollowed
Message key for followed whitespace. -
msgWsNotFollowed
Message key for not followed whitespace. -
msgWsPreceded
Message key for preceded whitespace. -
msgWsNotPreceded
Message key for not preceded whitespace. -
option
The policy to enforce.
-
-
Constructor Details
-
AbstractParenPadCheck
protected AbstractParenPadCheck(String msgWsFollowed, String msgWsNotFollowed, String msgWsPreceded, String msgWsNotPreceded) Creates a newAbstractParenPadCheckinstance.- Parameters:
msgWsFollowed- message key for followed whitespacemsgWsNotFollowed- message key for not followed whitespacemsgWsPreceded- message key for preceded whitespacemsgWsNotPreceded- message key for not preceded whitespace
-
-
Method Details
-
setOption
Specify policy on how to pad parentheses.- Parameters:
optionStr- string to decode option from- Throws:
IllegalArgumentException- if unable to decode
-
processLeft
Process a token representing a left parentheses.- Parameters:
ast- the token representing a left parentheses
-
processRight
Process a token representing a right parentheses.- Parameters:
ast- the token representing a right parentheses
-