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