View Javadoc

    1   package net.sourceforge.pmd.lang.rule;
    2
    3   import java.util.List;
    4
    5   import net.sourceforge.pmd.Rule;
    6   import net.sourceforge.pmd.RuleContext;
    7   import net.sourceforge.pmd.RuleSet;
    8   import net.sourceforge.pmd.lang.ast.Node;
    9
    10  /**
    11   * The RuleChainVisitor understands how to visit an AST for a particular
    12   * Language.
    13   */
    14  public interface RuleChainVisitor {
    15      /**
    16       * Add the given rule to the visitor.
    17       *
    18       * @param ruleSet
    19       *            The RuleSet to which the rule belongs.
    20       * @param rule
    21       *            The rule to add.
    22       */
    23      void add(RuleSet ruleSet, Rule rule);
    24
    25      /**
    26       * Visit all the given Nodes provided using the given
    27       * RuleContext. Every Rule added will visit the AST as appropriate.
    28       *
    29       * @param nodes
    30       *            The Nodes to visit.
    31       * @param ctx
    32       *            The RuleContext.
    33       */
    34      void visitAll(List<Node> nodes, RuleContext ctx);
    35  }