public interface MethodHandleInfo
Modifier and Type | Field and Description |
---|---|
static int |
REF_getField
Getter MethodHandle for an instance field
|
static int |
REF_getStatic
Getter MethodHandle for an static field
|
static int |
REF_invokeInterface
MethodHandle for an interface method
|
static int |
REF_invokeSpecial
MethodHandle for an special method
|
static int |
REF_invokeStatic
MethodHandle for a static method
|
static int |
REF_invokeVirtual
MethodHandle for an instance method
|
static int |
REF_newInvokeSpecial
MethodHandle for a constructor
|
static int |
REF_putField
Setter MethodHandle for an instance field
|
static int |
REF_putStatic
Setter MethodHandle for an static field
|
Modifier and Type | Method and Description |
---|---|
Class<?> |
getDeclaringClass()
Returns the Class where the cracked MethodHandle's underlying method, field or constructor is declared.
|
MethodType |
getMethodType()
Returns the type of the MethodHandle's underlying member as a MethodType.
|
int |
getModifiers()
Returns the modifiers of the MethodHandle's underlying member.
|
String |
getName()
Returns the simple name of the MethodHandle's underlying member.
|
int |
getReferenceKind()
Returns the reference kind of the MethodHandle.
|
default boolean |
isVarArgs()
Returns whether the MethodHandle's underlying method or constructor has variable argument arity.
|
static String |
referenceKindToString(int referenceKind)
Returns a string representing the equivalent bytecode for the referenceKind.
|
<T extends Member> |
reflectAs(Class<T> expected,
MethodHandles.Lookup lookup)
Reflects the underlying member as a Method, Field or Constructor.
|
static String |
toString(int kind,
Class<?> defc,
String name,
MethodType type)
Answers a string containing a concise, human-readable description of the receiver.
|
static final int REF_getField
static final int REF_getStatic
static final int REF_putField
static final int REF_putStatic
static final int REF_invokeVirtual
static final int REF_invokeStatic
static final int REF_invokeSpecial
static final int REF_newInvokeSpecial
static final int REF_invokeInterface
Class<?> getDeclaringClass()
String getName()
MethodType getMethodType()
int getModifiers()
int getReferenceKind()
default boolean isVarArgs()
<T extends Member> T reflectAs(Class<T> expected, MethodHandles.Lookup lookup)
getMethod
, getField
or getConstructor
.
Non-public members are reflected as if by getDeclaredMethod
, getDeclaredField
or getDeclaredConstructor
.T
- The expected type of the returned Memberexpected
- The expected Class of the returned Memberlookup
- The lookup that was used to create the MethodHandle, or a lookup object with equivalent accessNullPointerException
- If either argument is nullIllegalArgumentException
- If the underlying member is not accessible to the provided lookup objectClassCastException
- If the underlying member is not of the expected typestatic String referenceKindToString(int referenceKind) throws IllegalArgumentException
referenceKind
- The referenceKind to lookupIllegalArgumentException
- If the provided referenceKind is invalidstatic String toString(int kind, Class<?> defc, String name, MethodType type)
kind
- the reference kind, one of the declared MethodHandleInfo.REF fields.defc
- the class where the member is declaredname
- the name of the membertype
- the member's MethodTypeEclipse OpenJ9 website.
To raise a bug report or suggest an improvement create an Eclipse OpenJ9 issue.
Copyright © 1993, 2023 IBM Corp. and others.