| java.lang.Object EDU.purdue.cs.bloat.file.ClassFileLoader
All known Subclasses: EDU.purdue.cs.bloat.file.JarFileCommitter,
ClassFileLoader | public class ClassFileLoader implements ClassInfoLoader(Code) | | ClassFileLoder provides an interface for loading classes from files. The
actual loading is done by the ClassFile itself.
Classes may be specified by their full package name (java.lang.String),
or by the name of their class file (myclasses/Test.class). The
class path may contain directories or Zip or Jar files. Any classes that are
written back to disk ("committed") are placed in the output directory.
author: Nate Nystrom (author: href="mailto:nystrom@cs.purdue.edu">nystrom@cs.purdue.edu) |
DEBUG | public static boolean DEBUG(Code) | | |
USE_SYSTEM_CLASSES | public static boolean USE_SYSTEM_CLASSES(Code) | | |
ClassFileLoader | public ClassFileLoader()(Code) | | Constructor. The classpath initially consists of the contents of the
java.class.path and sun.boot.class.path system
properties.
|
appendClassPath | public void appendClassPath(String morePath)(Code) | | Adds to the classpath (CLASSPATH = CLASSPATH + morePath).
|
done | public void done() throws IOException(Code) | | Signifies that we are done with this ClassFileLoader
|
getClassPath | public String getClassPath()(Code) | | Returns the path used to search for class files.
|
loadClass | public ClassInfo loadClass(String name) throws ClassNotFoundException(Code) | | Loads the class with the given name. Searches the class path, including
zip files, for the class and then returns a data stream for the class
file.
Parameters: name - The name of the class to load, including the package name. A ClassInfo for the class. exception: ClassNotFoundException - The class cannot be found in the class path. |
loadClassesFromZipFile | public ClassInfo[] loadClassesFromZipFile(ZipFile zipFile) throws ClassNotFoundException(Code) | | Loads all of the classes that are contained in a zip (or jar) file.
Returns an array of the ClassInfos for the classes in the zip
file.
|
newClass | public ClassInfo newClass(int modifiers, int classIndex, int superClassIndex, int[] interfaceIndexes, List constants)(Code) | | |
outputDir | public File outputDir()(Code) | | Get the directory into which commited class files should be written.
|
outputStreamFor | protected OutputStream outputStreamFor(String name) throws IOException(Code) | | Returns an OutputStream to which somed named entity is
written. Any forward slashes in the name are replaced by
File.separatorChar .
|
prependClassPath | public void prependClassPath(String morePath)(Code) | | Adds to the classpath (CLASSPATH = morePath + CLASSPATH).
|
setClassPath | public void setClassPath(String classpath)(Code) | | Sets the classpath.
|
setOutputDir | public void setOutputDir(File dir)(Code) | | Set the directory into which commited class files should be written.
Parameters: dir - The directory. |
setVerbose | public void setVerbose(boolean verbose)(Code) | | |
writeEntry | public void writeEntry(byte[] bytes, String name) throws IOException(Code) | | Writes a bunch of byte s to an output entry with the given
name.
|
|
|