com.puppycrawl.tools.checkstyle.api

Class SeverityLevelCounter

public final class SeverityLevelCounter extends Object implements AuditListener

An audit listener that counts how many {@link AuditEvent AuditEvents} of a given severity have been generated.

Author: lkuehne

Constructor Summary
SeverityLevelCounter(SeverityLevel aLevel)
Creates a new counter.
Method Summary
voidaddError(AuditEvent aEvt)
{@inheritDoc}
voidaddException(AuditEvent aEvt, Throwable aThrowable)
{@inheritDoc}
voidauditFinished(AuditEvent aEvt)
{@inheritDoc}
voidauditStarted(AuditEvent aEvt)
{@inheritDoc}
voidfileFinished(AuditEvent aEvt)
{@inheritDoc}
voidfileStarted(AuditEvent aEvt)
{@inheritDoc}
intgetCount()
Returns the number of counted events since audit started.

Constructor Detail

SeverityLevelCounter

public SeverityLevelCounter(SeverityLevel aLevel)
Creates a new counter.

Parameters: aLevel the severity level events need to have, must be non-null.

Method Detail

addError

public void addError(AuditEvent aEvt)
{@inheritDoc}

addException

public void addException(AuditEvent aEvt, Throwable aThrowable)
{@inheritDoc}

auditFinished

public void auditFinished(AuditEvent aEvt)
{@inheritDoc}

auditStarted

public void auditStarted(AuditEvent aEvt)
{@inheritDoc}

fileFinished

public void fileFinished(AuditEvent aEvt)
{@inheritDoc}

fileStarted

public void fileStarted(AuditEvent aEvt)
{@inheritDoc}

getCount

public int getCount()
Returns the number of counted events since audit started.

Returns: the number of counted events since audit started.