## com.puppycrawl.tools.checkstyle.api
Class SeverityLevelCounter

    java.lang.Object
      com.puppycrawl.tools.checkstyle.api.SeverityLevelCounter

All Implemented Interfaces:
  AuditListener, EventListener

    public final class SeverityLevelCounter

extends Object
implements AuditListener

An audit listener that counts how many `AuditEvents` of a given severity have been generated.

Author:
  lkuehne

Constructor Summary
`SeverityLevelCounter(SeverityLevel aLevel)` Creates a new counter.

Method Summary
`void` `addError(AuditEvent aEvt)` Notify that an audit error was discovered on a specific file.
`void` `addException(AuditEvent aEvt, Throwable aThrowable)` Notify that an exception happened while performing audit.
`void` `auditFinished(AuditEvent aEvt)` Notify that the audit is finished.
`void` `auditStarted(AuditEvent aEvt)` Notify that the audit is about to start.
`void` `fileFinished(AuditEvent aEvt)` Notify that audit is finished on a specific file.
`void` `fileStarted(AuditEvent aEvt)` Notify that audit is about to start on a specific file.
`int` `getCount()` Returns the number of counted events since audit started.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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)

  Notify that an audit error was discovered on a specific file.

  Specified by:
    `addError` in interface `AuditListener`
  Parameters:
    `aEvt` - the event details

### addException

    public void addException(AuditEvent aEvt,
                             Throwable aThrowable)

  Notify that an exception happened while performing audit.

  Specified by:
    `addException` in interface `AuditListener`
  Parameters:
    `aEvt` - the event details
    `aThrowable` - details of the exception

### auditStarted

    public void auditStarted(AuditEvent aEvt)

  Notify that the audit is about to start.

  Specified by:
    `auditStarted` in interface `AuditListener`
  Parameters:
    `aEvt` - the event details

### fileStarted

    public void fileStarted(AuditEvent aEvt)

  Notify that audit is about to start on a specific file.

  Specified by:
    `fileStarted` in interface `AuditListener`
  Parameters:
    `aEvt` - the event details

### auditFinished

    public void auditFinished(AuditEvent aEvt)

  Notify that the audit is finished.

  Specified by:
    `auditFinished` in interface `AuditListener`
  Parameters:
    `aEvt` - the event details

### fileFinished

    public void fileFinished(AuditEvent aEvt)

  Notify that audit is finished on a specific file.

  Specified by:
    `fileFinished` in interface `AuditListener`
  Parameters:
    `aEvt` - the event details

### getCount

    public int getCount()

  Returns the number of counted events since audit started.

  Returns:
    the number of counted events since audit started.

Back to the Checkstyle Home Page