|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.pmd.lang.rule.xpath.AbstractXPathRuleQuery
public abstract class AbstractXPathRuleQuery
This implementation of XPathRuleQuery provides support for RuleChain visits.
Field Summary | |
---|---|
protected Map<PropertyDescriptor<?>,Object> |
properties
The properties. |
protected List<String> |
ruleChainVisits
Subclasses can manage RuleChain visits via this list. |
protected String |
version
The XPath version; |
protected String |
xpath
The XPath query string. |
Fields inherited from interface net.sourceforge.pmd.lang.rule.xpath.XPathRuleQuery |
---|
XPATH_1_0, XPATH_1_0_COMPATIBILITY, XPATH_2_0 |
Constructor Summary | |
---|---|
AbstractXPathRuleQuery()
|
Method Summary | |
---|---|
abstract List<Node> |
evaluate(Node node,
RuleContext data)
Evaluate the XPath query against the given Node. |
List<String> |
getRuleChainVisits()
Indicates which AST Nodes (if any) should be used with the RuleChain. |
protected abstract boolean |
isSupportedVersion(String version)
Subclasses should implement to indicate whether an XPath version is supported. |
void |
setProperties(Map<PropertyDescriptor<?>,Object> properties)
Set the properties to use during the XPath query. |
void |
setVersion(String version)
Set the XPath version to be used. |
void |
setXPath(String xpath)
Set the XPath query string to be used. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String xpath
protected String version
protected Map<PropertyDescriptor<?>,Object> properties
protected final List<String> ruleChainVisits
Constructor Detail |
---|
public AbstractXPathRuleQuery()
Method Detail |
---|
public void setXPath(String xpath)
setXPath
in interface XPathRuleQuery
xpath
- The XPath query string.public void setVersion(String version) throws UnsupportedOperationException
setVersion
in interface XPathRuleQuery
version
- The XPath version.
UnsupportedOperationException
- if the version cannot be handled.protected abstract boolean isSupportedVersion(String version)
version
- The XPath version.
true
if the XPath version is supported,
false
otherwise.public void setProperties(Map<PropertyDescriptor<?>,Object> properties)
setProperties
in interface XPathRuleQuery
public List<String> getRuleChainVisits()
getRuleChainVisits
in interface XPathRuleQuery
public abstract List<Node> evaluate(Node node, RuleContext data)
evaluate
in interface XPathRuleQuery
node
- The Node.data
- The RuleContext.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |