public class ExecutionContext extends JavaNonTerminalProgramElement implements Reference, TypeReferenceContainer, ExpressionContainer
ProgramElement.TreeStructure
SourceElement.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 |
comments
factory
STRUCTURAL_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, validateAll
getComments, setComments, validate
getEndPosition, getFactory, getFirstElement, getLastElement, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSource
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getIndexOfChild, getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAll
getComments, setComments
getEndPosition, getFactory, getFirstElement, getLastElement, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSource
validate
private 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 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 int getChildPositionCode(ProgramElement child)
getChildPositionCode
in interface NonTerminalProgramElement
child
- the exact child to look for.-1
.public void accept(SourceVisitor visitor)
accept
in interface SourceElement
public ExecutionContext deepClone()
deepClone
in interface SourceElement
public NonTerminalProgramElement getASTParent()
getASTParent
in interface ProgramElement
public void setParent(NonTerminalProgramElement parent)
public boolean replaceChild(ProgramElement child, ProgramElement newChild)
replaceChild
in interface NonTerminalProgramElement
public void makeParentRoleValid()
makeParentRoleValid
in interface NonTerminalProgramElement
makeParentRoleValid
in class JavaNonTerminalProgramElement
public TypeReference getTypeReferenceAt(int index)
getTypeReferenceAt
in interface TypeReferenceContainer
public int getTypeReferenceCount()
getTypeReferenceCount
in interface TypeReferenceContainer
public Expression getExpressionAt(int index)
getExpressionAt
in interface ExpressionContainer
public int getExpressionCount()
getExpressionCount
in interface ExpressionContainer
public TypeReference getTypeReference()
public MethodSignature getMethodContext()
public ReferencePrefix getRuntimeInstance()
public void prettyPrint(PrettyPrinter p) throws java.io.IOException
java.io.IOException