public interface SnippetReflectionProvider
This interface must not be used in Graal code that is not related to snippet processing.
| Modifier and Type | Method and Description |
|---|---|
<T> T |
asObject(Class<T> type,
JavaConstant constant)
Gets the object reference a given constant represents if it is of a given type.
|
default JavaConstant |
forBoxed(JavaKind kind,
Object value)
Creates a boxed constant for the given kind from an Object.
|
JavaConstant |
forObject(Object object)
Creates a boxed
object constant. |
<T> T |
getInjectedNodeIntrinsicParameter(Class<T> type)
Gets the value to bind to an injected parameter in a node intrinsic.
|
Class<?> |
originalClass(ResolvedJavaType type)
Get the original Java class corresponding to a
ResolvedJavaType. |
JavaConstant forObject(Object object)
object constant.object - the object value to boxobject<T> T asObject(Class<T> type, JavaConstant constant)
JavaKind.Object.type - the expected type of the object represented by constant. If the object is
required to be of this type, then wrap the call to this method in
Objects.requireNonNull(Object).constant - an object constantconstant cast to type if it is an
instance of type otherwise nulldefault JavaConstant forBoxed(JavaKind kind,
Object value)
kind - the kind of the constant to createvalue - the Java boxed value: a Byte instance for JavaKind.Byte, etc.value<T> T getInjectedNodeIntrinsicParameter(Class<T> type)
type - the type of a parameter in a node intrinsic constructorClass<?> originalClass(ResolvedJavaType type)
ResolvedJavaType.type - the type for which the original Java class is requestedtype or null if this object
cannot map ResolvedJavaType instances to Class instances