edu.rice.cs.dynamicjava.interpreter
Class InitializerContext

java.lang.Object
  extended by edu.rice.cs.dynamicjava.interpreter.DelegatingContext
      extended by edu.rice.cs.dynamicjava.interpreter.InitializerContext
All Implemented Interfaces:
TypeContext

public class InitializerContext
extends DelegatingContext

The body of an initializer.


Constructor Summary
InitializerContext(TypeContext next, boolean isStatic, DJClass c)
           
 
Method Summary
protected  InitializerContext duplicate(TypeContext next)
          Create a copy of this context with the given context enclosing it.
 java.lang.Iterable<Type> getDeclaredThrownTypes()
          The types that are allowed to be thrown in the current context.
 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 initializingClass()
          Class which is being initialized (via a constructor or initialization block); null otherwise.
 java.lang.String makeClassName(java.lang.String n)
          Return a full name for a class with the given name declared here.
 
Methods inherited from class edu.rice.cs.dynamicjava.interpreter.DelegatingContext
accessModule, fieldExists, functionExists, getClassLoader, getLocalFunctions, getLocalFunctions, getLocalVariable, getTopLevelClass, getTypeVariable, importField, importMemberClass, importMemberClasses, importMethod, importStaticMembers, importTopLevelClass, importTopLevelClasses, localFunctionExists, localVariableExists, makeAnonymousClassName, memberClassExists, methodExists, setPackage, topLevelClassExists, typeContainingField, typeContainingMemberClass, typeContainingMethod, typeExists, typeVariableExists, variableExists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InitializerContext

public InitializerContext(TypeContext next,
                          boolean isStatic,
                          DJClass c)
Method Detail

duplicate

protected InitializerContext duplicate(TypeContext next)
Description copied from class: DelegatingContext
Create a copy of this context with the given context enclosing it.

Specified by:
duplicate in class DelegatingContext

makeClassName

public java.lang.String makeClassName(java.lang.String n)
Description copied from class: DelegatingContext
Return a full name for a class with the given name declared here.

Specified by:
makeClassName in interface TypeContext
Overrides:
makeClassName in class DelegatingContext

getThis

public DJClass getThis()
Description copied from class: DelegatingContext
Return the class of this in the current context, or null if there is no such value (for example, in a static context).

Specified by:
getThis in interface TypeContext
Overrides:
getThis in class DelegatingContext

getThis

public DJClass getThis(java.lang.String className)
Description copied from class: DelegatingContext
Return the class of className.this in the current context, or null if there is no such value (for example, in a static context).

Specified by:
getThis in interface TypeContext
Overrides:
getThis in class DelegatingContext

getThis

public DJClass getThis(Type expected,
                       TypeSystem ts)
Description copied from interface: TypeContext
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).

Specified by:
getThis in interface TypeContext
Overrides:
getThis in class DelegatingContext

initializingClass

public DJClass initializingClass()
Description copied from interface: TypeContext
Class which is being initialized (via a constructor or initialization block); null otherwise.

Specified by:
initializingClass in interface TypeContext
Overrides:
initializingClass in class DelegatingContext

getReturnType

public Type getReturnType()
Description copied from class: DelegatingContext
The expected type of a return statement in the given context, or null if return statements should not appear here.

Specified by:
getReturnType in interface TypeContext
Overrides:
getReturnType in class DelegatingContext

getDeclaredThrownTypes

public java.lang.Iterable<Type> getDeclaredThrownTypes()
Description copied from class: DelegatingContext
The types that are allowed to be thrown in the current context. If there is no such declaration, the list will be empty.

Specified by:
getDeclaredThrownTypes in interface TypeContext
Overrides:
getDeclaredThrownTypes in class DelegatingContext