public final class ExecutionEvent extends Object
For further details.
Modifier and Type | Method and Description |
---|---|
PolyglotException |
getException()
Returns the exception of this source location after it was executed.
|
List<Value> |
getInputValues()
Returns the input values provided to execute this source location.
|
SourceSection |
getLocation()
Returns the source location of the event that was triggered or
null if no
location source location is available. |
Value |
getReturnValue()
Returns the return value of this source location after it was executed.
|
String |
getRootName()
Returns the root name or
null if no name is available. |
boolean |
isExpression()
Returns
true if the source location is marked as expression, else
false . |
boolean |
isRoot()
Returns
true if the source location is marked as a root of a function, method or
closure, else false . |
boolean |
isStatement()
Returns
true if the source location is marked as a statement, else
false . |
String |
toString() |
public SourceSection getLocation()
null
if no
location source location is available.public String getRootName()
null
if no name is available. The root name may also be
available for events caused by expressions and statements. In this case the name of the
containing root will be returned.public List<Value> getInputValues()
null
if input value collection is not
enabled
. Input values are
available in OnReturn
events.The returned list may contain null
values if input values were not
evaluated or if an exception occurred executing input values. The returned list is
unmodifiable. The returned input values may escape the event consumer and remain valid until
the context is closed.public Value getReturnValue()
null
if return value collection is not
enabled
. Return values are
available in OnReturn
events. The returned value is allowed to escape the event consumer and remain valid until the
context is closed.public PolyglotException getException()
null
if exception collection is not
enabled
. Exceptions are only
available in OnReturn
events if an exception was thrown when the location was executed. The returned value is
allowed to escape the event consumer and remains valid until the context is closed.public boolean isExpression()
true
if the source location is marked as expression, else
false
. The collection of expression events may be enabled by calling
ExecutionListener.Builder.expressions(boolean)
.public boolean isStatement()
true
if the source location is marked as a statement, else
false
. The collection of statement events may be enabled by calling
ExecutionListener.Builder.statements(boolean)
.public boolean isRoot()
true
if the source location is marked as a root of a function, method or
closure, else false
. The collection of root events may be enabled by calling
ExecutionListener.Builder.roots(boolean)
.