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 List<Node>evaluate(Node node, RuleContext data)Evaluate the XPath query against the given Node.static net.sf.saxon.value.AtomicValuegetAtomicRepresentation(Object value)Gets the Saxon representation of the parameter, if its type corresponds to an XPath 2.0 atomic datatype.static net.sf.saxon.value.ValuegetSequenceRepresentation(List<?> list)booleanisSupportedVersion(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(String version)
Description copied from class:AbstractXPathRuleQuerySubclasses should implement to indicate whether an XPath version is supported.- Specified by:
isSupportedVersionin classAbstractXPathRuleQuery- Parameters:
version- The XPath version.- Returns:
trueif the XPath version is supported,falseotherwise.
-
evaluate
public List<Node> evaluate(Node node, RuleContext data)
Description copied from interface:XPathRuleQueryEvaluate the XPath query against the given Node.- Specified by:
evaluatein interfaceXPathRuleQuery- Specified by:
evaluatein classAbstractXPathRuleQuery- Parameters:
node- The Node.data- The RuleContext.- Returns:
- The matching Nodes.
-
getAtomicRepresentation
public static net.sf.saxon.value.AtomicValue getAtomicRepresentation(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
-
getSequenceRepresentation
public static net.sf.saxon.value.Value getSequenceRepresentation(List<?> list)
-
-