Package org.jaxen.dom
Class DocumentNavigator.NodeIterator
java.lang.Object
org.jaxen.dom.DocumentNavigator.NodeIterator
- All Implemented Interfaces:
Iterator
- Enclosing class:
DocumentNavigator
A generic iterator over DOM nodes.
Concrete subclasses must implement the getFirstNode(org.w3c.dom.Node)
and getNextNode(org.w3c.dom.Node)
methods for a specific iteration
strategy.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Node
getFirstNode
(Node contextNode) Get the first node for iteration.protected abstract Node
getNextNode
(Node contextNode) Get the next node for iteration.boolean
hasNext()
private boolean
isXPathNode
(Node node) Test whether a DOM node is usable by XPath.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 Details
-
node
-
-
Constructor Details
-
NodeIterator
Constructor.- Parameters:
contextNode
- the starting node
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove() -
getFirstNode
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
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:
-
isXPathNode
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
-