Package proguard.classfile.constant
Class MethodHandleConstant
- java.lang.Object
-
- proguard.util.SimpleProcessable
-
- proguard.classfile.constant.Constant
-
- proguard.classfile.constant.MethodHandleConstant
-
- All Implemented Interfaces:
java.io.Serializable
,Processable
public class MethodHandleConstant extends Constant
ThisConstant
represents a method handle constant in the constant pool.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field 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
-
Fields inherited from class proguard.classfile.constant.Constant
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
-
Fields inherited from class proguard.util.SimpleProcessable
processingFlags, processingInfo
-
-
Constructor Summary
Constructors Constructor Description MethodHandleConstant()
Creates an uninitialized MethodHandleConstant.MethodHandleConstant(int u1referenceKind, int u2referenceIndex)
Creates a new MethodHandleConstant with the given type and method ref index.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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()
-
Methods inherited from class proguard.util.SimpleProcessable
addProcessingFlags, getProcessingFlags, getProcessingInfo, hasProcessingFlags, removeProcessingFlags, setProcessingFlags, setProcessingInfo
-
-
-
-
Field Detail
-
REF_GET_FIELD
public static final int REF_GET_FIELD
- See Also:
- Constant Field Values
-
REF_GET_STATIC
public static final int REF_GET_STATIC
- See Also:
- Constant Field Values
-
REF_PUT_FIELD
public static final int REF_PUT_FIELD
- See Also:
- Constant Field Values
-
REF_PUT_STATIC
public static final int REF_PUT_STATIC
- See Also:
- Constant Field Values
-
REF_INVOKE_VIRTUAL
public static final int REF_INVOKE_VIRTUAL
- See Also:
- Constant Field Values
-
REF_INVOKE_STATIC
public static final int REF_INVOKE_STATIC
- See Also:
- Constant Field Values
-
REF_INVOKE_SPECIAL
public static final int REF_INVOKE_SPECIAL
- See Also:
- Constant Field Values
-
REF_NEW_INVOKE_SPECIAL
public static final int REF_NEW_INVOKE_SPECIAL
- See Also:
- Constant Field Values
-
REF_INVOKE_INTERFACE
public static final int REF_INVOKE_INTERFACE
- See Also:
- Constant Field Values
-
u1referenceKind
public int u1referenceKind
-
u2referenceIndex
public int u2referenceIndex
-
javaLangInvokeMethodHandleClass
public Clazz javaLangInvokeMethodHandleClass
An extra field pointing to the java.lang.invoke.MethodHandle Clazz object. This field is typically filled out by the
.ClassReferenceInitializer
-
-
Constructor Detail
-
MethodHandleConstant
public MethodHandleConstant()
Creates an uninitialized MethodHandleConstant.
-
MethodHandleConstant
public MethodHandleConstant(int u1referenceKind, int u2referenceIndex)
Creates a new MethodHandleConstant with the given type and method ref index.- Parameters:
u1referenceKind
- the reference kind.u2referenceIndex
- the index of the field ref constant, interface method ref constant, or method ref constant in the constant pool.
-
-
Method Detail
-
getReferenceKind
public int getReferenceKind()
Returns the kind of reference to which this constant is pointing.
-
getReferenceIndex
public int getReferenceIndex()
Returns the field ref, interface method ref, or method ref index.
-
getClassName
public java.lang.String getClassName(Clazz clazz)
Returns the class name.
-
getName
public java.lang.String getName(Clazz clazz)
Returns the method/field name.
-
getType
public java.lang.String getType(Clazz clazz)
Returns the type.
-
referenceAccept
public void referenceAccept(Clazz clazz, ConstantVisitor constantVisitor)
Applies the given constant pool visitor to the reference.
-
getTag
public int getTag()
Description copied from class:Constant
Returns the constant pool info tag that specifies the entry type.
-
isCategory2
public boolean isCategory2()
Description copied from class:Constant
Returns whether the constant is of category 2. This means that it takes up the space of two category 1 types in the constant pool or on the stack, for instance.- Specified by:
isCategory2
in classConstant
-
accept
public void accept(Clazz clazz, ConstantVisitor constantVisitor)
Description copied from class:Constant
Accepts the given visitor.
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-