com.puppycrawl.tools.checkstyle.checks.sizes

Class ExecutableStatementCountCheck

Implemented Interfaces:
Configurable, Contextualizable

public final class ExecutableStatementCountCheck
extends Check

Restricts the number of executable statements to a specified limit (default = 30).
Author:
Simon Harris

Constructor Summary

ExecutableStatementCountCheck()
Constructs a ExecutableStatementCountCheck.

Method Summary

void
beginTree(DetailAST aRootAST)
int[]
getDefaultTokens()
int
getMax()
Gets the maximum threshold.
int[]
getRequiredTokens()
void
leaveToken(DetailAST aAST)
void
setMax(int aMax)
Sets the maximum threshold.
void
visitToken(DetailAST aAST)

Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check

beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getDefaultTokens, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens, visitToken

Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter

getId, getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, log, log, setId, setSeverity

Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean

configure, contextualize, finishLocalSetup, getConfiguration, setupChild

Constructor Details

ExecutableStatementCountCheck

public ExecutableStatementCountCheck()
Constructs a ExecutableStatementCountCheck.

Method Details

beginTree

public void beginTree(DetailAST aRootAST)
Overrides:
beginTree in interface Check

getDefaultTokens

public int[] getDefaultTokens()
Overrides:
getDefaultTokens in interface Check

getMax

public int getMax()
Gets the maximum threshold.
Returns:
the maximum threshold.

getRequiredTokens

public int[] getRequiredTokens()
Overrides:
getRequiredTokens in interface Check

leaveToken

public void leaveToken(DetailAST aAST)
Overrides:
leaveToken in interface Check

setMax

public void setMax(int aMax)
Sets the maximum threshold.
Parameters:
aMax - the maximum threshold.

visitToken

public void visitToken(DetailAST aAST)
Overrides:
visitToken in interface Check