public abstract class AbstractComplexityCheck extends Check
| Constructor and Description |
|---|
AbstractComplexityCheck(int max)
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected BigInteger |
getCurrentValue() |
int |
getMax() |
protected abstract String |
getMessageID() |
int[] |
getRequiredTokens()
The tokens that this check must be registered for.
|
protected void |
incrementCurrentValue(BigInteger by)
Increments the current value by a specified amount.
|
void |
leaveToken(DetailAST ast)
Called after all the child nodes have been process.
|
protected void |
leaveTokenHook(DetailAST ast)
Hook called when leaving a token.
|
protected BigInteger |
popValue() |
protected void |
pushValue()
Push the current value on the stack
|
protected void |
setCurrentValue(BigInteger value)
Set the current value
|
void |
setMax(int max)
Set the maximum threshold allowed.
|
void |
visitToken(DetailAST ast)
Called to process a token.
|
protected void |
visitTokenHook(DetailAST ast)
Hook called when visiting a token.
|
beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getDefaultTokens, getFileContents, getLine, getLines, getTabWidth, getTokenNames, init, isCommentNodesRequired, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokensgetCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverityconfigure, contextualize, finishLocalSetup, getConfiguration, setupChildpublic AbstractComplexityCheck(int max)
max - the threshold of when to report an errorprotected abstract String getMessageID()
protected void visitTokenHook(DetailAST ast)
ast - the token being visitedprotected void leaveTokenHook(DetailAST ast)
ast - the token being leftpublic final int[] getRequiredTokens()
CheckgetRequiredTokens in class CheckTokenTypespublic final int getMax()
public final void setMax(int max)
max - the maximum thresholdpublic void visitToken(DetailAST ast)
CheckvisitToken in class Checkast - the token to processpublic void leaveToken(DetailAST ast)
CheckleaveToken in class Checkast - the token leavingprotected final BigInteger getCurrentValue()
protected final void setCurrentValue(BigInteger value)
value - the new valueprotected final void incrementCurrentValue(BigInteger by)
by - the amount to increment byprotected final void pushValue()
protected final BigInteger popValue()
Copyright © 2001–2015. All rights reserved.