RuleChainVisitor.java
01 package net.sourceforge.pmd.lang.rule;
02 
03 import java.util.List;
04 
05 import net.sourceforge.pmd.Rule;
06 import net.sourceforge.pmd.RuleContext;
07 import net.sourceforge.pmd.RuleSet;
08 import net.sourceforge.pmd.lang.ast.Node;
09 
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 }