public final class EventContext extends Object
EventContext should be neither stored, cached nor hashed. One exception is
when they are stored in ExecutionEventNode implementations. The equality and hashing
behavior is undefined.ExecutionEventNodeFactory,
ExecutionEventListener| Modifier and Type | Method and Description |
|---|---|
Node |
getInstrumentedNode()
Accessor to the instrumented node at which the event occurred.
|
SourceSection |
getInstrumentedSourceSection()
Returns the
SourceSection that is being instrumented. |
boolean |
isLanguageContextInitialized()
Test if language context of the source of the event is initialized.
|
ExecutionEventNode |
lookupExecutionEventNode(EventBinding<? extends ExecutionEventNodeFactory> binding)
Returns the execution event node that was inserted at this location given an event binding.
|
CallTarget |
parseInContext(Source source,
String... argumentNames)
Evaluates source of (potentially different) language using the current context.
|
String |
toString() |
public SourceSection getInstrumentedSourceSection()
SourceSection that is being instrumented. The returned source section is
final for each EventContext instance.
Performance note: this is method may be invoked in compiled code and is guaranteed to always return a compilation constant .
public Node getInstrumentedNode()
Performance note: this is method may be invoked in compiled code and is guaranteed to always return a compilation constant .
public boolean isLanguageContextInitialized()
public CallTarget parseInContext(Source source, String... argumentNames) throws IOException
source to reference the actual parameters passed to
CallTarget.call(java.lang.Object...).source - the source to evaluateargumentNames - the names of CallTarget.call(java.lang.Object...) arguments that
can be referenced from the sourceIOException - if the parsing or evaluation fails for some reasonpublic ExecutionEventNode lookupExecutionEventNode(EventBinding<? extends ExecutionEventNodeFactory> binding)
binding - the binding to lookup