public class DOMTreeWalker
extends java.lang.Object
implements org.w3c.dom.traversal.TreeWalker
NodeIterator
interface.Modifier and Type | Field and Description |
---|---|
protected org.w3c.dom.Node |
currentNode
The current node.
|
protected boolean |
expandEntityReferences
Whether the children of entity reference nodes are visible
to the iterator.
|
protected org.w3c.dom.traversal.NodeFilter |
filter
The NodeFilter used to screen nodes.
|
protected org.w3c.dom.Node |
root
The root node.
|
protected int |
whatToShow
Which node types are presented via the iterator.
|
Constructor and Description |
---|
DOMTreeWalker(org.w3c.dom.Node n,
int what,
org.w3c.dom.traversal.NodeFilter nf,
boolean exp)
Creates a new TreeWalker object.
|
Modifier and Type | Method and Description |
---|---|
protected short |
acceptNode(org.w3c.dom.Node n)
Whether or not the given node is accepted by this tree walker.
|
org.w3c.dom.Node |
firstChild()
DOM: Implements
TreeWalker.firstChild() . |
protected org.w3c.dom.Node |
firstChild(org.w3c.dom.Node n)
Returns the first child of the given node.
|
org.w3c.dom.Node |
getCurrentNode()
DOM: Implements
TreeWalker.getCurrentNode() . |
boolean |
getExpandEntityReferences()
DOM: Implements
TreeWalker.getExpandEntityReferences() . |
org.w3c.dom.traversal.NodeFilter |
getFilter()
DOM: Implements
TreeWalker.getFilter() . |
org.w3c.dom.Node |
getRoot()
DOM: Implements
TreeWalker.getRoot() . |
int |
getWhatToShow()
DOM: Implements
TreeWalker.getWhatToShow() . |
org.w3c.dom.Node |
lastChild()
DOM: Implements
TreeWalker.lastChild() . |
protected org.w3c.dom.Node |
lastChild(org.w3c.dom.Node n)
Returns the last child of the given node.
|
org.w3c.dom.Node |
nextNode()
DOM: Implements
TreeWalker.nextNode() . |
org.w3c.dom.Node |
nextSibling()
DOM: Implements
TreeWalker.nextSibling() . |
protected org.w3c.dom.Node |
nextSibling(org.w3c.dom.Node n,
org.w3c.dom.Node root)
Returns the next sibling of the given node.
|
org.w3c.dom.Node |
parentNode()
DOM: Implements
TreeWalker.parentNode() . |
protected org.w3c.dom.Node |
parentNode(org.w3c.dom.Node n)
Returns the parent node of the given node.
|
org.w3c.dom.Node |
previousNode()
DOM: Implements
TreeWalker.previousNode() . |
org.w3c.dom.Node |
previousSibling()
DOM: Implements
TreeWalker.previousSibling() . |
protected org.w3c.dom.Node |
previousSibling(org.w3c.dom.Node n,
org.w3c.dom.Node root)
Returns the previous sibling of the given node.
|
void |
setCurrentNode(org.w3c.dom.Node n)
DOM: Implements
TreeWalker.setCurrentNode(Node) . |
protected org.w3c.dom.Node root
protected int whatToShow
protected org.w3c.dom.traversal.NodeFilter filter
protected boolean expandEntityReferences
protected org.w3c.dom.Node currentNode
public DOMTreeWalker(org.w3c.dom.Node n, int what, org.w3c.dom.traversal.NodeFilter nf, boolean exp)
n
- The root node.what
- Which node types are presented via the iterator.nf
- The NodeFilter used to screen nodes.exp
- Whether the children of entity reference nodes are visible
to the tree walker.public org.w3c.dom.Node getRoot()
TreeWalker.getRoot()
.getRoot
in interface org.w3c.dom.traversal.TreeWalker
public int getWhatToShow()
TreeWalker.getWhatToShow()
.getWhatToShow
in interface org.w3c.dom.traversal.TreeWalker
public org.w3c.dom.traversal.NodeFilter getFilter()
TreeWalker.getFilter()
.getFilter
in interface org.w3c.dom.traversal.TreeWalker
public boolean getExpandEntityReferences()
TreeWalker.getExpandEntityReferences()
.getExpandEntityReferences
in interface org.w3c.dom.traversal.TreeWalker
public org.w3c.dom.Node getCurrentNode()
TreeWalker.getCurrentNode()
.getCurrentNode
in interface org.w3c.dom.traversal.TreeWalker
public void setCurrentNode(org.w3c.dom.Node n)
TreeWalker.setCurrentNode(Node)
.setCurrentNode
in interface org.w3c.dom.traversal.TreeWalker
public org.w3c.dom.Node parentNode()
TreeWalker.parentNode()
.parentNode
in interface org.w3c.dom.traversal.TreeWalker
public org.w3c.dom.Node firstChild()
TreeWalker.firstChild()
.firstChild
in interface org.w3c.dom.traversal.TreeWalker
public org.w3c.dom.Node lastChild()
TreeWalker.lastChild()
.lastChild
in interface org.w3c.dom.traversal.TreeWalker
public org.w3c.dom.Node previousSibling()
TreeWalker.previousSibling()
.previousSibling
in interface org.w3c.dom.traversal.TreeWalker
public org.w3c.dom.Node nextSibling()
TreeWalker.nextSibling()
.nextSibling
in interface org.w3c.dom.traversal.TreeWalker
public org.w3c.dom.Node previousNode()
TreeWalker.previousNode()
.previousNode
in interface org.w3c.dom.traversal.TreeWalker
public org.w3c.dom.Node nextNode()
TreeWalker.nextNode()
.nextNode
in interface org.w3c.dom.traversal.TreeWalker
protected org.w3c.dom.Node parentNode(org.w3c.dom.Node n)
protected org.w3c.dom.Node firstChild(org.w3c.dom.Node n)
protected org.w3c.dom.Node lastChild(org.w3c.dom.Node n)
protected org.w3c.dom.Node previousSibling(org.w3c.dom.Node n, org.w3c.dom.Node root)
protected org.w3c.dom.Node nextSibling(org.w3c.dom.Node n, org.w3c.dom.Node root)
protected short acceptNode(org.w3c.dom.Node n)