Package org.jaxen.dom

Class DocumentNavigator.NodeIterator

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.w3c.dom.Node node  
    • Constructor Summary

      Constructors 
      Constructor Description
      NodeIterator​(org.w3c.dom.Node contextNode)
      Constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract org.w3c.dom.Node getFirstNode​(org.w3c.dom.Node contextNode)
      Get the first node for iteration.
      protected abstract org.w3c.dom.Node getNextNode​(org.w3c.dom.Node contextNode)
      Get the next node for iteration.
      boolean hasNext()  
      private boolean isXPathNode​(org.w3c.dom.Node node)
      Test whether a DOM node is usable by XPath.
      java.lang.Object next()  
      void remove()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Field Detail

      • node

        private org.w3c.dom.Node node
    • Constructor Detail

      • NodeIterator

        public NodeIterator​(org.w3c.dom.Node contextNode)
        Constructor.
        Parameters:
        contextNode - the starting node
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator
      • next

        public java.lang.Object next()
        Specified by:
        next in interface java.util.Iterator
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator
      • getFirstNode

        protected abstract org.w3c.dom.Node getFirstNode​(org.w3c.dom.Node contextNode)
        Get the first node for iteration.

        This method must derive an initial node for iteration from a context node.

        Parameters:
        contextNode - the starting node
        Returns:
        the first node in the iteration
        See Also:
        getNextNode(org.w3c.dom.Node)
      • getNextNode

        protected abstract org.w3c.dom.Node getNextNode​(org.w3c.dom.Node contextNode)
        Get the next node for iteration.

        This method must locate a following node from the current context node.

        Parameters:
        contextNode - the current node in the iteration
        Returns:
        the following node in the iteration, or null if there is none
        See Also:
        getFirstNode(org.w3c.dom.Node)
      • isXPathNode

        private boolean isXPathNode​(org.w3c.dom.Node node)
        Test whether a DOM node is usable by XPath.
        Parameters:
        node - the DOM node to test
        Returns:
        true if the node is usable, false if it should be skipped