Class MethodHandleInfo
- java.lang.Object
-
- com.tonic.analysis.execution.dispatch.MethodHandleInfo
-
public final class MethodHandleInfo extends Object
A CONSTANT_MethodHandle entry: reference kind plus the referenced member's owner, name, and descriptor.
-
-
Field Summary
Fields Modifier and Type Field Description static intREF_getFieldstatic intREF_getStaticstatic intREF_invokeInterfacestatic intREF_invokeSpecialstatic intREF_invokeStaticstatic intREF_invokeVirtualstatic intREF_newInvokeSpecialstatic intREF_putFieldstatic intREF_putStatic
-
Constructor Summary
Constructors Constructor Description MethodHandleInfo(int referenceKind, String owner, String name, String descriptor)Creates a method handle descriptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDescriptor()StringgetName()StringgetOwner()intgetReferenceKind()StringgetReferenceKindName()Names the reference kind for diagnostics.booleanisConstructor()Checks whether the handle invokes a constructor.booleanisFieldReference()Checks whether the handle references a field.booleanisGetter()Checks whether the handle reads a field.booleanisMethodReference()Checks whether the handle references a method or constructor.booleanisSetter()Checks whether the handle writes a field.booleanisStatic()Checks whether the referenced member is static.StringtoString()
-
-
-
Field Detail
-
REF_getField
public static final int REF_getField
- See Also:
- Constant Field Values
-
REF_getStatic
public static final int REF_getStatic
- See Also:
- Constant Field Values
-
REF_putField
public static final int REF_putField
- See Also:
- Constant Field Values
-
REF_putStatic
public static final int REF_putStatic
- See Also:
- Constant Field Values
-
REF_invokeVirtual
public static final int REF_invokeVirtual
- See Also:
- Constant Field Values
-
REF_invokeStatic
public static final int REF_invokeStatic
- See Also:
- Constant Field Values
-
REF_invokeSpecial
public static final int REF_invokeSpecial
- See Also:
- Constant Field Values
-
REF_newInvokeSpecial
public static final int REF_newInvokeSpecial
- See Also:
- Constant Field Values
-
REF_invokeInterface
public static final int REF_invokeInterface
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MethodHandleInfo
public MethodHandleInfo(int referenceKind, String owner, String name, String descriptor)Creates a method handle descriptor.- Parameters:
referenceKind- one of the REF_* kind constantsowner- internal name of the referenced member's declaring classname- the referenced member's namedescriptor- the referenced member's descriptor
-
-
Method Detail
-
getReferenceKind
public int getReferenceKind()
- Returns:
- the reference kind
-
getOwner
public String getOwner()
- Returns:
- the owner
-
getName
public String getName()
- Returns:
- the name
-
getDescriptor
public String getDescriptor()
- Returns:
- the descriptor
-
isFieldReference
public boolean isFieldReference()
Checks whether the handle references a field.- Returns:
- true for the get/put field and static kinds
-
isMethodReference
public boolean isMethodReference()
Checks whether the handle references a method or constructor.- Returns:
- true for the invoke kinds
-
isGetter
public boolean isGetter()
Checks whether the handle reads a field.- Returns:
- true for REF_getField or REF_getStatic
-
isSetter
public boolean isSetter()
Checks whether the handle writes a field.- Returns:
- true for REF_putField or REF_putStatic
-
isStatic
public boolean isStatic()
Checks whether the referenced member is static.- Returns:
- true for the static field kinds or REF_invokeStatic
-
isConstructor
public boolean isConstructor()
Checks whether the handle invokes a constructor.- Returns:
- true for REF_newInvokeSpecial
-
getReferenceKindName
public String getReferenceKindName()
Names the reference kind for diagnostics.- Returns:
- the REF_* constant name, or a placeholder for unknown kinds
-
-