Class Matcher

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Matcher FAIL
      State of a failed XPath evaluation, where nothing is matched.
    • Constructor Summary

      Constructors 
      Constructor Description
      Matcher()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Matcher descend​(java.lang.String namespace, java.lang.String name)
      Returns the XPath evaluation state that results from descending to a child element with the given name.
      boolean matchesAttribute​(java.lang.String namespace, java.lang.String name)
      Returns true if the XPath expression matches the named attribute of the element associated with this evaluation state.
      boolean matchesElement()
      Returns true if the XPath expression matches the element associated with this evaluation state.
      boolean matchesText()
      Returns true if the XPath expression matches all text nodes whose parent is the element associated with this evaluation state.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • FAIL

        public static final Matcher FAIL
        State of a failed XPath evaluation, where nothing is matched. This matcher instance is used as a sentinel object whenever an XPath evaluation branch fails.
    • Constructor Detail

      • Matcher

        public Matcher()
    • Method Detail

      • descend

        public Matcher descend​(java.lang.String namespace,
                               java.lang.String name)
        Returns the XPath evaluation state that results from descending to a child element with the given name.
        Parameters:
        namespace - element namespace or null
        name - element name
        Returns:
        next XPath evaluation state
      • matchesElement

        public boolean matchesElement()
        Returns true if the XPath expression matches the element associated with this evaluation state.
        Returns:
        XPath evaluation state for this element
      • matchesAttribute

        public boolean matchesAttribute​(java.lang.String namespace,
                                        java.lang.String name)
        Returns true if the XPath expression matches the named attribute of the element associated with this evaluation state.
        Parameters:
        namespace - attribute namespace or null
        name - attribute name
        Returns:
        XPath evaluation state for named attribute of this element
      • matchesText

        public boolean matchesText()
        Returns true if the XPath expression matches all text nodes whose parent is the element associated with this evaluation state.
        Returns:
        XPath evaluation state for text children of this element