Class AbstractXPathRuleQuery
- java.lang.Object
-
- net.sourceforge.pmd.lang.rule.xpath.AbstractXPathRuleQuery
-
- All Implemented Interfaces:
XPathRuleQuery
- Direct Known Subclasses:
JaxenXPathRuleQuery
,SaxonXPathRuleQuery
@Deprecated @InternalApi public abstract class AbstractXPathRuleQuery extends Object implements XPathRuleQuery
Deprecated.Internal APIThis implementation of XPathRuleQuery provides support for RuleChain visits.
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<PropertyDescriptor<?>,Object>
properties
Deprecated.The properties.protected List<String>
ruleChainVisits
Deprecated.Subclasses can manage RuleChain visits via this list.protected String
version
Deprecated.The XPath version;protected String
xpath
Deprecated.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
Constructors Constructor Description AbstractXPathRuleQuery()
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract List<Node>
evaluate(Node node, RuleContext data)
Deprecated.Evaluate the XPath query against the given Node.List<String>
getRuleChainVisits()
Deprecated.Indicates which AST Nodes (if any) should be used with the RuleChain.protected abstract boolean
isSupportedVersion(String version)
Deprecated.Subclasses should implement to indicate whether an XPath version is supported.void
setProperties(Map<PropertyDescriptor<?>,Object> properties)
Deprecated.Set the properties to use during the XPath query.void
setVersion(String version)
Deprecated.Set the XPath version to be used.void
setXPath(String xpath)
Deprecated.Set the XPath query string to be used.
-
-
-
Field Detail
-
xpath
protected String xpath
Deprecated.The XPath query string.
-
version
protected String version
Deprecated.The XPath version;
-
properties
protected Map<PropertyDescriptor<?>,Object> properties
Deprecated.The properties.
-
-
Method Detail
-
setXPath
public void setXPath(String xpath)
Deprecated.Description copied from interface:XPathRuleQuery
Set the XPath query string to be used.- Specified by:
setXPath
in interfaceXPathRuleQuery
- Parameters:
xpath
- The XPath query string.
-
setVersion
public void setVersion(String version) throws UnsupportedOperationException
Deprecated.Description copied from interface:XPathRuleQuery
Set the XPath version to be used.- Specified by:
setVersion
in interfaceXPathRuleQuery
- Parameters:
version
- The XPath version.- Throws:
UnsupportedOperationException
- if the version cannot be handled.
-
isSupportedVersion
protected abstract boolean isSupportedVersion(String version)
Deprecated.Subclasses should implement to indicate whether an XPath version is supported.- Parameters:
version
- The XPath version.- Returns:
true
if the XPath version is supported,false
otherwise.
-
setProperties
public void setProperties(Map<PropertyDescriptor<?>,Object> properties)
Deprecated.Description copied from interface:XPathRuleQuery
Set the properties to use during the XPath query.- Specified by:
setProperties
in interfaceXPathRuleQuery
-
getRuleChainVisits
public List<String> getRuleChainVisits()
Deprecated.Description copied from interface:XPathRuleQuery
Indicates which AST Nodes (if any) should be used with the RuleChain. Use of the RuleChain will allow the query execute on a targeted sub-tree of the AST, instead of the entire AST from the root. This can result in great performance benefits.- Specified by:
getRuleChainVisits
in interfaceXPathRuleQuery
-
evaluate
public abstract List<Node> evaluate(Node node, RuleContext data)
Deprecated.Description copied from interface:XPathRuleQuery
Evaluate the XPath query against the given Node.- Specified by:
evaluate
in interfaceXPathRuleQuery
- Parameters:
node
- The Node.data
- The RuleContext.- Returns:
- The matching Nodes.
-
-