public class ReturnCountExtendedCheck
extends com.puppycrawl.tools.checkstyle.api.AbstractCheck
null to ignore all lambda violations for now. It should be noted, that ignoring lambdas
this way may not always be supported as it is a hack and giving all lambdas the same name. It
could be changed if a better way to single out individual lambdas if found.
ReturnCountCheck. | Modifier and Type | Field and Description |
|---|---|
static String |
MSG_KEY_CTOR
A key is pointing to the warning message text in "messages.properties"
file.
|
static String |
MSG_KEY_LAMBDA
A key is pointing to the warning message text in "messages.properties"
file.
|
static String |
MSG_KEY_METHOD
A key is pointing to the warning message text in "messages.properties"
file.
|
| Constructor and Description |
|---|
ReturnCountExtendedCheck()
Creates the new check instance.
|
| Modifier and Type | Method and Description |
|---|---|
int[] |
getAcceptableTokens() |
int[] |
getDefaultTokens() |
int[] |
getRequiredTokens() |
void |
setIgnoreEmptyReturns(boolean ignoreEmptyReturns)
Sets the "ignoring empty return statements in void methods and ctors and lambdas"
option state.
|
void |
setIgnoreMethodLinesCount(int ignoreMethodLinesCount)
Sets the maximum number of lines of which method/ctor/lambda body may consist to
be skipped by check.
|
void |
setIgnoreMethodsNames(String... ignoreMethodNames)
Sets the RegExp patterns for methods' names which would be ignored by check.
|
void |
setMaxReturnCount(int maxReturnCount)
Sets maximum allowed "return" literals count per method/ctor/lambda.
|
void |
setMinIgnoreReturnDepth(int minIgnoreReturnDepth)
Sets the minimum "return" statement depth with that will be skipped by
check.
|
void |
setTopLinesToIgnoreCount(int topLinesToIgnoreCount)
Sets the count of code lines on the top of each
processed method/ctor that will be ignored by check.
|
void |
visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST node) |
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, setSeveritypublic static final String MSG_KEY_METHOD
public static final String MSG_KEY_CTOR
public static final String MSG_KEY_LAMBDA
public ReturnCountExtendedCheck()
public void setIgnoreMethodsNames(String... ignoreMethodNames)
ignoreMethodNames - list of the RegExp patterns for methods' names which should be ignored by checkpublic void setMaxReturnCount(int maxReturnCount)
maxReturnCount - - the new "maxReturnCount" property value.maxReturnCountpublic void setIgnoreMethodLinesCount(int ignoreMethodLinesCount)
ignoreMethodLinesCount - - the new value of "ignoreMethodLinesCount" property.ignoreMethodLinesCountpublic void setMinIgnoreReturnDepth(int minIgnoreReturnDepth)
minIgnoreReturnDepth - - the new "minIgnoreReturnDepth" property value.public void setIgnoreEmptyReturns(boolean ignoreEmptyReturns)
ignoreEmptyReturns - the new "allowEmptyReturns" property value.ignoreEmptyReturnspublic void setTopLinesToIgnoreCount(int topLinesToIgnoreCount)
topLinesToIgnoreCount - the new "rowsToIgnoreCount" property value.topLinesToIgnoreCountpublic int[] getDefaultTokens()
getDefaultTokens in class com.puppycrawl.tools.checkstyle.api.AbstractCheckpublic int[] getAcceptableTokens()
getAcceptableTokens in class com.puppycrawl.tools.checkstyle.api.AbstractCheckpublic int[] getRequiredTokens()
getRequiredTokens in class com.puppycrawl.tools.checkstyle.api.AbstractCheckpublic void visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST node)
visitToken in class com.puppycrawl.tools.checkstyle.api.AbstractCheckCopyright © 2021. All rights reserved.