spring-framework / org.springframework.asm / TypeReference

TypeReference

open class TypeReference

A reference to a type appearing in a class, field or method declaration, or on an instruction. Such a reference designates the part of the class where the referenced type is appearing (e.g. an 'extends', 'implements' or 'throws' clause, a 'new' instruction, a 'catch' clause, a type cast, a local variable declaration, etc).

Author
Eric Bruneton

Constructors

<init>

TypeReference(typeRef: Int)

Creates a new TypeReference.

Properties

CAST

static val CAST: Int

The sort of type references that target the type declared in an explicit or implicit cast instruction. See getSort.

CLASS_EXTENDS

static val CLASS_EXTENDS: Int

The sort of type references that target the super class of a class or one of the interfaces it implements. See getSort.

CLASS_TYPE_PARAMETER

static val CLASS_TYPE_PARAMETER: Int

The sort of type references that target a type parameter of a generic class. See getSort.

CLASS_TYPE_PARAMETER_BOUND

static val CLASS_TYPE_PARAMETER_BOUND: Int

The sort of type references that target a bound of a type parameter of a generic class. See getSort.

CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT

static val CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT: Int

The sort of type references that target a type parameter of a generic constructor in a constructor call. See getSort.

CONSTRUCTOR_REFERENCE

static val CONSTRUCTOR_REFERENCE: Int

The sort of type references that target the receiver type of a constructor reference. See getSort.

CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT

static val CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT: Int

The sort of type references that target a type parameter of a generic constructor in a constructor reference. See getSort.

EXCEPTION_PARAMETER

static val EXCEPTION_PARAMETER: Int

The sort of type references that target the type of the exception of a 'catch' clause in a method. See getSort.

FIELD

static val FIELD: Int

The sort of type references that target the type of a field. See getSort.

INSTANCEOF

static val INSTANCEOF: Int

The sort of type references that target the type declared in an 'instanceof' instruction. See getSort.

LOCAL_VARIABLE

static val LOCAL_VARIABLE: Int

The sort of type references that target the type of a local variable in a method. See getSort.

METHOD_FORMAL_PARAMETER

static val METHOD_FORMAL_PARAMETER: Int

The sort of type references that target the type of a formal parameter of a method. See getSort.

METHOD_INVOCATION_TYPE_ARGUMENT

static val METHOD_INVOCATION_TYPE_ARGUMENT: Int

The sort of type references that target a type parameter of a generic method in a method call. See getSort.

METHOD_RECEIVER

static val METHOD_RECEIVER: Int

The sort of type references that target the receiver type of a method. See getSort.

METHOD_REFERENCE

static val METHOD_REFERENCE: Int

The sort of type references that target the receiver type of a method reference. See getSort.

METHOD_REFERENCE_TYPE_ARGUMENT

static val METHOD_REFERENCE_TYPE_ARGUMENT: Int

The sort of type references that target a type parameter of a generic method in a method reference. See getSort.

METHOD_RETURN

static val METHOD_RETURN: Int

The sort of type references that target the return type of a method. See getSort.

METHOD_TYPE_PARAMETER

static val METHOD_TYPE_PARAMETER: Int

The sort of type references that target a type parameter of a generic method. See getSort.

METHOD_TYPE_PARAMETER_BOUND

static val METHOD_TYPE_PARAMETER_BOUND: Int

The sort of type references that target a bound of a type parameter of a generic method. See getSort.

NEW

static val NEW: Int

The sort of type references that target the type of the object created by a 'new' instruction. See getSort.

RESOURCE_VARIABLE

static val RESOURCE_VARIABLE: Int

The sort of type references that target the type of a resource variable in a method. See getSort.

THROWS

static val THROWS: Int

The sort of type references that target the type of an exception declared in the throws clause of a method. See getSort.

Functions

getExceptionIndex

open fun getExceptionIndex(): Int

Returns the index of the exception, in a 'throws' clause of a method, whose type is referenced by this type reference. This method must only be used for type references whose sort is THROWS.

getFormalParameterIndex

open fun getFormalParameterIndex(): Int

Returns the index of the formal parameter whose type is referenced by this type reference. This method must only be used for type references whose sort is METHOD_FORMAL_PARAMETER.

getSort

open fun getSort(): Int

Returns the sort of this type reference.

getSuperTypeIndex

open fun getSuperTypeIndex(): Int

Returns the index of the "super type" of a class that is referenced by this type reference. This method must only be used for type references whose sort is CLASS_EXTENDS.

getTryCatchBlockIndex

open fun getTryCatchBlockIndex(): Int

Returns the index of the try catch block (using the order in which they are visited with visitTryCatchBlock), whose 'catch' type is referenced by this type reference. This method must only be used for type references whose sort is EXCEPTION_PARAMETER .

getTypeArgumentIndex

open fun getTypeArgumentIndex(): Int

Returns the index of the type argument referenced by this type reference. This method must only be used for type references whose sort is CAST, CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT, METHOD_INVOCATION_TYPE_ARGUMENT, CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT, or METHOD_REFERENCE_TYPE_ARGUMENT.

getTypeParameterBoundIndex

open fun getTypeParameterBoundIndex(): Int

Returns the index of the type parameter bound, within the type parameter #getTypeParameterIndex, referenced by this type reference. This method must only be used for type references whose sort is CLASS_TYPE_PARAMETER_BOUND or METHOD_TYPE_PARAMETER_BOUND.

getTypeParameterIndex

open fun getTypeParameterIndex(): Int

Returns the index of the type parameter referenced by this type reference. This method must only be used for type references whose sort is CLASS_TYPE_PARAMETER, METHOD_TYPE_PARAMETER, CLASS_TYPE_PARAMETER_BOUND or METHOD_TYPE_PARAMETER_BOUND.

getValue

open fun getValue(): Int

Returns the int encoded value of this type reference, suitable for use in visit methods related to type annotations, like visitTypeAnnotation.

newExceptionReference

open static fun newExceptionReference(exceptionIndex: Int): TypeReference

Returns a reference to the type of an exception, in a 'throws' clause of a method.

newFormalParameterReference

open static fun newFormalParameterReference(paramIndex: Int): TypeReference

Returns a reference to the type of a formal parameter of a method.

newSuperTypeReference

open static fun newSuperTypeReference(itfIndex: Int): TypeReference

Returns a reference to the super class or to an interface of the 'implements' clause of a class.

newTryCatchReference

open static fun newTryCatchReference(tryCatchBlockIndex: Int): TypeReference

Returns a reference to the type of the exception declared in a 'catch' clause of a method.

newTypeArgumentReference

open static fun newTypeArgumentReference(sort: Int, argIndex: Int): TypeReference

Returns a reference to the type of a type argument in a constructor or method call or reference.

newTypeParameterBoundReference

open static fun newTypeParameterBoundReference(sort: Int, paramIndex: Int, boundIndex: Int): TypeReference

Returns a reference to a type parameter bound of a generic class or method.

newTypeParameterReference

open static fun newTypeParameterReference(sort: Int, paramIndex: Int): TypeReference

Returns a reference to a type parameter of a generic class or method.

newTypeReference

open static fun newTypeReference(sort: Int): TypeReference

Returns a type reference of the given sort.