public class OperatorWrapCheck extends AbstractCheck
Checks the policy on how to wrap lines on operators.
option - Specify policy on how to wrap lines.
Default value is nl.
tokens - tokens to check
Default value is:
QUESTION,
COLON,
EQUAL,
NOT_EQUAL,
DIV,
PLUS,
MINUS,
STAR,
MOD,
SR,
BSR,
GE,
GT,
SL,
LE,
LT,
BXOR,
BOR,
LOR,
BAND,
LAND,
TYPE_EXTENSION_AND,
LITERAL_INSTANCEOF.
To configure the check:
<module name="OperatorWrap"/>
To configure the check for assignment operators at the end of a line:
<module name="OperatorWrap">
<property name="tokens"
value="ASSIGN,DIV_ASSIGN,PLUS_ASSIGN,MINUS_ASSIGN,STAR_ASSIGN,MOD_ASSIGN,
SR_ASSIGN,BSR_ASSIGN,SL_ASSIGN,BXOR_ASSIGN,BOR_ASSIGN,BAND_ASSIGN"/>
<property name="option" value="eol"/>
</module>
AutomaticBean.OutputStreamOptions| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MSG_LINE_NEW
A key is pointing to the warning message text in "messages.properties"
file.
|
static java.lang.String |
MSG_LINE_PREVIOUS
A key is pointing to the warning message text in "messages.properties"
file.
|
| Constructor and Description |
|---|
OperatorWrapCheck() |
| Modifier and Type | Method and Description |
|---|---|
int[] |
getAcceptableTokens()
The configurable token set.
|
int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
int[] |
getRequiredTokens()
The tokens that this check must be registered for.
|
void |
setOption(java.lang.String optionStr)
Setter to specify policy on how to wrap lines.
|
void |
visitToken(DetailAST ast)
Called to process a token.
|
beginTree, clearMessages, destroy, finishTree, getFileContents, getLine, getLines, getMessages, getTabWidth, getTokenNames, init, isCommentNodesRequired, leaveToken, log, log, log, setFileContents, setTabWidth, setTokensfinishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverityconfigure, contextualize, getConfiguration, setupChildpublic static final java.lang.String MSG_LINE_NEW
public static final java.lang.String MSG_LINE_PREVIOUS
public OperatorWrapCheck()
public void setOption(java.lang.String optionStr)
optionStr - string to decode option fromjava.lang.IllegalArgumentException - if unable to decodepublic int[] getDefaultTokens()
AbstractCheckgetDefaultTokens in class AbstractCheckTokenTypespublic int[] getAcceptableTokens()
AbstractCheckgetAcceptableTokens in class AbstractCheckTokenTypespublic int[] getRequiredTokens()
AbstractCheckgetRequiredTokens in class AbstractCheckTokenTypespublic void visitToken(DetailAST ast)
AbstractCheckvisitToken in class AbstractCheckast - the token to processCopyright © 2001-2020. All Rights Reserved.