org.apache.xml.serializer

Class TreeWalker

public final class TreeWalker extends Object

This class does a pre-order walk of the DOM tree, calling a ContentHandler interface as it goes. This class is a copy of the one in org.apache.xml.utils. It exists to cut the serializers dependancy on that package.

UNKNOWN: internal

Constructor Summary
TreeWalker(ContentHandler ch)
TreeWalker(ContentHandler contentHandler, String systemId)
Constructor.
Method Summary
ContentHandlergetContentHandler()
Get the ContentHandler used for the tree walk.
voidtraverse(Node pos)
Perform a pre-order traversal non-recursive style.
voidtraverse(Node pos, Node top)
Perform a pre-order traversal non-recursive style.

Constructor Detail

TreeWalker

public TreeWalker(ContentHandler ch)

TreeWalker

public TreeWalker(ContentHandler contentHandler, String systemId)
Constructor.

Parameters: contentHandler The implemention of the contentHandler operation (toXMLString, digest, ...)

Method Detail

getContentHandler

public ContentHandler getContentHandler()
Get the ContentHandler used for the tree walk.

Returns: the ContentHandler used for the tree walk

traverse

public void traverse(Node pos)
Perform a pre-order traversal non-recursive style. Note that TreeWalker assumes that the subtree is intended to represent a complete (though not necessarily well-formed) document and, during a traversal, startDocument and endDocument will always be issued to the SAX listener.

Parameters: pos Node in the tree where to start traversal

Throws: TransformerException

traverse

public void traverse(Node pos, Node top)
Perform a pre-order traversal non-recursive style. Note that TreeWalker assumes that the subtree is intended to represent a complete (though not necessarily well-formed) document and, during a traversal, startDocument and endDocument will always be issued to the SAX listener.

Parameters: pos Node in the tree where to start traversal top Node in the tree where to end traversal

Throws: TransformerException

Copyright B) 2006 Apache XML Project. All Rights Reserved.