edu.mit.ai.psg.jeva
Class Package
java.lang.Object
|
+--edu.mit.ai.psg.jeva.Package
- public class Package
- extends Object
- implements IPackage
Internal representation of packages, for name lookups.
|
Field Summary |
static boolean |
loadVerbosely
For verbose class loading: if true, print progress & exceptions to
System.err |
loadVerbosely
public static boolean loadVerbosely
- For verbose class loading: if true, print progress & exceptions to
System.err
Package
public Package(String fullName,
IEnv rootEnv)
setEnv
protected void setEnv(IEnv fromEnv,
IEnv toEnv)
getFullName
public String getFullName()
- Specified by:
- getFullName in interface IPackage
getSimpleName
public String getSimpleName()
- Specified by:
- getSimpleName in interface IPackage
getIPackage
public IPackage getIPackage(String simplePackageName,
boolean suppressPackageNameCheck)
throws IllegalArgumentException
- get subpackage with this name. Create package if not found
- Specified by:
- getIPackage in interface IPackage
- Tags copied from interface: IPackage
- Throws:
- IllegalArgumentException - if name not found in classpath
getIClass
public IClass getIClass(String simpleClassName,
boolean cacheFailures)
- look up class name. If not found, attempt to find by
loading its compilation unit using env.
a. if java file exists and is newer than class file,
do first pass on java file to obtain its type names.
Throws ParseException, if can't parse file, or VerifyingException
if there's a type error scanning class definitions.
b. if class file exists and newer than java file (or no java file)
load class file, then obtain signature through reflection.
if cacheFailures is true, remember failure and don't look for
files again for the same name.
- Specified by:
- getIClass in interface IPackage
put
public IClass put(String simpleClassName,
IClass aClass,
boolean overwriteOldClass)
throws IllegalArgumentException
- Define a class in package, optionally overwriting old value.
Returns old value.
Throws IllegalArgumentException if name conflicts with a subpackage name.
If overwriteOldClass is false, then signals IllegalArgumentException
if name conficts with previously defined class.
To erase old value, use put with value null.
- Specified by:
- put in interface IPackage
toString
public String toString()
- Overrides:
- toString in class Object