Top Description Fields Constructors Methods
org.graalvm.polyglot.management

public final Class ExecutionEvent

extends Object
Class Inheritance
Imports
java.util.List, org.graalvm.polyglot.PolyglotException, .SourceSection, .Value, org.graalvm.polyglot.impl.AbstractPolyglotImpl.AbstractExecutionEventDispatch

An execution event object passed to an execution listener consumer. Execution event instances remain valid until the engine is closed. Values and returned exceptions will only remain valid until the context was closed.
Since
19.0
See Also
For further details.

Field Summary

Modifier and TypeField and Description
pack-priv final AbstractPolyglotImpl.AbstractExecutionEventDispatch
pack-priv final Object

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public PolyglotException
getException()

Returns the exception of this source location after it was executed.

public List<Value>
getInputValues()

Returns the input values provided to execute this source location.

public SourceSection
getLocation()

Returns the source location of the event that was triggered or null if no location source location is available.

public Value
getReturnValue()

Returns the return value of this source location after it was executed.

public String
getRootName()

Returns the root name or null if no name is available.

public boolean
isExpression()

Returns true if the source location is marked as expression, else false.

public boolean
isRoot()

Returns true if the source location is marked as a root of a function, method or closure, else false.

public boolean
isStatement()

Returns true if the source location is marked as a statement, else false.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

dispatchback to summary
pack-priv final AbstractPolyglotImpl.AbstractExecutionEventDispatch dispatch
receiverback to summary
pack-priv final Object receiver

Constructor Detail

ExecutionEventback to summary
pack-priv ExecutionEvent(AbstractPolyglotImpl.AbstractExecutionEventDispatch dispatch, Object receiver)

Method Detail

getExceptionback to summary
public PolyglotException getException()

Returns the exception of this source location after it was executed. This method returns 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.

Since
19.0
getInputValuesback to summary
public List<Value> getInputValues()

Returns the input values provided to execute this source location. This method returns 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.

Annotations
@SuppressWarnings:unchecked
Since
19.0
getLocationback to summary
public SourceSection getLocation()

Returns the source location of the event that was triggered or null if no location source location is available.

Since
19.0
getReturnValueback to summary
public Value getReturnValue()

Returns the return value of this source location after it was executed. This method returns 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.

Since
19.0
getRootNameback to summary
public String getRootName()

Returns the root name or 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.

Since
19.0
isExpressionback to summary
public boolean isExpression()

Returns 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).

Since
19.0
isRootback to summary
public boolean isRoot()

Returns 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).

Since
19.0
isStatementback to summary
public boolean isStatement()

Returns 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).

Since
19.0
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
Since
19.0