polyglot.types.reflect
Class ClassFileLoader

java.lang.Object
  extended by polyglot.types.reflect.ClassFileLoader

public class ClassFileLoader
extends java.lang.Object

Polyglot has its own class loader just so the classpath can be specified on the command line.


Field Summary
protected  java.util.Map dirContentsCache
          Directory contents cache.
protected  ExtensionInfo extensionInfo
          The extension info
protected static java.lang.Object not_found
           
protected  java.util.Set packageCache
          A cache of directories found in zip files.
protected static java.util.Collection verbose
           
protected  java.util.Map zipCache
          Keep a cache of the zips and jars so we don't have to keep opening them from the file system.
 
Constructor Summary
ClassFileLoader(ExtensionInfo ext)
           
 
Method Summary
 ClassFile loadClass(java.io.File dir, java.lang.String name)
          Try to find the class name in the directory or jar or zip file dir.
 boolean packageExists(java.io.File dir, java.lang.String name)
          Return true if the package name exists under the directory or file dir.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

extensionInfo

protected ExtensionInfo extensionInfo
The extension info


zipCache

protected java.util.Map zipCache
Keep a cache of the zips and jars so we don't have to keep opening them from the file system.


packageCache

protected java.util.Set packageCache
A cache of directories found in zip files.


dirContentsCache

protected java.util.Map dirContentsCache
Directory contents cache. Cache the first level of the directory so that we get less FileNotFoundExceptions


not_found

protected static final java.lang.Object not_found

verbose

protected static java.util.Collection verbose
Constructor Detail

ClassFileLoader

public ClassFileLoader(ExtensionInfo ext)
Method Detail

packageExists

public boolean packageExists(java.io.File dir,
                             java.lang.String name)
Return true if the package name exists under the directory or file dir.


loadClass

public ClassFile loadClass(java.io.File dir,
                           java.lang.String name)
Try to find the class name in the directory or jar or zip file dir. If the class does not exist in the specified file/directory, then null is returned.