Class MethodHandleConstant

  • All Implemented Interfaces:
    Value

    public final class MethodHandleConstant
    extends Constant
    Represents a MethodHandle constant loaded via ldc.
    • Constructor Detail

      • MethodHandleConstant

        public MethodHandleConstant​(int referenceKind,
                                    String owner,
                                    String name,
                                    String descriptor)
        Creates a MethodHandle constant.
        Parameters:
        referenceKind - the reference kind (1-9)
        owner - the class containing the referenced member
        name - the name of the referenced member
        descriptor - the descriptor of the referenced member
    • 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
      • getType

        public IRType getType()
        Description copied from interface: Value
        Gets the IR type of this value.
        Returns:
        the IR type
      • getValue

        public Object getValue()
        Description copied from class: Constant
        Gets the value of this constant.
        Specified by:
        getValue in class Constant
        Returns:
        the constant value
      • isFieldReference

        public boolean isFieldReference()
        Checks if this method handle references a field.
        Returns:
        true if this is a field reference
      • isMethodReference

        public boolean isMethodReference()
        Checks if this method handle references a method.
        Returns:
        true if this is a method reference
      • getReferenceKindName

        public String getReferenceKindName()
        Gets a human-readable name for the reference kind.
        Returns:
        the reference kind name
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object