You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by jv...@locus.apache.org on 2000/12/20 08:19:00 UTC

cvs commit: jakarta-velocity/src/java/org/apache/velocity/anakia TreeWalker.java

jvanzyl     00/12/19 23:19:00

  Modified:    src/java/org/apache/velocity/anakia TreeWalker.java
  Log:
  - cleaning up import statements
  - cleaning up javadoc
  
  Revision  Changes    Path
  1.2       +25 -24    jakarta-velocity/src/java/org/apache/velocity/anakia/TreeWalker.java
  
  Index: TreeWalker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/anakia/TreeWalker.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TreeWalker.java	2000/11/26 06:52:22	1.1
  +++ TreeWalker.java	2000/12/20 07:19:00	1.2
  @@ -54,53 +54,54 @@
    * <http://www.apache.org/>.
    */
   
  -// JDK Stuff
  -import java.util.*;
  +import java.util.Iterator;
  +import java.util.Vector;
   
  -// JDOM Stuff
   import org.jdom.Document;
   import org.jdom.Element;
   import org.jdom.JDOMException;
   
   /**
  -    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.
  -
  -    @author <a href="jon@latchkey.com">Jon S. Stevens</a>
  -    @version $Id: TreeWalker.java,v 1.1 2000/11/26 06:52:22 jon Exp $
  -*/
  + * 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.
  + *
  + * @author <a href="jon@latchkey.com">Jon S. Stevens</a>
  + * @version $Id: TreeWalker.java,v 1.2 2000/12/20 07:19:00 jvanzyl Exp $
  + */
   public class TreeWalker
   {
       /** the cache of Element objects */
       private Vector theElements = null;
       
       /**
  -        Empty constructor
  -    */
  +     * Empty constructor
  +     */
       public TreeWalker()
       {
           // Left blank
       }
  +    
       /**
  -        Creates a new Vector and walks the Element tree.
  -        
  -        @param Element the starting Element node
  -        @return Vector a vector of Element nodes
  -    */
  +     * Creates a new Vector and walks the Element tree.
  +     *   
  +     * @param Element the starting Element node
  +     * @return Vector a vector of Element nodes
  +     */
       public Vector allElements(Element e)
       {
           theElements = new Vector();
           treeWalk (e);
           return this.theElements;
       }
  +    
       /**
  -        A recursive method to walk the Element tree.
  -        @param Element the current Element
  -    */
  +     * A recursive method to walk the Element tree.
  +     * @param Element the current Element
  +     */
       private final void treeWalk(Element e)
       {
           for (Iterator i=e.getChildren().iterator(); i.hasNext(); )
  @@ -110,4 +111,4 @@
               treeWalk(child);
           }            
       }
  -}    
  \ No newline at end of file
  +}