Class SaxonXPathRuleQuery
- java.lang.Object
-
- net.sourceforge.pmd.lang.rule.xpath.AbstractXPathRuleQuery
-
- net.sourceforge.pmd.lang.rule.xpath.SaxonXPathRuleQuery
-
- All Implemented Interfaces:
XPathRuleQuery
public class SaxonXPathRuleQuery extends AbstractXPathRuleQuery
This is a Saxon based XPathRule query.
-
-
Field Summary
-
Fields inherited from class net.sourceforge.pmd.lang.rule.xpath.AbstractXPathRuleQuery
properties, ruleChainVisits, version, xpath
-
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 SaxonXPathRuleQuery()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Node>
evaluate(Node node, RuleContext data)
Evaluate the XPath query against the given Node.static net.sf.saxon.value.AtomicValue
getAtomicRepresentation(java.lang.Object value)
Gets the Saxon representation of the parameter, if its type corresponds to an XPath 2.0 atomic datatype.boolean
isSupportedVersion(java.lang.String version)
Subclasses should implement to indicate whether an XPath version is supported.-
Methods inherited from class net.sourceforge.pmd.lang.rule.xpath.AbstractXPathRuleQuery
getRuleChainVisits, setProperties, setVersion, setXPath
-
-
-
-
Method Detail
-
isSupportedVersion
public boolean isSupportedVersion(java.lang.String version)
Description copied from class:AbstractXPathRuleQuery
Subclasses should implement to indicate whether an XPath version is supported.- Specified by:
isSupportedVersion
in classAbstractXPathRuleQuery
- Parameters:
version
- The XPath version.- Returns:
true
if the XPath version is supported,false
otherwise.
-
evaluate
public java.util.List<Node> evaluate(Node node, RuleContext data)
Description copied from interface:XPathRuleQuery
Evaluate the XPath query against the given Node.- Specified by:
evaluate
in interfaceXPathRuleQuery
- Specified by:
evaluate
in classAbstractXPathRuleQuery
- Parameters:
node
- The Node.data
- The RuleContext.- Returns:
- The matching Nodes.
-
getAtomicRepresentation
public static net.sf.saxon.value.AtomicValue getAtomicRepresentation(java.lang.Object value)
Gets the Saxon representation of the parameter, if its type corresponds to an XPath 2.0 atomic datatype.- Parameters:
value
- The value to convert- Returns:
- The converted AtomicValue
-
-