Class XpathFileGeneratorAuditListener

java.lang.Object
com.puppycrawl.tools.checkstyle.api.AutomaticBean
com.puppycrawl.tools.checkstyle.XpathFileGeneratorAuditListener
All Implemented Interfaces:
AuditListener, Configurable, Contextualizable, EventListener

public class XpathFileGeneratorAuditListener extends AutomaticBean implements AuditListener
Generates suppressions.xml file, based on violations occurred. See issue #102 https://github.com/checkstyle/checkstyle/issues/102
  • Constructor Details

    • XpathFileGeneratorAuditListener

      public XpathFileGeneratorAuditListener(OutputStream out, AutomaticBean.OutputStreamOptions outputStreamOptions)
      Creates a new SuppressionFileGenerator instance. Sets the output to a defined stream.
      Parameters:
      out - the output stream
      outputStreamOptions - if CLOSE stream should be closed in auditFinished()
  • Method Details

    • auditStarted

      public void auditStarted(AuditEvent event)
      Description copied from interface: AuditListener
      Notify that the audit is about to start.
      Specified by:
      auditStarted in interface AuditListener
      Parameters:
      event - the event details
    • auditFinished

      public void auditFinished(AuditEvent event)
      Description copied from interface: AuditListener
      Notify that the audit is finished.
      Specified by:
      auditFinished in interface AuditListener
      Parameters:
      event - the event details
    • fileStarted

      public void fileStarted(AuditEvent event)
      Description copied from interface: AuditListener
      Notify that audit is about to start on a specific file.
      Specified by:
      fileStarted in interface AuditListener
      Parameters:
      event - the event details
    • fileFinished

      public void fileFinished(AuditEvent event)
      Description copied from interface: AuditListener
      Notify that audit is finished on a specific file.
      Specified by:
      fileFinished in interface AuditListener
      Parameters:
      event - the event details
    • addError

      public void addError(AuditEvent event)
      Description copied from interface: AuditListener
      Notify that an audit error was discovered on a specific file.
      Specified by:
      addError in interface AuditListener
      Parameters:
      event - the event details
    • addException

      public void addException(AuditEvent event, Throwable throwable)
      Description copied from interface: AuditListener
      Notify that an exception happened while performing audit.
      Specified by:
      addException in interface AuditListener
      Parameters:
      event - the event details
      throwable - details of the exception
    • finishLocalSetup

      protected void finishLocalSetup()
      Description copied from class: AutomaticBean
      Provides a hook to finish the part of this component's setup that was not handled by the bean introspection.

      The default implementation does nothing.

      Specified by:
      finishLocalSetup in class AutomaticBean