JML

org.jmlspecs.racwrap.runner
Class TreeBuilder

java.lang.Object
  extended byorg.jmlspecs.racwrap.runner.TreeBuilder

public class TreeBuilder
extends Object

Treebuilder has static methods to build a tree from specified locations. The treebuilder expects the file structure to be in this form: if there is a class called X originally, the original untransformed class would be in a file called X.class. Inm addition there will be three other files, X.iface.chx, X.wrap.chx, and X.statics.chx.


Constructor Summary
TreeBuilder()
           
 
Method Summary
static void buildFileTree(Node parent, File file)
          recursively builds the tree given a directory
static void buildJarTree(Node parent, File file)
          builds the Jarfile tree.
static Node buildTree(String[] locations)
          Creates a tree given an array of paths to directories and jarfiles
static BranchNode getOrCreateBranch(Node parent, String name)
           
static Leaf getOrCreateLeaf(Node parent, String classname)
          This method also adds the leaf node to the parent, if necessary
static void main(String[] args)
          The main program takes in strings of paths to the root of package hierarchies, either a directory or a jar file.
static Location updateLeafNode(Node parent, String fname)
          updateLeafNode looks at the filename, determines if it is needed for our framework, and creates or updates a leaf node as needed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeBuilder

public TreeBuilder()
Method Detail

main

public static void main(String[] args)
The main program takes in strings of paths to the root of package hierarchies, either a directory or a jar file.


buildTree

public static Node buildTree(String[] locations)
Creates a tree given an array of paths to directories and jarfiles

Parameters:
locations - contains locations of the classfiles, as in the CLASSPATH

buildFileTree

public static void buildFileTree(Node parent,
                                 File file)
recursively builds the tree given a directory


buildJarTree

public static void buildJarTree(Node parent,
                                File file)
builds the Jarfile tree.


updateLeafNode

public static Location updateLeafNode(Node parent,
                                      String fname)
updateLeafNode looks at the filename, determines if it is needed for our framework, and creates or updates a leaf node as needed.

Returns:
returns a Location object so the caller can update the location

getOrCreateLeaf

public static Leaf getOrCreateLeaf(Node parent,
                                   String classname)
This method also adds the leaf node to the parent, if necessary


getOrCreateBranch

public static BranchNode getOrCreateBranch(Node parent,
                                           String name)

JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.