javar
Class JavaByteCodeProject

java.lang.Object
  |
  +--javar.JavaByteCodeProject

public class JavaByteCodeProject
extends Object

This class simply represents a groupd of JavaByteCode classes

Author:
Ben Litchfield

Constructor Summary
JavaByteCodeProject()
          Default constructor
 
Method Summary
 void addClass(File location)
          This will take a file and create the JavaByteCodeFile for it and add that to the project.
 void addClass(JavaByteCodeFile code)
          This will add a new class to the project.
 JavaByteCodeFile getClass(String name)
          This will get a the byte codefile with the appropriate class.
 Iterator listClasses()
          This will return an iterator to the list of classes that are in this.
 void saveProject(File dir)
          This will save all classes that are associated with a project into a particular directory.
 void saveProjectToJar(File dir)
          This will save all classes that are associated with a project into a particular directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaByteCodeProject

public JavaByteCodeProject()
Default constructor

Method Detail

addClass

public void addClass(JavaByteCodeFile code)
This will add a new class to the project.

Parameters:
code - The new class that will be part of this project.

getClass

public JavaByteCodeFile getClass(String name)
This will get a the byte codefile with the appropriate class. The className should be in standard dot notation. "javar.JavaByteCodeProject" This will return null if no class is found

Returns:
the bytecode object for that class

addClass

public void addClass(File location)
              throws JavarParseException,
                     FileNotFoundException
This will take a file and create the JavaByteCodeFile for it and add that to the project. If this is a directory then it will recursivly search for all files that have the .class extension and try to add that.

Parameters:
location - A file of dir pointing to a classfile or a directory of classfiles
JavarParseException
FileNotFoundException

saveProject

public void saveProject(File dir)
                 throws JavarIOException
This will save all classes that are associated with a project into a particular directory. This will automatically overwrite any existing files.

Parameters:
dir - The directory to save the project to
JavarIOException

saveProjectToJar

public void saveProjectToJar(File dir)
                      throws JavarIOException
This will save all classes that are associated with a project into a particular directory. This will automatically overwrite any existing files.

Parameters:
dir - The directory to save the project to
JavarIOException

listClasses

public Iterator listClasses()
This will return an iterator to the list of classes that are in this.

Returns:
An iterator to the list of classes in this project