Class ElementNode

  • All Implemented Interfaces:
    Source, SourceLocator, net.sf.saxon.lib.ActiveSource, net.sf.saxon.om.GroundedValue, net.sf.saxon.om.Item, net.sf.saxon.om.NodeInfo, net.sf.saxon.om.Sequence, net.sf.saxon.s9api.Location, Locator

    public class ElementNode
    extends AbstractNode
    Represents element node of Xpath-tree.
    • Constructor Detail

      • ElementNode

        public ElementNode​(AbstractNode root,
                           AbstractNode parent,
                           DetailAST detailAst,
                           int depth,
                           int indexAmongSiblings)
        Creates a new ElementNode instance.
        Parameters:
        root - Node root of the tree
        parent - Node parent of the current node
        detailAst - reference to DetailAST
        depth - the current node depth in the hierarchy
        indexAmongSiblings - the current node index among the parent children nodes
    • Method Detail

      • compareOrder

        public int compareOrder​(net.sf.saxon.om.NodeInfo other)
        Compares current object with specified for order.
        Parameters:
        other - another NodeInfo object
        Returns:
        number representing order of current object to specified one
      • compareCommonAncestorChildrenOrder

        private static int compareCommonAncestorChildrenOrder​(net.sf.saxon.om.NodeInfo first,
                                                              net.sf.saxon.om.NodeInfo second)
        Walks up the hierarchy until a common ancestor is found. Then compares topmost sibling nodes.
        Parameters:
        first - NodeInfo to compare
        second - NodeInfo to compare
        Returns:
        the value 0 if first == second; a value less than 0 if first should be first; a value greater than 0 if second should be first.
      • hasChildNodes

        public boolean hasChildNodes()
        Determine whether the node has any children.
        Returns:
        true is the node has any children.
      • getAttributeValue

        public String getAttributeValue​(String namespace,
                                        String localPart)
        Returns attribute value. Throws UnsupportedOperationException in case, when name of the attribute is not equal to 'text'.
        Parameters:
        namespace - namespace
        localPart - actual name of the attribute
        Returns:
        attribute value
      • getNodeKind

        public int getNodeKind()
        Returns type of the node.
        Returns:
        node kind
      • getParent

        public net.sf.saxon.om.NodeInfo getParent()
        Returns parent.
        Returns:
        parent
      • getRoot

        public net.sf.saxon.om.NodeInfo getRoot()
        Returns root.
        Returns:
        root
      • iterateAxis

        public net.sf.saxon.tree.iter.AxisIterator iterateAxis​(int axisNumber)
        Determines axis iteration algorithm. Throws UnsupportedOperationException in case, when there is no axis iterator for given axisNumber.

        Reason of suppression for resource, IOResourceOpenedButNotSafelyClosed: AxisIterator implements Closeable interface, but none of the subclasses of the AxisIterator class has non-empty close() method.

        Parameters:
        axisNumber - element from AxisInfo
        Returns:
        AxisIterator object
      • getLineNumber

        public int getLineNumber()
        Returns line number.
        Returns:
        line number
      • getColumnNumber

        public int getColumnNumber()
        Returns column number.
        Returns:
        column number
      • getPrecedingSiblingsIterator

        private net.sf.saxon.tree.iter.AxisIterator getPrecedingSiblingsIterator()
        Returns preceding sibling axis iterator.

        Reason of suppression for resource, IOResourceOpenedButNotSafelyClosed: AxisIterator implements Closeable interface, but none of the subclasses of the AxisIterator class has non-empty close() method.

        Returns:
        iterator
      • getFollowingSiblingsIterator

        private net.sf.saxon.tree.iter.AxisIterator getFollowingSiblingsIterator()
        Returns following sibling axis iterator.

        Reason of suppression for resource, IOResourceOpenedButNotSafelyClosed: AxisIterator implements Closeable interface, but none of the subclasses of the AxisIterator class has non-empty close() method.

        Returns:
        iterator
      • getAttributeNode

        private AttributeNode getAttributeNode()
        Checks if token type supports @text attribute, extracts its value, creates AttributeNode object and returns it. Value can be accessed using @text attribute.
        Returns:
        attribute node if possible, otherwise the null value