net.sourceforge.pmd.rules

Class XPathRule

public class XPathRule extends AbstractJavaRule

Rule that tries to match an XPath expression against a DOM view of the AST of a "compilation unit".

This rule needs a property "xpath".

Method Summary
voidapply(List astCompilationUnits, RuleContext ctx)
Apply the rule to all compilation units.
voidevaluate(Node compilationUnit, RuleContext data)
Evaluate the AST with compilationUnit as root-node, against the XPath expression found as property with name "xpath".
List<String>getRuleChainVisits()

Method Detail

apply

public void apply(List astCompilationUnits, RuleContext ctx)
Apply the rule to all compilation units.

evaluate

public void evaluate(Node compilationUnit, RuleContext data)
Evaluate the AST with compilationUnit as root-node, against the XPath expression found as property with name "xpath". All matches are reported as violations.

Parameters: compilationUnit the Node that is the root of the AST to be checked data

getRuleChainVisits

public List<String> getRuleChainVisits()