abstract class DocumentNavigator.NodeIterator
extends java.lang.Object
implements java.util.Iterator
Concrete subclasses must implement the getFirstNode(org.w3c.dom.Node)
and getNextNode(org.w3c.dom.Node)
methods for a specific iteration
strategy.
Modifier and Type | Field and Description |
---|---|
private org.w3c.dom.Node |
node |
Constructor and Description |
---|
NodeIterator(org.w3c.dom.Node contextNode)
Constructor.
|
Modifier and Type | Method and 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() |
public NodeIterator(org.w3c.dom.Node contextNode)
contextNode
- the starting nodepublic boolean hasNext()
hasNext
in interface java.util.Iterator
public java.lang.Object next()
next
in interface java.util.Iterator
public void remove()
remove
in interface java.util.Iterator
protected abstract org.w3c.dom.Node getFirstNode(org.w3c.dom.Node contextNode)
This method must derive an initial node for iteration from a context node.
contextNode
- the starting nodegetNextNode(org.w3c.dom.Node)
protected abstract org.w3c.dom.Node getNextNode(org.w3c.dom.Node contextNode)
This method must locate a following node from the current context node.
contextNode
- the current node in the iterationgetFirstNode(org.w3c.dom.Node)
private boolean isXPathNode(org.w3c.dom.Node node)
node
- the DOM node to test