org.apache.velocity.anakia
Class TreeWalker

java.lang.Object
  |
  +--org.apache.velocity.anakia.TreeWalker

public class TreeWalker
extends java.lang.Object

This class allows you to walk a tree of JDOM Element objects. It first walks the tree itself starting at the Element passed into allElements() and stores each node of the tree in a Vector which allElements() returns as a result of its execution. You can then use a #foreach in Velocity to walk over the Vector and visit each Element node.

Version:
$Id: TreeWalker.java,v 1.4 2001/03/20 00:47:44 jon Exp $
Author:
Jon S. Stevens

Field Summary
private  java.util.Vector theElements
          the cache of Element objects
 
Constructor Summary
TreeWalker()
          Empty constructor
 
Method Summary
 java.util.Vector allElements(org.jdom.Element e)
          Creates a new Vector and walks the Element tree.
private  void treeWalk(org.jdom.Element e)
          A recursive method to walk the Element tree.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

theElements

private java.util.Vector theElements
the cache of Element objects
Constructor Detail

TreeWalker

public TreeWalker()
Empty constructor
Method Detail

allElements

public java.util.Vector allElements(org.jdom.Element e)
Creates a new Vector and walks the Element tree.
Parameters:
Element - the starting Element node
Returns:
Vector a vector of Element nodes

treeWalk

private final void treeWalk(org.jdom.Element e)
A recursive method to walk the Element tree.
Parameters:
Element - the current Element


Copyright © 2001 Apache Software Foundation. All Rights Reserved.