public class MethodHandleConstant extends Constant
Constant
represents a method handle constant in the constant pool.Modifier and Type | Field and Description |
---|---|
Clazz |
javaLangInvokeMethodHandleClass
An extra field pointing to the java.lang.invoke.MethodHandle Clazz object.
|
static int |
REF_GET_FIELD |
static int |
REF_GET_STATIC |
static int |
REF_INVOKE_INTERFACE |
static int |
REF_INVOKE_SPECIAL |
static int |
REF_INVOKE_STATIC |
static int |
REF_INVOKE_VIRTUAL |
static int |
REF_NEW_INVOKE_SPECIAL |
static int |
REF_PUT_FIELD |
static int |
REF_PUT_STATIC |
int |
u1referenceKind |
int |
u2referenceIndex |
CLASS, DOUBLE, DYNAMIC, FIELDREF, FLOAT, INTEGER, INTERFACE_METHODREF, INVOKE_DYNAMIC, LONG, METHOD_HANDLE, METHOD_TYPE, METHODREF, MODULE, NAME_AND_TYPE, PACKAGE, PRIMITIVE_ARRAY, STRING, UTF8
processingFlags, processingInfo
Constructor and Description |
---|
MethodHandleConstant()
Creates an uninitialized MethodHandleConstant.
|
MethodHandleConstant(int u1referenceKind,
int u2referenceIndex)
Creates a new MethodHandleConstant with the given type and method ref index.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(Clazz clazz,
ConstantVisitor constantVisitor)
Accepts the given visitor.
|
boolean |
equals(java.lang.Object object) |
java.lang.String |
getClassName(Clazz clazz)
Returns the class name.
|
java.lang.String |
getName(Clazz clazz)
Returns the method/field name.
|
int |
getReferenceIndex()
Returns the field ref, interface method ref, or method ref index.
|
int |
getReferenceKind()
Returns the kind of reference to which this constant is pointing.
|
int |
getTag()
Returns the constant pool info tag that specifies the entry type.
|
java.lang.String |
getType(Clazz clazz)
Returns the type.
|
int |
hashCode() |
boolean |
isCategory2()
Returns whether the constant is of category 2.
|
void |
referenceAccept(Clazz clazz,
ConstantVisitor constantVisitor)
Applies the given constant pool visitor to the reference.
|
java.lang.String |
toString() |
addProcessingFlags, getProcessingFlags, getProcessingInfo, hasProcessingFlags, removeProcessingFlags, setProcessingFlags, setProcessingInfo
public static final int REF_GET_FIELD
public static final int REF_GET_STATIC
public static final int REF_PUT_FIELD
public static final int REF_PUT_STATIC
public static final int REF_INVOKE_VIRTUAL
public static final int REF_INVOKE_STATIC
public static final int REF_INVOKE_SPECIAL
public static final int REF_NEW_INVOKE_SPECIAL
public static final int REF_INVOKE_INTERFACE
public int u1referenceKind
public int u2referenceIndex
public Clazz javaLangInvokeMethodHandleClass
ClassReferenceInitializer
.public MethodHandleConstant()
public MethodHandleConstant(int u1referenceKind, int u2referenceIndex)
u1referenceKind
- the reference kind.u2referenceIndex
- the index of the field ref constant, interface method ref constant, or
method ref constant in the constant pool.public int getReferenceKind()
public int getReferenceIndex()
public java.lang.String getClassName(Clazz clazz)
public java.lang.String getName(Clazz clazz)
public java.lang.String getType(Clazz clazz)
public void referenceAccept(Clazz clazz, ConstantVisitor constantVisitor)
public int getTag()
Constant
public boolean isCategory2()
Constant
isCategory2
in class Constant
public void accept(Clazz clazz, ConstantVisitor constantVisitor)
Constant
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object