On this page
Enum Class DirectMethodHandleDesc.Kind
- All Implemented Interfaces:
Serializable
,Comparable<DirectMethodHandleDesc.Kind>
,Constable
- Enclosing interface:
- DirectMethodHandleDesc
public static enum DirectMethodHandleDesc.Kind extends Enum<DirectMethodHandleDesc.Kind>
Kinds of method handles that can be described with DirectMethodHandleDesc.
- Since:
- 12
Nested Class Summary
Nested classes/interfaces declared in class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Enum Constant Summary
Enum Constant | Description |
---|---|
CONSTRUCTOR |
A method handle for a constructor
|
GETTER |
A method handle for a read accessor for an instance field
|
INTERFACE_SPECIAL |
A method handle for an interface method invoked as with invokespecial
|
INTERFACE_STATIC |
A method handle for a method invoked as with invokestatic
|
INTERFACE_VIRTUAL |
A method handle for a method invoked as with invokeinterface
|
SETTER |
A method handle for a write accessor for an instance field
|
SPECIAL |
A method handle for a method invoked as with invokespecial
|
STATIC |
A method handle for a method invoked as with invokestatic
|
STATIC_GETTER |
A method handle for a read accessor for a static field
|
STATIC_SETTER |
A method handle for a write accessor for a static field
|
VIRTUAL |
A method handle for a method invoked as with invokevirtual
|
Field Summary
Modifier and Type | Field | Description |
---|---|---|
final boolean |
isInterface |
Is this an interface
|
final int |
refKind |
The corresponding refKind value for this kind of method handle, as defined by MethodHandleInfo
|
Method Summary
Modifier and Type | Method | Description |
---|---|---|
static DirectMethodHandleDesc.Kind |
valueOf |
Returns the enumeration member with the given refKind field.
|
static DirectMethodHandleDesc.Kind |
valueOf |
Returns the enumeration member with the given the refKind and isInterface arguments.
|
static DirectMethodHandleDesc.Kind |
valueOf |
Returns the enum constant of this class with the specified name.
|
static DirectMethodHandleDesc.Kind[] |
values() |
Returns an array containing the constants of this enum class, in the order they are declared.
|
Enum Constant Details
STATIC
public static final DirectMethodHandleDesc.Kind STATIC
A method handle for a method invoked as with
invokestatic
INTERFACE_STATIC
public static final DirectMethodHandleDesc.Kind INTERFACE_STATIC
A method handle for a method invoked as with
invokestatic
VIRTUAL
public static final DirectMethodHandleDesc.Kind VIRTUAL
A method handle for a method invoked as with
invokevirtual
INTERFACE_VIRTUAL
public static final DirectMethodHandleDesc.Kind INTERFACE_VIRTUAL
A method handle for a method invoked as with
invokeinterface
SPECIAL
public static final DirectMethodHandleDesc.Kind SPECIAL
A method handle for a method invoked as with
invokespecial
INTERFACE_SPECIAL
public static final DirectMethodHandleDesc.Kind INTERFACE_SPECIAL
A method handle for an interface method invoked as with
invokespecial
CONSTRUCTOR
public static final DirectMethodHandleDesc.Kind CONSTRUCTOR
A method handle for a constructor
GETTER
public static final DirectMethodHandleDesc.Kind GETTER
A method handle for a read accessor for an instance field
SETTER
public static final DirectMethodHandleDesc.Kind SETTER
A method handle for a write accessor for an instance field
STATIC_GETTER
public static final DirectMethodHandleDesc.Kind STATIC_GETTER
A method handle for a read accessor for a static field
STATIC_SETTER
public static final DirectMethodHandleDesc.Kind STATIC_SETTER
A method handle for a write accessor for a static field
Field Details
refKind
public final int refKind
The corresponding
refKind
value for this kind of method handle, as defined by MethodHandleInfo
isInterface
public final boolean isInterface
Is this an interface
Method Details
values
public static DirectMethodHandleDesc.Kind[] values()
Returns an array containing the constants of this enum class, in the order they are declared.
- Returns:
- an array containing the constants of this enum class, in the order they are declared
valueOf
public static DirectMethodHandleDesc.Kind valueOf(String name)
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
valueOf
public static DirectMethodHandleDesc.Kind valueOf(int refKind)
Returns the enumeration member with the given
refKind
field. Behaves as if valueOf(refKind, false)
. As a special case, if refKind
is REF_invokeInterface
(9) then the isInterface
field will be true.
- Parameters:
refKind
- refKind of desired member- Returns:
- the matching enumeration member
- Throws:
IllegalArgumentException
- if there is no such member
valueOf
public static DirectMethodHandleDesc.Kind valueOf(int refKind, boolean isInterface)
Returns the enumeration member with the given the
refKind
and isInterface
arguments. For most values of refKind
there is an exact match regardless of the value of isInterface
. These are:
REF_invokeVirtual
which matches toVIRTUAL
REF_invokeInterface
which matches toINTERFACE_VIRTUAL
REF_newInvokeSpecial
which matches toCONSTRUCTOR
REF_getField
which matches toGETTER
REF_putField
which matches toSETTER
REF_getStatic
which matches toSTATIC_GETTER
REF_putStatic
which matches toSTATIC_SETTER
isInterface
:
REF_invokeStatic
which matches toSTATIC
orINTERFACE_STATIC
REF_invokeSpecial
which matches toSPECIAL
orINTERFACE_SPECIAL
- Parameters:
refKind
- refKind of desired memberisInterface
- whether desired member is for interface methods- Returns:
- the matching enumeration member
- Throws:
IllegalArgumentException
- if there is no such member
© 1993, 2021, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/constant/DirectMethodHandleDesc.Kind.html