openjava.mop
Class ClassEnvironment
java.lang.Object
|
+--openjava.mop.Environment
|
+--openjava.mop.ClosedEnvironment
|
+--openjava.mop.ClassEnvironment
- public final class ClassEnvironment
- extends ClosedEnvironment
className
private String className
memberClasses
private Vector memberClasses
mapAnonDeclToClass
Hashtable mapAnonDeclToClass
- Maps
AllocationExpression
s to the names
("1"
, etc.) of the inner classes which have been implicitly
created for them. See Toolbox.lookupAnonymousClass(openjava.mop.ClassEnvironment, openjava.ptree.AllocationExpression)
.
ClassEnvironment
public ClassEnvironment(Environment e,
String name)
ClassEnvironment
public ClassEnvironment(Environment e)
ClassEnvironment
public ClassEnvironment(Environment e,
OJClass clazz)
getClassEnvironmentParent
public ClassEnvironment getClassEnvironmentParent()
- Description copied from class:
Environment
- Gets the nearest ancestor which is a
ClassEnvironment
, or null.
- Overrides:
getClassEnvironmentParent
in class Environment
getClassName
public String getClassName()
getMemberClasses
public Vector getMemberClasses()
toString
public String toString()
- Overrides:
toString
in class ClosedEnvironment
recordClassName
public void recordClassName(String name)
recordMemberClass
public void recordMemberClass(String name)
recordMemberClass
public void recordMemberClass(String declarerName,
String innerName)
- Description copied from class:
Environment
- If this is a
ClassEnvironment
for declarerName, record new inner
class innerName; otherwise, pass up the environment hierarchy.
- Overrides:
recordMemberClass
in class Environment
- Parameters:
declarerName
- fully-qualified name of enclosing classinnerName
- simple name of inner class
lookupClass
public OJClass lookupClass(String name)
- Description copied from class:
Environment
- Looks a class object up.
- Overrides:
lookupClass
in class ClosedEnvironment
- Parameters:
name
- the name of the fully-qualified name of
the class looked for
lookupBind
public Environment.VariableInfo lookupBind(String name)
- Description copied from class:
Environment
- Looks up a binded type of the given variable or field name.
- Overrides:
lookupBind
in class ClosedEnvironment
- Parameters:
name
- the fully-qualified name of the class
pickupField
private static OJField pickupField(OJClass[] reftypes,
String name)
toQualifiedName
public String toQualifiedName(String name)
- Obtains the fully-qualified name of the given class name.
- Overrides:
toQualifiedName
in class Environment
- Parameters:
name
- a simple class name or a fully-qualified class name
- Returns:
- the fully-qualified name of the class
getFirst
private static final String getFirst(String qname)
getRest
private static final String getRest(String qname)
askParent
private String askParent(String sname)
currentClassName
public String currentClassName()
- Overrides:
currentClassName
in class Environment