Package org.apache.batik.dom.traversal
Class DOMTreeWalker
- java.lang.Object
-
- org.apache.batik.dom.traversal.DOMTreeWalker
-
- All Implemented Interfaces:
org.w3c.dom.traversal.TreeWalker
public class DOMTreeWalker extends java.lang.Object implements org.w3c.dom.traversal.TreeWalker
This class implements theNodeIterator
interface.- Version:
- $Id: DOMTreeWalker.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description DOMTreeWalker(org.w3c.dom.Node n, int what, org.w3c.dom.traversal.NodeFilter nf, boolean exp)
Creates a new TreeWalker object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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: ImplementsTreeWalker.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: ImplementsTreeWalker.getCurrentNode()
.boolean
getExpandEntityReferences()
DOM: ImplementsTreeWalker.getExpandEntityReferences()
.org.w3c.dom.traversal.NodeFilter
getFilter()
DOM: ImplementsTreeWalker.getFilter()
.org.w3c.dom.Node
getRoot()
DOM: ImplementsTreeWalker.getRoot()
.int
getWhatToShow()
DOM: ImplementsTreeWalker.getWhatToShow()
.org.w3c.dom.Node
lastChild()
DOM: ImplementsTreeWalker.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: ImplementsTreeWalker.nextNode()
.org.w3c.dom.Node
nextSibling()
DOM: ImplementsTreeWalker.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: ImplementsTreeWalker.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: ImplementsTreeWalker.previousNode()
.org.w3c.dom.Node
previousSibling()
DOM: ImplementsTreeWalker.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: ImplementsTreeWalker.setCurrentNode(Node)
.
-
-
-
Field Detail
-
root
protected org.w3c.dom.Node root
The root node.
-
whatToShow
protected int whatToShow
Which node types are presented via the iterator.
-
filter
protected org.w3c.dom.traversal.NodeFilter filter
The NodeFilter used to screen nodes.
-
expandEntityReferences
protected boolean expandEntityReferences
Whether the children of entity reference nodes are visible to the iterator.
-
currentNode
protected org.w3c.dom.Node currentNode
The current node.
-
-
Constructor Detail
-
DOMTreeWalker
public DOMTreeWalker(org.w3c.dom.Node n, int what, org.w3c.dom.traversal.NodeFilter nf, boolean exp)
Creates a new TreeWalker object.- Parameters:
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.
-
-
Method Detail
-
getRoot
public org.w3c.dom.Node getRoot()
DOM: ImplementsTreeWalker.getRoot()
.- Specified by:
getRoot
in interfaceorg.w3c.dom.traversal.TreeWalker
-
getWhatToShow
public int getWhatToShow()
DOM: ImplementsTreeWalker.getWhatToShow()
.- Specified by:
getWhatToShow
in interfaceorg.w3c.dom.traversal.TreeWalker
-
getFilter
public org.w3c.dom.traversal.NodeFilter getFilter()
DOM: ImplementsTreeWalker.getFilter()
.- Specified by:
getFilter
in interfaceorg.w3c.dom.traversal.TreeWalker
-
getExpandEntityReferences
public boolean getExpandEntityReferences()
DOM: ImplementsTreeWalker.getExpandEntityReferences()
.- Specified by:
getExpandEntityReferences
in interfaceorg.w3c.dom.traversal.TreeWalker
-
getCurrentNode
public org.w3c.dom.Node getCurrentNode()
DOM: ImplementsTreeWalker.getCurrentNode()
.- Specified by:
getCurrentNode
in interfaceorg.w3c.dom.traversal.TreeWalker
-
setCurrentNode
public void setCurrentNode(org.w3c.dom.Node n)
DOM: ImplementsTreeWalker.setCurrentNode(Node)
.- Specified by:
setCurrentNode
in interfaceorg.w3c.dom.traversal.TreeWalker
-
parentNode
public org.w3c.dom.Node parentNode()
DOM: ImplementsTreeWalker.parentNode()
.- Specified by:
parentNode
in interfaceorg.w3c.dom.traversal.TreeWalker
-
firstChild
public org.w3c.dom.Node firstChild()
DOM: ImplementsTreeWalker.firstChild()
.- Specified by:
firstChild
in interfaceorg.w3c.dom.traversal.TreeWalker
-
lastChild
public org.w3c.dom.Node lastChild()
DOM: ImplementsTreeWalker.lastChild()
.- Specified by:
lastChild
in interfaceorg.w3c.dom.traversal.TreeWalker
-
previousSibling
public org.w3c.dom.Node previousSibling()
DOM: ImplementsTreeWalker.previousSibling()
.- Specified by:
previousSibling
in interfaceorg.w3c.dom.traversal.TreeWalker
-
nextSibling
public org.w3c.dom.Node nextSibling()
DOM: ImplementsTreeWalker.nextSibling()
.- Specified by:
nextSibling
in interfaceorg.w3c.dom.traversal.TreeWalker
-
previousNode
public org.w3c.dom.Node previousNode()
DOM: ImplementsTreeWalker.previousNode()
.- Specified by:
previousNode
in interfaceorg.w3c.dom.traversal.TreeWalker
-
nextNode
public org.w3c.dom.Node nextNode()
DOM: ImplementsTreeWalker.nextNode()
.- Specified by:
nextNode
in interfaceorg.w3c.dom.traversal.TreeWalker
-
parentNode
protected org.w3c.dom.Node parentNode(org.w3c.dom.Node n)
Returns the parent node of the given node.
-
firstChild
protected org.w3c.dom.Node firstChild(org.w3c.dom.Node n)
Returns the first child of the given node.
-
lastChild
protected org.w3c.dom.Node lastChild(org.w3c.dom.Node n)
Returns the last child of the given node.
-
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.
-
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.
-
acceptNode
protected short acceptNode(org.w3c.dom.Node n)
Whether or not the given node is accepted by this tree walker.
-
-