public abstract class ContextLocal<T> extends Object
ContextLocal.get() or for other contexts using
ContextLocal.get(TruffleContext). Context locals can be created for languages and instruments. See
links below for usage examples.Usage with languages.,
Usage with instruments.| Modifier | Constructor and Description |
|---|---|
protected |
ContextLocal(Object polyglotObject)
Custom subclasses of context local are not allowed.
|
| Modifier and Type | Method and Description |
|---|---|
abstract T |
get()
Returns the context local value for the currently entered context.
|
abstract T |
get(TruffleContext context)
Returns the context local value for an explicit
context. |
protected ContextLocal(Object polyglotObject)
public abstract T get()
null. Throws
IllegalStateException if no current context is entered on the current thread.public abstract T get(TruffleContext context)
context. This method
is intended to be used on compiled code paths. The return value is never null.
Throws IllegalStateException if no current context is entered on the current thread.