Interface XPathRuleQuery

  • All Known Implementing Classes:
    AbstractXPathRuleQuery, JaxenXPathRuleQuery, SaxonXPathRuleQuery

    public interface XPathRuleQuery
    This will be internalized in 7.0.0.
    This interface captures the logic needed by XPathRule to implement an XPath based query on an AST Node.

    Implementations of this class do not need to be thread-safe, but they will be reused to query against different AST Nodes. Therefore, internal state should be maintained in a fashion consistent with reuse. Further, implementations are recommended to manage internal state that is invariant over AST Nodes in a fashion which facilities high performance (e.g. caching).

    • Method Detail

      • setXPath

        void setXPath​(String xpath)
        Set the XPath query string to be used.
        xpath - The XPath query string.
      • setProperties

        void setProperties​(Map<PropertyDescriptor<?>,​Object> properties)
        Set the properties to use during the XPath query.
      • getRuleChainVisits

        List<String> getRuleChainVisits()
        Indicates which AST Nodes (if any) should be used with the RuleChain. Use of the RuleChain will allow the query execute on a targed sub-tree of the AST, instead of the entire AST from the root. This can result in great performance benefits.
      • evaluate

        List<Node> evaluate​(Node node,
                            RuleContext data)
        Evaluate the XPath query against the given Node.
        node - The Node.
        data - The RuleContext.
        The matching Nodes.