public abstract class AbstractComplexityCheck extends Check
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractComplexityCheck(int max)
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected BigInteger |
getCurrentValue()
Gets the current value.
|
protected abstract String |
getMessageID()
Gets the message ID to log violations with.
|
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()
Pops a value off the stack and makes it the current value.
|
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, setupChildprotected AbstractComplexityCheck(int max)
max - the threshold of when to report an errorprotected abstract String getMessageID()
public final int[] getRequiredTokens()
CheckgetRequiredTokens in class CheckTokenTypespublic 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 void visitTokenHook(DetailAST ast)
ast - the token being visitedprotected void leaveTokenHook(DetailAST ast)
ast - the token being leftprotected 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.