com.ibm.dom.util
Class TreeTraversal

java.lang.Object
  |
  +--com.ibm.dom.util.TreeTraversal

public class TreeTraversal
extends java.lang.Object

See Also:
com.ibm.xml.parser.NonRecursivePreorderTreeTraversal

Inner Class Summary
static interface TreeTraversal.EndTraversalException
          XML4J tree traversal exception which signals from a Visitor to the tree traversal algorithm that all further traversal should be ended because the visit on the document object hierarchy has been successfully completed.
static interface TreeTraversal.ToNextSiblingTraversalException
          XML4J tree traversal exception which signals from a Visitor to the tree traversal algorithm that further traversal of the current Node's children should be ended because the visit on this portion of thee document object hierarchy has been successfully completed.
 
Constructor Summary
TreeTraversal(Visitor visitor)
           
 
Method Summary
 void traverse(Node startNode)
          Traverses the document object tree at the specified startNode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeTraversal

public TreeTraversal(Visitor visitor)
Method Detail

traverse

public void traverse(Node startNode)
              throws java.lang.Exception
Traverses the document object tree at the specified startNode.

The numbered nodes in the trees below indicate the order of traversal given the specified startNode of "1".


                 1              x              x
                / \            / \            / \
               2   6          1   x          x   x
              /|\   \        /|\   \        /|\   \
             3 4 5   7      2 3 4   x      x 1 x   x

 
Parameters:
startNode - The starting point to begin traversing the document object tree.
Throws:
TreeTraversal.ToNextSiblingTraversalException - Thrown if the document hierarchy can not be visitted.