org.apache.batik.dom.traversal

Class DOMTreeWalker

public class DOMTreeWalker extends Object implements TreeWalker

This class implements the org.w3c.dom.traversal.NodeIterator interface.
Field Summary
protected NodecurrentNode
The current node.
protected booleanexpandEntityReferences
Whether the children of entity reference nodes are visible to the iterator.
protected NodeFilterfilter
The NodeFilter used to screen nodes.
protected Noderoot
The root node.
protected intwhatToShow
Which node types are presented via the iterator.
Constructor Summary
DOMTreeWalker(Node n, int what, NodeFilter nf, boolean exp)
Creates a new TreeWalker object.
Method Summary
protected shortacceptNode(Node n)
Whether or not the given node is accepted by this tree walker.
NodefirstChild()
DOM: Implements TreeWalker#firstChild().
protected NodefirstChild(Node n)
Returns the first child of the given node.
NodegetCurrentNode()
DOM: Implements TreeWalker#getCurrentNode().
booleangetExpandEntityReferences()
DOM: Implements TreeWalker#getExpandEntityReferences().
NodeFiltergetFilter()
DOM: Implements TreeWalker#getFilter().
NodegetRoot()
DOM: Implements TreeWalker#getRoot().
intgetWhatToShow()
DOM: Implements TreeWalker#getWhatToShow().
NodelastChild()
DOM: Implements TreeWalker#lastChild().
protected NodelastChild(Node n)
Returns the last child of the given node.
NodenextNode()
DOM: Implements TreeWalker#nextNode().
NodenextSibling()
DOM: Implements TreeWalker#nextSibling().
protected NodenextSibling(Node n, Node root)
Returns the next sibling of the given node.
NodeparentNode()
DOM: Implements TreeWalker#parentNode().
protected NodeparentNode(Node n)
Returns the parent node of the given node.
NodepreviousNode()
DOM: Implements TreeWalker#previousNode().
NodepreviousSibling()
DOM: Implements TreeWalker#previousSibling().
protected NodepreviousSibling(Node n, Node root)
Returns the previous sibling of the given node.
voidsetCurrentNode(Node n)
DOM: Implements TreeWalker#setCurrentNode(Node).

Field Detail

currentNode

protected Node currentNode
The current node.

expandEntityReferences

protected boolean expandEntityReferences
Whether the children of entity reference nodes are visible to the iterator.

filter

protected NodeFilter filter
The NodeFilter used to screen nodes.

root

protected Node root
The root node.

whatToShow

protected int whatToShow
Which node types are presented via the iterator.

Constructor Detail

DOMTreeWalker

public DOMTreeWalker(Node n, int what, 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

acceptNode

protected short acceptNode(Node n)
Whether or not the given node is accepted by this tree walker.

firstChild

public Node firstChild()
DOM: Implements TreeWalker#firstChild().

firstChild

protected Node firstChild(Node n)
Returns the first child of the given node.

getCurrentNode

public Node getCurrentNode()
DOM: Implements TreeWalker#getCurrentNode().

getExpandEntityReferences

public boolean getExpandEntityReferences()
DOM: Implements TreeWalker#getExpandEntityReferences().

getFilter

public NodeFilter getFilter()
DOM: Implements TreeWalker#getFilter().

getRoot

public Node getRoot()
DOM: Implements TreeWalker#getRoot().

getWhatToShow

public int getWhatToShow()
DOM: Implements TreeWalker#getWhatToShow().

lastChild

public Node lastChild()
DOM: Implements TreeWalker#lastChild().

lastChild

protected Node lastChild(Node n)
Returns the last child of the given node.

nextNode

public Node nextNode()
DOM: Implements TreeWalker#nextNode().

nextSibling

public Node nextSibling()
DOM: Implements TreeWalker#nextSibling().

nextSibling

protected Node nextSibling(Node n, Node root)
Returns the next sibling of the given node.

parentNode

public Node parentNode()
DOM: Implements TreeWalker#parentNode().

parentNode

protected Node parentNode(Node n)
Returns the parent node of the given node.

previousNode

public Node previousNode()
DOM: Implements TreeWalker#previousNode().

previousSibling

public Node previousSibling()
DOM: Implements TreeWalker#previousSibling().

previousSibling

protected Node previousSibling(Node n, Node root)
Returns the previous sibling of the given node.

setCurrentNode

public void setCurrentNode(Node n)
DOM: Implements TreeWalker#setCurrentNode(Node).
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.