public class ExecutionContext extends JavaNonTerminalProgramElement implements Reference, TypeReferenceContainer, ExpressionContainer
ProgramElement.TreeStructureSourceElement.Position| Modifier and Type | Field and Description |
|---|---|
private NonTerminalProgramElement |
astParent
the ast parent
|
private TypeReference |
classContext
the class context
|
private MethodSignature |
methodContext
the method signature of the currently active method
|
private ReferencePrefix |
runtimeInstance
the reference to the active object
|
private static long |
serialVersionUID |
commentsfactorySTRUCTURAL_EQUALITY, STRUCTURAL_HASH_CODE| Modifier | Constructor and Description |
|---|---|
protected |
ExecutionContext() |
|
ExecutionContext(TypeReference classContext,
MethodSignature methodContext,
ReferencePrefix runtimeInstance)
creates an execution context reference
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(SourceVisitor visitor) |
ExecutionContext |
deepClone() |
NonTerminalProgramElement |
getASTParent() |
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.
|
int |
getChildPositionCode(ProgramElement child)
Returns the positional code of the given child
|
Expression |
getExpressionAt(int index) |
int |
getExpressionCount() |
MethodSignature |
getMethodContext()
returns the method signature of the currently active method
|
ReferencePrefix |
getRuntimeInstance()
returns the runtime instance object
|
TypeReference |
getTypeReference()
returns the type reference to the next enclosing class
|
TypeReference |
getTypeReferenceAt(int index) |
int |
getTypeReferenceCount() |
void |
makeParentRoleValid()
Ensures that each child has "this" as syntactical parent.
|
void |
prettyPrint(PrettyPrinter p) |
boolean |
replaceChild(ProgramElement child,
ProgramElement newChild) |
void |
setParent(NonTerminalProgramElement parent) |
getIndexOfChild, getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAllgetComments, setComments, validategetEndPosition, getFactory, getFirstElement, getLastElement, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSourceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetIndexOfChild, getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAllgetComments, setCommentsgetEndPosition, getFactory, getFirstElement, getLastElement, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSourcevalidateprivate static final long serialVersionUID
private NonTerminalProgramElement astParent
private TypeReference classContext
private MethodSignature methodContext
private ReferencePrefix runtimeInstance
protected ExecutionContext()
public ExecutionContext(TypeReference classContext, MethodSignature methodContext, ReferencePrefix runtimeInstance)
classContext - the TypeReference referring to the next enclosing
classmethodContext - the method signature representing the currently active methodruntimeInstance - a ReferencePrefix to the object that
is currently active/executedpublic int getChildCount()
getChildCount in interface NonTerminalProgramElementpublic ProgramElement getChildAt(int index)
getChildAt in interface NonTerminalProgramElementindex - an index into this node's "virtual" child arrayjava.lang.ArrayIndexOutOfBoundsException - if index is out
of boundspublic int getChildPositionCode(ProgramElement child)
getChildPositionCode in interface NonTerminalProgramElementchild - the exact child to look for.-1.public void accept(SourceVisitor visitor)
accept in interface SourceElementpublic ExecutionContext deepClone()
deepClone in interface SourceElementpublic NonTerminalProgramElement getASTParent()
getASTParent in interface ProgramElementpublic void setParent(NonTerminalProgramElement parent)
public boolean replaceChild(ProgramElement child, ProgramElement newChild)
replaceChild in interface NonTerminalProgramElementpublic void makeParentRoleValid()
makeParentRoleValid in interface NonTerminalProgramElementmakeParentRoleValid in class JavaNonTerminalProgramElementpublic TypeReference getTypeReferenceAt(int index)
getTypeReferenceAt in interface TypeReferenceContainerpublic int getTypeReferenceCount()
getTypeReferenceCount in interface TypeReferenceContainerpublic Expression getExpressionAt(int index)
getExpressionAt in interface ExpressionContainerpublic int getExpressionCount()
getExpressionCount in interface ExpressionContainerpublic TypeReference getTypeReference()
public MethodSignature getMethodContext()
public ReferencePrefix getRuntimeInstance()
public void prettyPrint(PrettyPrinter p) throws java.io.IOException
java.io.IOException