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.TreeWalkerThis class implements theNodeIteratorinterface.- Version:
- $Id: DOMTreeWalker.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Field Summary
Fields Modifier and Type Field Description protected org.w3c.dom.NodecurrentNodeThe current node.protected booleanexpandEntityReferencesWhether the children of entity reference nodes are visible to the iterator.protected org.w3c.dom.traversal.NodeFilterfilterThe NodeFilter used to screen nodes.protected org.w3c.dom.NoderootThe root node.protected intwhatToShowWhich 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 shortacceptNode(org.w3c.dom.Node n)Whether or not the given node is accepted by this tree walker.org.w3c.dom.NodefirstChild()DOM: ImplementsTreeWalker.firstChild().protected org.w3c.dom.NodefirstChild(org.w3c.dom.Node n)Returns the first child of the given node.org.w3c.dom.NodegetCurrentNode()DOM: ImplementsTreeWalker.getCurrentNode().booleangetExpandEntityReferences()DOM: ImplementsTreeWalker.getExpandEntityReferences().org.w3c.dom.traversal.NodeFiltergetFilter()DOM: ImplementsTreeWalker.getFilter().org.w3c.dom.NodegetRoot()DOM: ImplementsTreeWalker.getRoot().intgetWhatToShow()DOM: ImplementsTreeWalker.getWhatToShow().org.w3c.dom.NodelastChild()DOM: ImplementsTreeWalker.lastChild().protected org.w3c.dom.NodelastChild(org.w3c.dom.Node n)Returns the last child of the given node.org.w3c.dom.NodenextNode()DOM: ImplementsTreeWalker.nextNode().org.w3c.dom.NodenextSibling()DOM: ImplementsTreeWalker.nextSibling().protected org.w3c.dom.NodenextSibling(org.w3c.dom.Node n, org.w3c.dom.Node root)Returns the next sibling of the given node.org.w3c.dom.NodeparentNode()DOM: ImplementsTreeWalker.parentNode().protected org.w3c.dom.NodeparentNode(org.w3c.dom.Node n)Returns the parent node of the given node.org.w3c.dom.NodepreviousNode()DOM: ImplementsTreeWalker.previousNode().org.w3c.dom.NodepreviousSibling()DOM: ImplementsTreeWalker.previousSibling().protected org.w3c.dom.NodepreviousSibling(org.w3c.dom.Node n, org.w3c.dom.Node root)Returns the previous sibling of the given node.voidsetCurrentNode(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:
getRootin interfaceorg.w3c.dom.traversal.TreeWalker
-
getWhatToShow
public int getWhatToShow()
DOM: ImplementsTreeWalker.getWhatToShow().- Specified by:
getWhatToShowin interfaceorg.w3c.dom.traversal.TreeWalker
-
getFilter
public org.w3c.dom.traversal.NodeFilter getFilter()
DOM: ImplementsTreeWalker.getFilter().- Specified by:
getFilterin interfaceorg.w3c.dom.traversal.TreeWalker
-
getExpandEntityReferences
public boolean getExpandEntityReferences()
DOM: ImplementsTreeWalker.getExpandEntityReferences().- Specified by:
getExpandEntityReferencesin interfaceorg.w3c.dom.traversal.TreeWalker
-
getCurrentNode
public org.w3c.dom.Node getCurrentNode()
DOM: ImplementsTreeWalker.getCurrentNode().- Specified by:
getCurrentNodein interfaceorg.w3c.dom.traversal.TreeWalker
-
setCurrentNode
public void setCurrentNode(org.w3c.dom.Node n)
DOM: ImplementsTreeWalker.setCurrentNode(Node).- Specified by:
setCurrentNodein interfaceorg.w3c.dom.traversal.TreeWalker
-
parentNode
public org.w3c.dom.Node parentNode()
DOM: ImplementsTreeWalker.parentNode().- Specified by:
parentNodein interfaceorg.w3c.dom.traversal.TreeWalker
-
firstChild
public org.w3c.dom.Node firstChild()
DOM: ImplementsTreeWalker.firstChild().- Specified by:
firstChildin interfaceorg.w3c.dom.traversal.TreeWalker
-
lastChild
public org.w3c.dom.Node lastChild()
DOM: ImplementsTreeWalker.lastChild().- Specified by:
lastChildin interfaceorg.w3c.dom.traversal.TreeWalker
-
previousSibling
public org.w3c.dom.Node previousSibling()
DOM: ImplementsTreeWalker.previousSibling().- Specified by:
previousSiblingin interfaceorg.w3c.dom.traversal.TreeWalker
-
nextSibling
public org.w3c.dom.Node nextSibling()
DOM: ImplementsTreeWalker.nextSibling().- Specified by:
nextSiblingin interfaceorg.w3c.dom.traversal.TreeWalker
-
previousNode
public org.w3c.dom.Node previousNode()
DOM: ImplementsTreeWalker.previousNode().- Specified by:
previousNodein interfaceorg.w3c.dom.traversal.TreeWalker
-
nextNode
public org.w3c.dom.Node nextNode()
DOM: ImplementsTreeWalker.nextNode().- Specified by:
nextNodein 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.
-
-