|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.dynamicjava.interpreter.DelegatingContext
edu.rice.cs.dynamicjava.interpreter.ClassContext
public class ClassContext
The context of a class body, including all members of the class (both declared and inherited).
| Constructor Summary | |
|---|---|
ClassContext(TypeContext next,
DJClass c)
|
|
| Method Summary | |
|---|---|
protected ClassContext |
duplicate(TypeContext next)
Create a copy of this context with the given context enclosing it. |
boolean |
fieldExists(java.lang.String name,
TypeSystem ts)
Test whether name is an in-scope field |
boolean |
functionExists(java.lang.String name,
TypeSystem ts)
Test whether name is an in-scope method or local function |
java.lang.Iterable<Type> |
getDeclaredThrownTypes()
The types that are allowed to be thrown in the current context. |
java.lang.Iterable<LocalFunction> |
getLocalFunctions(java.lang.String name,
TypeSystem ts,
java.lang.Iterable<LocalFunction> partial)
Helper for getLocalFunctions: list all matching functions, including those provided. |
LocalVariable |
getLocalVariable(java.lang.String name,
TypeSystem ts)
Return the variable object for the given name, or null if it does not exist. |
Type |
getReturnType()
The expected type of a return statement in the given context, or null
if return statements should not appear here. |
DJClass |
getThis()
Return the class of this in the current context, or null
if there is no such value (for example, in a static context). |
DJClass |
getThis(java.lang.String className)
Return the class of className.this in the current context, or null
if there is no such value (for example, in a static context). |
DJClass |
getThis(Type expected,
TypeSystem ts)
Return the innermost "this" class with the given type in the current context, or null if there is no such value (for example, in a static context). |
DJClass |
getTopLevelClass(java.lang.String name,
TypeSystem ts)
Return the top-level class with the given name, or null if it does not exist. |
VariableType |
getTypeVariable(java.lang.String name,
TypeSystem ts)
Return the type variable with the given name, or null if it does not exist. |
DJClass |
initializingClass()
Class which is being initialized (via a constructor or initialization block); null otherwise. |
boolean |
localFunctionExists(java.lang.String name,
TypeSystem ts)
Test whether name is an in-scope local function |
boolean |
localVariableExists(java.lang.String name,
TypeSystem ts)
Test whether name is an in-scope local variable |
java.lang.String |
makeAnonymousClassName()
Return a full name for an anonymous class declared here. |
java.lang.String |
makeClassName(java.lang.String n)
Return a full name for a class with the given name declared here. |
boolean |
memberClassExists(java.lang.String name,
TypeSystem ts)
Test whether name is an in-scope member class |
boolean |
methodExists(java.lang.String name,
TypeSystem ts)
Test whether name is an in-scope method |
boolean |
topLevelClassExists(java.lang.String name,
TypeSystem ts)
Test whether name is an in-scope top-level class |
ClassType |
typeContainingField(java.lang.String name,
TypeSystem ts)
Return the most inner type containing a field with the given name, or null
if there is no such type. |
ClassType |
typeContainingMemberClass(java.lang.String name,
TypeSystem ts)
Return the most inner type containing a class with the given name, or null
if there is no such type. |
Type |
typeContainingMethod(java.lang.String name,
TypeSystem ts)
Return the most inner type containing a method with the given name, or null
if there is no such type. |
boolean |
typeExists(java.lang.String name,
TypeSystem ts)
Test whether name is an in-scope top-level class, member class, or type variable |
boolean |
typeVariableExists(java.lang.String name,
TypeSystem ts)
Test whether name is an in-scope type variable. |
boolean |
variableExists(java.lang.String name,
TypeSystem ts)
Test whether name is an in-scope field or local variable |
| Methods inherited from class edu.rice.cs.dynamicjava.interpreter.DelegatingContext |
|---|
accessModule, getClassLoader, getLocalFunctions, importField, importMemberClass, importMemberClasses, importMethod, importStaticMembers, importTopLevelClass, importTopLevelClasses, setPackage |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClassContext(TypeContext next,
DJClass c)
| Method Detail |
|---|
protected ClassContext duplicate(TypeContext next)
DelegatingContext
duplicate in class DelegatingContext
public boolean typeExists(java.lang.String name,
TypeSystem ts)
DelegatingContextname is an in-scope top-level class, member class, or type variable
typeExists in interface TypeContexttypeExists in class DelegatingContext
public boolean memberClassExists(java.lang.String name,
TypeSystem ts)
DelegatingContextname is an in-scope member class
memberClassExists in interface TypeContextmemberClassExists in class DelegatingContext
public ClassType typeContainingMemberClass(java.lang.String name,
TypeSystem ts)
throws AmbiguousNameException
DelegatingContextnull
if there is no such type.
typeContainingMemberClass in interface TypeContexttypeContainingMemberClass in class DelegatingContextAmbiguousNameException
public boolean topLevelClassExists(java.lang.String name,
TypeSystem ts)
DelegatingContextname is an in-scope top-level class
topLevelClassExists in interface TypeContexttopLevelClassExists in class DelegatingContext
public DJClass getTopLevelClass(java.lang.String name,
TypeSystem ts)
throws AmbiguousNameException
DelegatingContextnull if it does not exist.
getTopLevelClass in interface TypeContextgetTopLevelClass in class DelegatingContextAmbiguousNameException
public boolean typeVariableExists(java.lang.String name,
TypeSystem ts)
DelegatingContextname is an in-scope type variable.
typeVariableExists in interface TypeContexttypeVariableExists in class DelegatingContext
public VariableType getTypeVariable(java.lang.String name,
TypeSystem ts)
DelegatingContextnull if it does not exist.
getTypeVariable in interface TypeContextgetTypeVariable in class DelegatingContext
public boolean variableExists(java.lang.String name,
TypeSystem ts)
DelegatingContextname is an in-scope field or local variable
variableExists in interface TypeContextvariableExists in class DelegatingContext
public boolean fieldExists(java.lang.String name,
TypeSystem ts)
DelegatingContextname is an in-scope field
fieldExists in interface TypeContextfieldExists in class DelegatingContext
public ClassType typeContainingField(java.lang.String name,
TypeSystem ts)
throws AmbiguousNameException
DelegatingContextnull
if there is no such type.
typeContainingField in interface TypeContexttypeContainingField in class DelegatingContextAmbiguousNameException
public boolean localVariableExists(java.lang.String name,
TypeSystem ts)
DelegatingContextname is an in-scope local variable
localVariableExists in interface TypeContextlocalVariableExists in class DelegatingContext
public LocalVariable getLocalVariable(java.lang.String name,
TypeSystem ts)
DelegatingContextnull if it does not exist.
getLocalVariable in interface TypeContextgetLocalVariable in class DelegatingContext
public boolean functionExists(java.lang.String name,
TypeSystem ts)
DelegatingContextname is an in-scope method or local function
functionExists in interface TypeContextfunctionExists in class DelegatingContext
public boolean methodExists(java.lang.String name,
TypeSystem ts)
DelegatingContextname is an in-scope method
methodExists in interface TypeContextmethodExists in class DelegatingContext
public Type typeContainingMethod(java.lang.String name,
TypeSystem ts)
DelegatingContextnull
if there is no such type.
typeContainingMethod in interface TypeContexttypeContainingMethod in class DelegatingContext
public boolean localFunctionExists(java.lang.String name,
TypeSystem ts)
DelegatingContextname is an in-scope local function
localFunctionExists in interface TypeContextlocalFunctionExists in class DelegatingContext
public java.lang.Iterable<LocalFunction> getLocalFunctions(java.lang.String name,
TypeSystem ts,
java.lang.Iterable<LocalFunction> partial)
TypeContext
getLocalFunctions in interface TypeContextgetLocalFunctions in class DelegatingContextpublic java.lang.String makeClassName(java.lang.String n)
makeClassName in interface TypeContextmakeClassName in class DelegatingContextpublic java.lang.String makeAnonymousClassName()
makeAnonymousClassName in interface TypeContextmakeAnonymousClassName in class DelegatingContextpublic DJClass getThis()
this in the current context, or null
if there is no such value (for example, in a static context).
getThis in interface TypeContextgetThis in class DelegatingContextpublic DJClass getThis(java.lang.String className)
className.this in the current context, or null
if there is no such value (for example, in a static context).
getThis in interface TypeContextgetThis in class DelegatingContext
public DJClass getThis(Type expected,
TypeSystem ts)
TypeContextnull if there is no such value (for example, in a static context).
getThis in interface TypeContextgetThis in class DelegatingContextpublic DJClass initializingClass()
TypeContextnull otherwise.
initializingClass in interface TypeContextinitializingClass in class DelegatingContextpublic Type getReturnType()
return statement in the given context, or null
if return statements should not appear here.
getReturnType in interface TypeContextgetReturnType in class DelegatingContextpublic java.lang.Iterable<Type> getDeclaredThrownTypes()
getDeclaredThrownTypes in interface TypeContextgetDeclaredThrownTypes in class DelegatingContext
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||