joie
Class Mirror

java.lang.Object
  |
  +--joie.Mirror

public final class Mirror
extends java.lang.Object

This class is used to search specified classfiles in the classpath and to return their ClassInfo representation. Additionally it saves all previously loaded ClassInfo objects to avoid generating them more than once.

Version:
0.20 - 09/24/2002
Author:
Geoff Cohen, Olaf Görlitz

Constructor Summary
Mirror()
           
 
Method Summary
 void enableZipSearch(boolean enable)
          Enables the search for classfiles in Zipfiles.
static ClassInfo getClassInfo(java.io.File file)
           
static ClassInfo getClassInfo(java.lang.String name)
          Gets the ClassInfo for the specified class.
static ClassInfo getClassInfo(java.lang.String name, boolean zip)
          Gets the ClassInfo for the specified class.
static java.lang.String[] getClassPath()
          Gets the classpath from the system.
static ClassInfo searchClass(java.lang.String classname, boolean zip)
          Looks up the class in the classpath and returns the Classinfo for it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mirror

public Mirror()
Method Detail

getClassPath

public static java.lang.String[] getClassPath()
Gets the classpath from the system.

Returns:
the classpath as a String array of all containing pathes

getClassInfo

public static ClassInfo getClassInfo(java.io.File file)
                              throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException

getClassInfo

public static ClassInfo getClassInfo(java.lang.String name)
                              throws java.lang.ClassNotFoundException
Gets the ClassInfo for the specified class. Zip files will be searched. First, the reference hashtable is looked up if it is already loaded.

Parameters:
name - the name of the class (with or without '.class')
Returns:
the complete ClassInfo
Throws:
java.lang.ClassNotFoundException - if the class can't be found

getClassInfo

public static ClassInfo getClassInfo(java.lang.String name,
                                     boolean zip)
                              throws java.lang.ClassNotFoundException
Gets the ClassInfo for the specified class. First, the reference hashtable is looked up if it is already loaded.

Parameters:
name - the name of the class (with or without '.class')
zip - specifies if zip files should be searched
Returns:
the complete ClassInfo
Throws:
java.lang.ClassNotFoundException - if the class can't be found

searchClass

public static ClassInfo searchClass(java.lang.String classname,
                                    boolean zip)
                             throws java.lang.ClassNotFoundException
Looks up the class in the classpath and returns the Classinfo for it.

Parameters:
classname - the name of the class
zip - specifies if zip files should be searched
Returns:
the ClassInfo for the classfile
Throws:
java.lang.ClassNotFoundException - if the file is not found

enableZipSearch

public void enableZipSearch(boolean enable)
Enables the search for classfiles in Zipfiles.

Parameters:
enable - set true to enable