public class ExecutionContext extends JavaNonTerminalProgramElement implements IExecutionContext, Reference
Modifier and Type | Field and Description |
---|---|
protected TypeReference |
classContext
the class context
|
private IProgramMethod |
methodContext
the currently active method
|
protected ReferencePrefix |
runtimeInstance
the reference to the active object
|
Constructor and Description |
---|
ExecutionContext(ExtList children)
creates an execution context reference
|
ExecutionContext(TypeReference classContext,
IProgramMethod methodContext,
ReferencePrefix runtimeInstance)
creates an execution context reference
|
Modifier and Type | Method and Description |
---|---|
ProgramElement |
getChildAt(int index)
Returns the child at the specified index in this node's "virtual"
child array.
|
int |
getChildCount()
Returns the number of children of this node.
|
IProgramMethod |
getMethodContext()
returns the program method which is currently active
|
ReferencePrefix |
getRuntimeInstance()
returns the runtime instance object
|
TypeReference |
getTypeReference()
returns the type reference to the next enclosing class
|
void |
prettyPrint(PrettyPrinter p)
Pretty printing the source element.
|
java.lang.String |
toString()
toString
|
void |
visit(Visitor v)
calls the corresponding method of a visitor in order to
perform some action/transformation on this element
|
compatibleBlockSize, computeHashCode, equals, equalsModRenaming, getArrayPos, match, matchChildren
getComments, hashCode, prettyPrintMain, reuseSignature
getEndPosition, getFirstElement, getFirstElementIncludingBlocks, getLastElement, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getComments, match
equalsModRenaming, getEndPosition, getFirstElement, getFirstElementIncludingBlocks, getLastElement, getPositionInfo, getRelativePosition, getStartPosition
protected final TypeReference classContext
protected final ReferencePrefix runtimeInstance
private IProgramMethod methodContext
public ExecutionContext(TypeReference classContext, IProgramMethod methodContext, ReferencePrefix runtimeInstance)
classContext
- the TypeReference referring to the next enclosing
classmethodContext
- the IProgramMethod referring to the currently active methodruntimeInstance
- a ReferencePrefix to the object that
is currently active/executedpublic ExecutionContext(ExtList children)
children
- an ExtList with the required children of the execution
contextpublic int getChildCount()
getChildCount
in interface NonTerminalProgramElement
public ProgramElement getChildAt(int index)
getChildAt
in interface NonTerminalProgramElement
index
- an index into this node's "virtual" child arrayjava.lang.ArrayIndexOutOfBoundsException
- if index is out
of boundspublic TypeReference getTypeReference()
getTypeReference
in interface IExecutionContext
public IProgramMethod getMethodContext()
getMethodContext
in interface IExecutionContext
public ReferencePrefix getRuntimeInstance()
getRuntimeInstance
in interface IExecutionContext
public void visit(Visitor v)
visit
in interface SourceElement
v
- the Visitorpublic void prettyPrint(PrettyPrinter p) throws java.io.IOException
JavaSourceElement
prettyPrint
in interface SourceElement
prettyPrint
in class JavaProgramElement
p
- a pretty printer.java.io.IOException
- occasionally thrown.public java.lang.String toString()
JavaSourceElement
toString
in class JavaSourceElement