com.puppycrawl.tools.checkstyle.checks.metrics

Class AbstractClassCouplingCheck

public abstract class AbstractClassCouplingCheck extends Check

Base class for coupling calculation.

Author: Simon Harris o_sukhodolsky

Constructor Summary
protected AbstractClassCouplingCheck(int aDefaultMax)
Creates new instance of the check.
Method Summary
voidbeginTree(DetailAST aAST)
{@inheritDoc}
int[]getDefaultTokens()
{@inheritDoc}
protected abstract StringgetLogMessageId()
intgetMax()
voidleaveToken(DetailAST aAST)
{@inheritDoc}
voidsetMax(int aMax)
Sets maximul allowed complexity.
voidvisitToken(DetailAST aAST)
{@inheritDoc}

Constructor Detail

AbstractClassCouplingCheck

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

Parameters: aDefaultMax default value for allowed complexity.

Method Detail

beginTree

public final void beginTree(DetailAST aAST)
{@inheritDoc}

getDefaultTokens

public final int[] getDefaultTokens()
{@inheritDoc}

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)
{@inheritDoc}

setMax

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

Parameters: aMax allowed complexity.

visitToken

public void visitToken(DetailAST aAST)
{@inheritDoc}