Class DOMTreeResolver

    • Constructor Detail

      • DOMTreeResolver

        public DOMTreeResolver()
    • Method Detail

      • getParentElement

        public Node getParentElement​(Node element)
        Description copied from interface: TreeResolver
        returns the parent element of an element, or null if this was the root element
        Specified by:
        getParentElement in interface TreeResolver
      • getElementName

        public String getElementName​(Node element)
        Description copied from interface: TreeResolver
        returns the name of the element so that it may match against the selectors
        Specified by:
        getElementName in interface TreeResolver
      • isFirstChildElement

        public boolean isFirstChildElement​(Node element)
        Description copied from interface: TreeResolver
        returns true if this element is the first child element of its parent
        Specified by:
        isFirstChildElement in interface TreeResolver
      • isLastChildElement

        public boolean isLastChildElement​(Node element)
        Description copied from interface: TreeResolver
        returns true if this element is the last child element of its parent
        Specified by:
        isLastChildElement in interface TreeResolver
      • matchesElement

        public boolean matchesElement​(Node element,
                                      String namespaceURI,
                                      String name)
        Description copied from interface: TreeResolver
        Returns true if element has the local name name and namespace URI namespaceURI.
        Specified by:
        matchesElement in interface TreeResolver
        Parameters:
        element - The node
        namespaceURI - The namespace to match, may be null to signify any namespace. Use TreeResolver.NO_NAMESPACE to signify that name should only match when there is no namespace defined on element.
        name - The name to match, may not be null
      • getPositionOfElement

        public int getPositionOfElement​(Node element)
        Description copied from interface: TreeResolver
        Returns the index of the position of the submitted element among its element node siblings.
        Specified by:
        getPositionOfElement in interface TreeResolver
        Parameters:
        element - The node
        Returns:
        -1 in case of error, 0 indexed position otherwise