com.puppycrawl.tools.checkstyle.checks.metrics

Class AbstractClassCouplingCheck

Implemented Interfaces:
Configurable, Contextualizable
Known Direct Subclasses:
ClassDataAbstractionCouplingCheck, ClassFanOutComplexityCheck

public abstract class AbstractClassCouplingCheck
extends Check

Base class for coupling calculation.
Authors:
Simon Harris
o_sukhodolsky

Constructor Summary

AbstractClassCouplingCheck(int aDefaultMax)
Creates new instance of the check.

Method Summary

void
beginTree(DetailAST aAST)
int[]
getDefaultTokens()
protected abstract String
getLogMessageId()
int
getMax()
void
leaveToken(DetailAST aAST)
void
setMax(int aMax)
Sets maximul allowed complexity.
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

AbstractClassCouplingCheck

protected AbstractClassCouplingCheck(int aDefaultMax)
Creates new instance of the check.
Parameters:
aDefaultMax - default value for allowed complexity.

Method Details

beginTree

public final void beginTree(DetailAST aAST)
Overrides:
beginTree in interface Check

getDefaultTokens

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

getLogMessageId

protected abstract String getLogMessageId()
Returns:
message key we use for log violations.

getMax

public final int getMax()
Returns:
allowed complexity.

leaveToken

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

setMax

public final void setMax(int aMax)
Sets maximul allowed complexity.
Parameters:
aMax - allowed complexity.

visitToken

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