net.sourceforge.pmd.rules
Class XPathRule
java.lang.Object
net.sourceforge.pmd.CommonAbstractRule
net.sourceforge.pmd.rules.XPathRule
- All Implemented Interfaces:
- Rule
- public class XPathRule
- extends CommonAbstractRule
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".
Fields inherited from class net.sourceforge.pmd.CommonAbstractRule |
description, example, externalInfoUrl, include, message, name, priority, properties, ruleSetName, usesDFA, usesTypeResolution |
Method Summary |
void |
apply(java.util.List astCompilationUnits,
RuleContext ctx)
Apply the rule to all compilation units. |
void |
evaluate(Node compilationUnit,
RuleContext data)
Evaluate the AST with compilationUnit as root-node, against
the XPath expression found as property with name "xpath". |
static java.lang.Class |
loadClass(java.lang.ClassLoader classloader,
java.lang.String xpath,
java.lang.String name)
|
Methods inherited from class net.sourceforge.pmd.CommonAbstractRule |
addProperties, addProperty, addViolation, addViolation, addViolation, addViolationWithMessage, equals, getBooleanProperty, getDescription, getDoubleProperty, getExample, getExternalInfoUrl, getIntProperty, getMessage, getName, getPriority, getPriorityName, getProperties, getRuleSetName, getStringProperty, hashCode, hasProperty, include, propertyDescriptorFor, setDescription, setExample, setExternalInfoUrl, setInclude, setMessage, setName, setPriority, setRuleSetName, setUsesDFA, setUsesTypeResolution, usesDFA, usesTypeResolution |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
XPathRule
public XPathRule()
loadClass
public static java.lang.Class loadClass(java.lang.ClassLoader classloader,
java.lang.String xpath,
java.lang.String name)
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 checkeddata
-
apply
public void apply(java.util.List astCompilationUnits,
RuleContext ctx)
- Apply the rule to all compilation units.
Copyright © 2002-2006 InfoEther. All Rights Reserved.