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.
- Author:
- CarlManning, caroma@ai.mit.edu
Copyright (c) 1997, 1998, 1999 Massachusetts Institute of Technology
|
Field Summary |
static boolean |
loadVerbosely
for debugging class loading print progress and exceptions to System.err |
loadVerbosely
public static boolean loadVerbosely
- for debugging class loading print progress and 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
getIClass
public IClass getIClass(String simpleClassName)
- 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.
- 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