public final class ExecutableStatementCountCheck extends AbstractCheck
Modifier and Type | Class and Description |
---|---|
private static class |
ExecutableStatementCountCheck.Context
Class to encapsulate counting information about one member.
|
Modifier and Type | Field and Description |
---|---|
private ExecutableStatementCountCheck.Context |
context
Current method context.
|
private java.util.Deque<ExecutableStatementCountCheck.Context> |
contextStack
Stack of method contexts.
|
private static int |
DEFAULT_MAX
Default threshold.
|
private int |
max
Threshold to report error for.
|
static java.lang.String |
MSG_KEY
A key is pointing to the warning message text in "messages.properties"
file.
|
Constructor and Description |
---|
ExecutableStatementCountCheck()
Constructs a
ExecutableStatementCountCheck . |
Modifier and Type | Method and Description |
---|---|
void |
beginTree(DetailAST rootAST)
Called before the starting to process a tree.
|
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.
|
private void |
leaveMemberDef(DetailAST ast)
Process the end of a member definition.
|
void |
leaveToken(DetailAST ast)
Called after all the child nodes have been process.
|
void |
setMax(int max)
Sets the maximum threshold.
|
private void |
visitMemberDef(DetailAST ast)
Process the start of the member definition.
|
private void |
visitSlist(DetailAST ast)
Process the end of a statement list.
|
void |
visitToken(DetailAST ast)
Called to process a token.
|
destroy, finishTree, getClassLoader, getFileContents, getLine, getLines, getTabWidth, getTokenNames, init, isCommentNodesRequired, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
public static final java.lang.String MSG_KEY
private static final int DEFAULT_MAX
private final java.util.Deque<ExecutableStatementCountCheck.Context> contextStack
private int max
private ExecutableStatementCountCheck.Context context
public ExecutableStatementCountCheck()
ExecutableStatementCountCheck
.public int[] getDefaultTokens()
AbstractCheck
getDefaultTokens
in class AbstractCheck
TokenTypes
public int[] getRequiredTokens()
AbstractCheck
getRequiredTokens
in class AbstractCheck
TokenTypes
public int[] getAcceptableTokens()
AbstractCheck
getAcceptableTokens
in class AbstractCheck
TokenTypes
public void setMax(int max)
max
- the maximum threshold.public void beginTree(DetailAST rootAST)
AbstractCheck
beginTree
in class AbstractCheck
rootAST
- the root of the treepublic void visitToken(DetailAST ast)
AbstractCheck
visitToken
in class AbstractCheck
ast
- the token to processpublic void leaveToken(DetailAST ast)
AbstractCheck
leaveToken
in class AbstractCheck
ast
- the token leavingprivate void visitMemberDef(DetailAST ast)
ast
- the token representing the member definition.private void leaveMemberDef(DetailAST ast)
ast
- the token representing the member definition.private void visitSlist(DetailAST ast)
ast
- the token representing the statement list.