Package net.sourceforge.pmd.lang.rule
Class AbstractRuleChainVisitor
- java.lang.Object
-
- net.sourceforge.pmd.lang.rule.AbstractRuleChainVisitor
-
- All Implemented Interfaces:
RuleChainVisitor
@Deprecated public abstract class AbstractRuleChainVisitor extends Object implements RuleChainVisitor
Deprecated.SeeRuleChainVisitor
This is a base class for RuleChainVisitor implementations which extracts interesting nodes from an AST, and lets each Rule visit the nodes it has expressed interest in.
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,List<Node>>
nodeNameToNodes
Deprecated.This is a mapping from node names to nodes instances for the current AST.protected Map<RuleSet,List<Rule>>
ruleSetRules
Deprecated.These are all the rules participating in the RuleChain, grouped by RuleSet.
-
Constructor Summary
Constructors Constructor Description AbstractRuleChainVisitor()
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(RuleSet ruleSet, Rule rule)
Deprecated.Add the given rule to the visitor.protected void
clear()
Deprecated.Clears the internal data structure used to manage the nodes visited between visiting different ASTs.protected void
indexNode(Node node)
Deprecated.Index a single node for visitation by rules.protected abstract void
indexNodes(List<Node> nodes, RuleContext ctx)
Deprecated.Index all nodes for visitation by rules.protected void
initialize()
Deprecated.Initialize the RuleChainVisitor to be ready to perform visitations.protected abstract void
visit(Rule rule, Node node, RuleContext ctx)
Deprecated.Visit the given rule to the given node.void
visitAll(List<Node> nodes, RuleContext ctx)
Deprecated.Visit all the given Nodes provided using the given RuleContext.
-
-
-
Method Detail
-
add
public void add(RuleSet ruleSet, Rule rule)
Deprecated.Description copied from interface:RuleChainVisitor
Add the given rule to the visitor.- Specified by:
add
in interfaceRuleChainVisitor
- Parameters:
ruleSet
- The RuleSet to which the rule belongs.rule
- The rule to add.- See Also:
RuleChainVisitor.add(RuleSet, Rule)
-
visitAll
public void visitAll(List<Node> nodes, RuleContext ctx)
Deprecated.Description copied from interface:RuleChainVisitor
Visit all the given Nodes provided using the given RuleContext. Every Rule added will visit the AST as appropriate.- Specified by:
visitAll
in interfaceRuleChainVisitor
- Parameters:
nodes
- The Nodes to visit.ctx
- The RuleContext.- See Also:
RuleChainVisitor.visitAll(List, RuleContext)
-
visit
protected abstract void visit(Rule rule, Node node, RuleContext ctx)
Deprecated.Visit the given rule to the given node.
-
indexNodes
protected abstract void indexNodes(List<Node> nodes, RuleContext ctx)
Deprecated.Index all nodes for visitation by rules.
-
indexNode
protected void indexNode(Node node)
Deprecated.Index a single node for visitation by rules.
-
initialize
protected void initialize()
Deprecated.Initialize the RuleChainVisitor to be ready to perform visitations. This method should not be called until it is known that all Rules participating in the RuleChain are ready to be initialized themselves. Some rules may require full initialization to determine if they will participate in the RuleChain, so this has been delayed as long as possible to ensure that manipulation of the Rules is no longer occurring.
-
clear
protected void clear()
Deprecated.Clears the internal data structure used to manage the nodes visited between visiting different ASTs.
-
-