Class ReferenceType

java.lang.Object
mockit.asm.types.JavaType
mockit.asm.types.ReferenceType
Direct Known Subclasses:
ArrayType, MethodType, ObjectType

public abstract class ReferenceType extends JavaType
  • Method Details

    • createFromTypeDescriptor

      @NonNull public static ReferenceType createFromTypeDescriptor(@NonNull String typeDesc)
      Returns the Java type corresponding to the given type descriptor.
      Parameters:
      typeDesc - a type descriptor.
    • createFromInternalName

      @NonNull public static ReferenceType createFromInternalName(@NonNull String internalName)
      Returns the object or array type corresponding to the given internal name.
    • getInternalName

      @NonNull public final String getInternalName()
      Returns the internal name of the class corresponding to this object or array type. The internal name of a class is its fully qualified name (as returned by Class.getName(), where '.' are replaced by '/'. For an array type, it starts with "[" and ends with the type descriptor of the array element type.
      Returns:
      the internal name of the class corresponding to this object or array type.
    • getSize

      public int getSize()
      Description copied from class: JavaType
      Returns the size of values of this type. This method must not be used for method types.
      Specified by:
      getSize in class JavaType
      Returns:
      the size of values of this type, i.e., 2 for long and double, 0 for void and 1 otherwise.
    • getOpcode

      public int getOpcode(int opcode)
      Description copied from class: JavaType
      Returns a JVM instruction opcode adapted to this Java type. This method must not be used for method types.
      Specified by:
      getOpcode in class JavaType
      Parameters:
      opcode - a JVM instruction opcode. This opcode must be one of ILOAD, ISTORE, IALOAD, IASTORE, IADD, ISUB, IMUL, IDIV, IREM, INEG, ISHL, ISHR, IUSHR, IAND, IOR, IXOR and IRETURN.
      Returns:
      an opcode that is similar to the given opcode, but adapted to this Java type. For example, if this type is float and opcode is IRETURN, this method returns FRETURN.
    • getLoadOpcode

      public final int getLoadOpcode()
      Specified by:
      getLoadOpcode in class JavaType
    • getConstOpcode

      public final int getConstOpcode()
      Specified by:
      getConstOpcode in class JavaType
    • equals

      public final boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object