Class XpathFileGeneratorAstFilter

java.lang.Object
com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
com.puppycrawl.tools.checkstyle.XpathFileGeneratorAstFilter
All Implemented Interfaces:
Configurable, Contextualizable, TreeWalkerFilter

Catches TreeWalkerAuditEvent and generates corresponding xpath query. Stores violations and xpath queries map inside static variable for XpathFileGeneratorAuditListener. See issue #102
  • Field Details

  • Constructor Details

  • Method Details

    • setTabWidth

      public void setTabWidth(int tabWidth)
      Sets tab width.
      Parameters:
      tabWidth - the distance between tab stops
    • findCorrespondingXpathQuery

      Returns xpath query corresponding to violation of the TreeWalkerAuditEvent object which points to the same AST element as specified AuditEvent object.
      Parameters:
      event - the AuditEvent object.
      Returns:
      returns corresponding xpath query
    • finishLocalSetup

      protected void finishLocalSetup()
      Description copied from class: AbstractAutomaticBean
      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 AbstractAutomaticBean
    • accept

      public boolean accept(TreeWalkerAuditEvent event)
      Description copied from interface: TreeWalkerFilter
      Determines whether or not a filtered TreeWalkerAuditEvent is accepted.
      Specified by:
      accept in interface TreeWalkerFilter
      Parameters:
      event - the TreeWalkerAuditEvent to filter.
      Returns:
      true if the event is accepted.