public final class NestedForDepthCheck extends AbstractNestedDepthCheck
for
-statements. The maximum
number of nested layers can be configured. The default value is 1. Most of
the logic is implemented in the parent class. The code for the class is
copied from the NestedIfDepthCheck-class. The only difference is the
intercepted token (for instead of if). Example:
<!-- Restricts nested for blocks to a specified depth (default = 1). --> <module name="com.puppycrawl.tools.checkstyle.checks.coding .CatchWithLostStackCheck"> <property name="severity" value="info"/> <property name="max" value="1"/> </module>
AbstractNestedDepthCheck
,
NestedIfDepthCheck
DEFAULT_ERROR_SCORE, DEFAULT_INFO_SCORE, DEFAULT_WARNING_SCORE, mScoring, mViolationSize
コンストラクタと説明 |
---|
NestedForDepthCheck()
Creates new check instance with default allowed nesting depth.
|
修飾子とタイプ | メソッドと説明 |
---|---|
int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
void |
leaveToken(DetailAST aAST)
Called after all the child nodes have been process.
|
void |
visitToken(DetailAST aAST)
Called to process a token.
|
beginTree, getMax, getRequiredTokens, nestIn, nestOut, setMax
destroy, finishTree, getAcceptableTokens, getClassLoader, getFileContents, getLines, getTabWidth, getTokenNames, init, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens
calculateScore, getCustomMessages, getErrorScore, getId, getInfoScore, getMessageBundle, getScore, getScoring, getSeverity, getSeverityLevel, getWarningScore, log, setErrorScore, setId, setInfoScore, setScore, setScoring, setSeverity, setWarningScore
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
public NestedForDepthCheck()
public int[] getDefaultTokens()
Check
getDefaultTokens
クラス内 Check
TokenTypes
public void visitToken(DetailAST aAST)
Check
visitToken
クラス内 Check
aAST
- the token to processpublic void leaveToken(DetailAST aAST)
Check
leaveToken
クラス内 Check
aAST
- the token leavingCopyright © 2001-2013. All Rights Reserved.