|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openjava.mop.Environment | +--openjava.mop.FileEnvironment
An environment based upon a Java source file.
The symbols available are those specified in import
statements, and the class(es) defined in this file.
Object
Nested Class Summary |
Nested classes inherited from class openjava.mop.Environment |
Environment.BasicVariableInfo, Environment.VariableInfo |
Field Summary | |
private Vector |
importedClasses
|
private Vector |
importedPackages
|
private Vector |
localClasses
|
private Hashtable |
localClassTable
|
private String |
mainClassName
|
private static HashSet |
nonExistentClasses
Cache to speed up theClassExists(java.lang.String) . |
private String |
packageName
|
Fields inherited from class openjava.mop.Environment |
parent |
Constructor Summary | |
FileEnvironment(Environment e)
|
|
FileEnvironment(Environment e,
CompilationUnit comp_unit,
String mainname)
|
|
FileEnvironment(Environment e,
String pack,
String name)
|
Method Summary | |
void |
bindVariable(String name,
Environment.VariableInfo info)
binds a name to the class type. |
String |
getPackage()
Gets the package name. |
String |
getPublicClassName()
|
boolean |
importClass(String qualified_name)
Imports a class. |
void |
importPackage(String name)
Imports a package. |
private boolean |
isAlreadyImportedClass(String qualified_name)
|
private boolean |
isCrashingClassName(String simple_name)
|
private static boolean |
isPrimitiveType(String name)
|
Environment.VariableInfo |
lookupBind(String name)
Looks up a binded type of the given variable or field name. |
OJClass |
lookupClass(String name)
Looks a class object up. |
void |
record(String name,
OJClass clazz)
Records a class object. |
void |
recordLocalClassName(String name)
Register a simple name as a local class |
private String |
searchImportedClasses(String simple_name)
|
private String |
searchImportedPackages(String simple_name)
|
void |
setPackage(String pack)
Sets the package name. |
private boolean |
theClassExists(String class_name)
|
String |
toQualifiedName(String name)
Obtains the fully-qualified name of the given class name. |
String |
toString()
|
private static void |
writeStringVector(PrintWriter out,
Vector v)
|
Methods inherited from class openjava.mop.Environment |
bindVariable, currentClassName, getClassEnvironmentParent, getGlobalEnvironment, getParent, isBind, isQualifiedName, isRegisteredModifier, lookupClass, recordMemberClass, toPackageName, toSimpleName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private String packageName
private String mainClassName
private Vector localClasses
private Vector importedClasses
private Vector importedPackages
private Hashtable localClassTable
private static HashSet nonExistentClasses
theClassExists(java.lang.String)
.
Constructor Detail |
public FileEnvironment(Environment e, String pack, String name)
public FileEnvironment(Environment e)
public FileEnvironment(Environment e, CompilationUnit comp_unit, String mainname)
Method Detail |
public String toString()
toString
in class Environment
private static void writeStringVector(PrintWriter out, Vector v)
public String getPublicClassName()
public void setPackage(String pack)
public String getPackage()
getPackage
in class Environment
public OJClass lookupClass(String name)
lookupClass
in class Environment
name
- the name of the fully-qualified name of
the class looked forpublic void record(String name, OJClass clazz)
record
in class Environment
name
- the fully-qualified name of the classclazz
- the class object associated with that namepublic boolean importClass(String qualified_name)
qualified_name
- fully-qualified name of the imported class
public void importPackage(String name)
name
- the fully-qualified name of the imported packagepublic String toQualifiedName(String name)
toQualifiedName
in class Environment
name
- a simple class name or a fully-qualified class name
public void recordLocalClassName(String name)
private static final boolean isPrimitiveType(String name)
private String searchImportedClasses(String simple_name)
private boolean isAlreadyImportedClass(String qualified_name)
private boolean isCrashingClassName(String simple_name)
private String searchImportedPackages(String simple_name)
private boolean theClassExists(String class_name)
public void bindVariable(String name, Environment.VariableInfo info)
bindVariable
in class Environment
name
- the fully-qualified name of the classinfo
- the class object associated with that namepublic Environment.VariableInfo lookupBind(String name)
Environment
lookupBind
in class Environment
name
- the fully-qualified name of the class
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |