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>propertiesDeprecated.The properties.protected List<String>ruleChainVisitsDeprecated.Subclasses can manage RuleChain visits via this list.protected StringversionDeprecated.The XPath version;protected StringxpathDeprecated.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 booleanisSupportedVersion(String version)Deprecated.Subclasses should implement to indicate whether an XPath version is supported.voidsetProperties(Map<PropertyDescriptor<?>,Object> properties)Deprecated.Set the properties to use during the XPath query.voidsetVersion(String version)Deprecated.Set the XPath version to be used.voidsetXPath(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:XPathRuleQuerySet the XPath query string to be used.- Specified by:
setXPathin interfaceXPathRuleQuery- Parameters:
xpath- The XPath query string.
-
setVersion
public void setVersion(String version) throws UnsupportedOperationException
Deprecated.Description copied from interface:XPathRuleQuerySet the XPath version to be used.- Specified by:
setVersionin 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:
trueif the XPath version is supported,falseotherwise.
-
setProperties
public void setProperties(Map<PropertyDescriptor<?>,Object> properties)
Deprecated.Description copied from interface:XPathRuleQuerySet the properties to use during the XPath query.- Specified by:
setPropertiesin interfaceXPathRuleQuery
-
getRuleChainVisits
public List<String> getRuleChainVisits()
Deprecated.Description copied from interface:XPathRuleQueryIndicates 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:
getRuleChainVisitsin interfaceXPathRuleQuery
-
evaluate
public abstract List<Node> evaluate(Node node, RuleContext data)
Deprecated.Description copied from interface:XPathRuleQueryEvaluate the XPath query against the given Node.- Specified by:
evaluatein interfaceXPathRuleQuery- Parameters:
node- The Node.data- The RuleContext.- Returns:
- The matching Nodes.
-
-