spring-framework / org.springframework.asm / Type

Type

open class Type

A Java field or method type. This class can be used to make it easier to manipulate type and method descriptors.

Author
Eric Bruneton

Author
Chris Nokleberg

Properties

ARRAY

static val ARRAY: Int

The sort of array reference types. See getSort.

BOOLEAN

static val BOOLEAN: Int

The sort of the boolean type. See getSort.

BOOLEAN_TYPE

static val BOOLEAN_TYPE: Type

The boolean type.

BYTE

static val BYTE: Int

The sort of the byte type. See getSort.

BYTE_TYPE

static val BYTE_TYPE: Type

The byte type.

CHAR

static val CHAR: Int

The sort of the char type. See getSort.

CHAR_TYPE

static val CHAR_TYPE: Type

The char type.

DOUBLE

static val DOUBLE: Int

The sort of the double type. See getSort.

DOUBLE_TYPE

static val DOUBLE_TYPE: Type

The double type.

FLOAT

static val FLOAT: Int

The sort of the float type. See getSort.

FLOAT_TYPE

static val FLOAT_TYPE: Type

The float type.

INT

static val INT: Int

The sort of the int type. See getSort.

INT_TYPE

static val INT_TYPE: Type

The int type.

LONG

static val LONG: Int

The sort of the long type. See getSort.

LONG_TYPE

static val LONG_TYPE: Type

The long type.

METHOD

static val METHOD: Int

The sort of method types. See getSort.

OBJECT

static val OBJECT: Int

The sort of object reference types. See getSort.

SHORT

static val SHORT: Int

The sort of the short type. See getSort.

SHORT_TYPE

static val SHORT_TYPE: Type

The short type.

VOID

static val VOID: Int

The sort of the void type. See getSort.

VOID_TYPE

static val VOID_TYPE: Type

The void type.

Functions

equals

open fun equals(other: Any?): Boolean

Tests if the given object is equal to this type.

getArgumentTypes

open fun getArgumentTypes(): Array<Type>

Returns the argument types of methods of this type. This method should only be used for method types.

open static fun getArgumentTypes(methodDescriptor: String): Array<Type>

Returns the Java types corresponding to the argument types of the given method descriptor.

open static fun getArgumentTypes(method: Method): Array<Type>

Returns the Java types corresponding to the argument types of the given method.

getArgumentsAndReturnSizes

open fun getArgumentsAndReturnSizes(): Int

Returns the size of the arguments and of the return value of methods of this type. This method should only be used for method types.

open static fun getArgumentsAndReturnSizes(desc: String): Int

Computes the size of the arguments and of the return value of a method.

getClassName

open fun getClassName(): String

Returns the binary name of the class corresponding to this type. This method must not be used on method types.

getConstructorDescriptor

open static fun getConstructorDescriptor(c: Constructor<*>): String

Returns the descriptor corresponding to the given constructor.

getDescriptor

open fun getDescriptor(): String

Returns the descriptor corresponding to this Java type.

open static fun getDescriptor(c: Class<*>): String

Returns the descriptor corresponding to the given Java type.

getDimensions

open fun getDimensions(): Int

Returns the number of dimensions of this array type. This method should only be used for an array type.

getElementType

open fun getElementType(): Type

Returns the type of the elements of this array type. This method should only be used for an array type.

getInternalName

open fun getInternalName(): String

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 '/'. This method should only be used for an object or array type.

open static fun getInternalName(c: Class<*>): String

Returns the internal name of the given class. The internal name of a class is its fully qualified name, as returned by Class.getName(), where '.' are replaced by '/'.

getMethodDescriptor

open static fun getMethodDescriptor(returnType: Type, vararg argumentTypes: Type): String

Returns the descriptor corresponding to the given argument and return types.

open static fun getMethodDescriptor(m: Method): String

Returns the descriptor corresponding to the given method.

getMethodType

open static fun getMethodType(methodDescriptor: String): Type

Returns the Java type corresponding to the given method descriptor. Equivalent to Type.getType(methodDescriptor).

open static fun getMethodType(returnType: Type, vararg argumentTypes: Type): Type

Returns the Java method type corresponding to the given argument and return types.

getObjectType

open static fun getObjectType(internalName: String): Type

Returns the Java type corresponding to the given internal name.

getOpcode

open fun getOpcode(opcode: Int): Int

Returns a JVM instruction opcode adapted to this Java type. This method must not be used for method types.

getReturnType

open fun getReturnType(): Type

Returns the return type of methods of this type. This method should only be used for method types.

open static fun getReturnType(methodDescriptor: String): Type

Returns the Java type corresponding to the return type of the given method descriptor.

open static fun getReturnType(method: Method): Type

Returns the Java type corresponding to the return type of the given method.

getSize

open fun getSize(): Int

Returns the size of values of this type. This method must not be used for method types.

getSort

open fun getSort(): Int

Returns the sort of this Java type.

getType

open static fun getType(typeDescriptor: String): Type

Returns the Java type corresponding to the given type descriptor.

open static fun getType(c: Class<*>): Type

Returns the Java type corresponding to the given class.

open static fun getType(c: Constructor<*>): Type

Returns the Java method type corresponding to the given constructor.

open static fun getType(m: Method): Type

Returns the Java method type corresponding to the given method.

hashCode

open fun hashCode(): Int

Returns a hash code value for this type.

toString

open fun toString(): String

Returns a string representation of this type.