Modifier and Type | Field and Description |
---|---|
public static final int | CAST
The sort of type references that target the type declared in an explicit or implicit cast instruction. |
public static final int | CLASS_EXTENDS
The sort of type references that target the super class of a class or one of the interfaces it implements. |
public static final int | CLASS_TYPE_PARAMETER
The sort of type references that target a type parameter of a generic class. |
public static final int | CLASS_TYPE_PARAMETER_BOUND
The sort of type references that target a bound of a type parameter of a generic class. |
public static final int | CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT
The sort of type references that target a type parameter of a generic constructor in a constructor call. |
public static final int | CONSTRUCTOR_REFERENCE
The sort of type references that target the receiver type of a constructor reference. |
public static final int | CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT
The sort of type references that target a type parameter of a generic constructor in a constructor reference. |
public static final int | EXCEPTION_PARAMETER
The sort of type references that target the type of the exception of a 'catch' clause in a method. |
public static final int | FIELD
The sort of type references that target the type of a field. |
public static final int | INSTANCEOF
The sort of type references that target the type declared in an 'instanceof' instruction. |
public static final int | LOCAL_VARIABLE
The sort of type references that target the type of a local variable in a method. |
public static final int | METHOD_FORMAL_PARAMETER
The sort of type references that target the type of a formal parameter of a method. |
public static final int | METHOD_INVOCATION_TYPE_ARGUMENT
The sort of type references that target a type parameter of a generic method in a method call. |
public static final int | METHOD_RECEIVER
The sort of type references that target the receiver type of a method. |
public static final int | METHOD_REFERENCE
The sort of type references that target the receiver type of a method reference. |
public static final int | METHOD_REFERENCE_TYPE_ARGUMENT
The sort of type references that target a type parameter of a generic method in a method reference. |
public static final int | METHOD_RETURN
The sort of type references that target the return type of a method. |
public static final int | METHOD_TYPE_PARAMETER
The sort of type references that target a type parameter of a generic method. |
public static final int | METHOD_TYPE_PARAMETER_BOUND
The sort of type references that target a bound of a type parameter of a generic method. |
public static final int | NEW
The sort of type references that target the type of the object created by a 'new' instruction. |
public static final int | RESOURCE_VARIABLE
The sort of type references that target the type of a resource variable in a method. |
private final int | targetTypeAndInfo
The target_type and target_info structures - as defined in the Java Virtual Machine Specification (JVMS) - corresponding to this type reference. |
public static final int | THROWS
The sort of type references that target the type of an exception declared in the throws clause of a method. |
Access | Constructor and Description |
---|---|
public | TypeReference(final int
the int encoded value of the type reference, as received in a visit method
related to type annotations, such as typeRef)ClassVisitor#visitTypeAnnotation .Constructs a new TypeReference. |
Modifier and Type | Method and Description |
---|---|
public int | Returns: the index of an exception in the 'throws' clause of a method.Returns the index of the exception, in a 'throws' clause of a method, whose type is referenced by this type reference. |
public int | Returns: a formal parameter index.Returns the index of the formal parameter whose type is referenced by this type reference. |
public int | Returns: one ofCLASS_TYPE_PARAMETER , METHOD_TYPE_PARAMETER , CLASS_EXTENDS , CLASS_TYPE_PARAMETER_BOUND , METHOD_TYPE_PARAMETER_BOUND ,
FIELD , METHOD_RETURN , METHOD_RECEIVER , METHOD_FORMAL_PARAMETER , THROWS , LOCAL_VARIABLE , RESOURCE_VARIABLE , EXCEPTION_PARAMETER , INSTANCEOF , NEW ,
CONSTRUCTOR_REFERENCE , METHOD_REFERENCE , CAST , CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT , METHOD_INVOCATION_TYPE_ARGUMENT , CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT , or METHOD_REFERENCE_TYPE_ARGUMENT .Returns the sort of this type reference. |
public int | Returns: the index of an interface in the 'implements' clause of a class, or -1 if this type reference references the type of the super class.Returns the index of the "super type" of a class that is referenced by this type reference. |
public int | Returns: the index of an exception in the 'throws' clause of a method.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. |
public int | Returns: a type parameter index.Returns the index of the type argument referenced by this type reference. |
public int | Returns: a type parameter bound index.Returns the index of the type parameter bound, within the type parameter |
public int | Returns: a type parameter index.Returns the index of the type parameter referenced by this type reference. |
public int | Returns: the int encoded value of this type reference.Returns the int encoded value of this type reference, suitable for use in visit methods related to type annotations, like visitTypeAnnotation. |
public static TypeReference | Returns: a reference to the type of the given exception.the index of an exception in a 'throws' clause of a method. exceptionIndex)Returns a reference to the type of an exception, in a 'throws' clause of a method. |
public static TypeReference | Returns: a reference to the type of the given method formal parameter.the formal parameter index. paramIndex)Returns a reference to the type of a formal parameter of a method. |
public static TypeReference | Returns: a reference to the given super type of a class.the index of an interface in the 'implements' clause of a class, or -1 to
reference the super class of the class. itfIndex)Returns a reference to the super class or to an interface of the 'implements' clause of a class. |
public static TypeReference | Returns: a reference to the type of the given exception.the index of a try catch block (using the order in which they are
visited with visitTryCatchBlock). tryCatchBlockIndex)Returns a reference to the type of the exception declared in a 'catch' clause of a method. |
public static TypeReference | Returns: a reference to the type of the given type argument.the type argument index. argIndex)Returns a reference to the type of a type argument in a constructor or method call or reference. |
public static TypeReference | Returns: a reference to the given generic class or method type parameter bound.one of sort, final int CLASS_TYPE_PARAMETER or METHOD_TYPE_PARAMETER .the type parameter index. paramIndex, final int the type bound index within the above type parameters. boundIndex)Returns a reference to a type parameter bound of a generic class or method. |
public static TypeReference | Returns: a reference to the given generic class or method type parameter.one of sort, final int CLASS_TYPE_PARAMETER or METHOD_TYPE_PARAMETER .the type parameter index. paramIndex)Returns a reference to a type parameter of a generic class or method. |
public static TypeReference | Returns: a type reference of the given sort.Returns a type reference of the given sort. |
pack-priv static void | putTarget(final int
a target_type and a target_info structures encoded as in targetTypeAndInfo, final ByteVector targetTypeAndInfo . LOCAL_VARIABLE and RESOURCE_VARIABLE target types are not supported.where the type reference must be put. output)Puts the given target_type and target_info JVMS structures into the given ByteVector. |
CAST | back to summary |
---|---|
public static final int CAST The sort of type references that target the type declared in an explicit or implicit cast
instruction. See |
CLASS_EXTENDS | back to summary |
---|---|
public static final int CLASS_EXTENDS The sort of type references that target the super class of a class or one of the interfaces it
implements. See |
CLASS_TYPE_PARAMETER | back to summary |
---|---|
public static final int CLASS_TYPE_PARAMETER The sort of type references that target a type parameter of a generic class. See |
CLASS_TYPE_PARAMETER_BOUND | back to summary |
---|---|
public static final int CLASS_TYPE_PARAMETER_BOUND The sort of type references that target a bound of a type parameter of a generic class. See
|
CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT | back to summary |
---|---|
public static final int CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT The sort of type references that target a type parameter of a generic constructor in a
constructor call. See |
CONSTRUCTOR_REFERENCE | back to summary |
---|---|
public static final int CONSTRUCTOR_REFERENCE The sort of type references that target the receiver type of a constructor reference. See
|
CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT | back to summary |
---|---|
public static final int CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT The sort of type references that target a type parameter of a generic constructor in a
constructor reference. See |
EXCEPTION_PARAMETER | back to summary |
---|---|
public static final int EXCEPTION_PARAMETER The sort of type references that target the type of the exception of a 'catch' clause in a
method. See |
FIELD | back to summary |
---|---|
public static final int FIELD The sort of type references that target the type of a field. See |
INSTANCEOF | back to summary |
---|---|
public static final int INSTANCEOF The sort of type references that target the type declared in an 'instanceof' instruction. See
|
LOCAL_VARIABLE | back to summary |
---|---|
public static final int LOCAL_VARIABLE The sort of type references that target the type of a local variable in a method. See |
METHOD_FORMAL_PARAMETER | back to summary |
---|---|
public static final int METHOD_FORMAL_PARAMETER The sort of type references that target the type of a formal parameter of a method. See |
METHOD_INVOCATION_TYPE_ARGUMENT | back to summary |
---|---|
public static final int METHOD_INVOCATION_TYPE_ARGUMENT The sort of type references that target a type parameter of a generic method in a method call.
See |
METHOD_RECEIVER | back to summary |
---|---|
public static final int METHOD_RECEIVER The sort of type references that target the receiver type of a method. See |
METHOD_REFERENCE | back to summary |
---|---|
public static final int METHOD_REFERENCE The sort of type references that target the receiver type of a method reference. See |
METHOD_REFERENCE_TYPE_ARGUMENT | back to summary |
---|---|
public static final int METHOD_REFERENCE_TYPE_ARGUMENT The sort of type references that target a type parameter of a generic method in a method
reference. See |
METHOD_RETURN | back to summary |
---|---|
public static final int METHOD_RETURN The sort of type references that target the return type of a method. See |
METHOD_TYPE_PARAMETER | back to summary |
---|---|
public static final int METHOD_TYPE_PARAMETER The sort of type references that target a type parameter of a generic method. See |
METHOD_TYPE_PARAMETER_BOUND | back to summary |
---|---|
public static final int METHOD_TYPE_PARAMETER_BOUND The sort of type references that target a bound of a type parameter of a generic method. See
|
NEW | back to summary |
---|---|
public static final int NEW The sort of type references that target the type of the object created by a 'new' instruction.
See |
RESOURCE_VARIABLE | back to summary |
---|---|
public static final int RESOURCE_VARIABLE The sort of type references that target the type of a resource variable in a method. See |
targetTypeAndInfo | back to summary |
---|---|
private final int targetTypeAndInfo The target_type and target_info structures - as defined in the Java Virtual Machine
Specification (JVMS) - corresponding to this type reference. target_type uses one byte, and all
the target_info union fields use up to 3 bytes (except localvar_target, handled with the
specific method This int field stores target_type (called the TypeReference 'sort' in the public API of this class) in its most significant byte, followed by the target_info fields. Depending on target_type, 1, 2 or even 3 least significant bytes of this field are unused. target_info fields which reference bytecode offsets are set to 0 (these offsets are ignored in ClassReader, and recomputed in MethodWriter).
|
THROWS | back to summary |
---|---|
public static final int THROWS The sort of type references that target the type of an exception declared in the throws clause
of a method. See |
TypeReference | back to summary |
---|---|
public TypeReference(final int typeRef) Constructs a new TypeReference.
|
getExceptionIndex | back to summary |
---|---|
public int getExceptionIndex() 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
|
getFormalParameterIndex | back to summary |
---|---|
public int getFormalParameterIndex() 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
|
getSort | back to summary |
---|---|
public int getSort() Returns the sort of this type reference.
|
getSuperTypeIndex | back to summary |
---|---|
public int getSuperTypeIndex() 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
|
getTryCatchBlockIndex | back to summary |
---|---|
public int getTryCatchBlockIndex() 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
|
getTypeArgumentIndex | back to summary |
---|---|
public int getTypeArgumentIndex() Returns the index of the type argument referenced by this type reference. This method must only
be used for type references whose sort is
|
getTypeParameterBoundIndex | back to summary |
---|---|
public int getTypeParameterBoundIndex() Returns the index of the type parameter bound, within the type parameter
|
getTypeParameterIndex | back to summary |
---|---|
public int getTypeParameterIndex() Returns the index of the type parameter referenced by this type reference. This method must
only be used for type references whose sort is
|
getValue | back to summary |
---|---|
public int getValue() Returns the int encoded value of this type reference, suitable for use in visit methods related to type annotations, like visitTypeAnnotation.
|
newExceptionReference | back to summary |
---|---|
public static TypeReference newExceptionReference(final int exceptionIndex) Returns a reference to the type of an exception, in a 'throws' clause of a method.
|
newFormalParameterReference | back to summary |
---|---|
public static TypeReference newFormalParameterReference(final int paramIndex) Returns a reference to the type of a formal parameter of a method.
|
newSuperTypeReference | back to summary |
---|---|
public static TypeReference newSuperTypeReference(final int itfIndex) Returns a reference to the super class or to an interface of the 'implements' clause of a class.
|
newTryCatchReference | back to summary |
---|---|
public static TypeReference newTryCatchReference(final int tryCatchBlockIndex) Returns a reference to the type of the exception declared in a 'catch' clause of a method.
|
newTypeArgumentReference | back to summary |
---|---|
public static TypeReference newTypeArgumentReference(final int sort, final int argIndex) Returns a reference to the type of a type argument in a constructor or method call or reference.
|
newTypeParameterBoundReference | back to summary |
---|---|
public static TypeReference newTypeParameterBoundReference(final int sort, final int paramIndex, final int boundIndex) Returns a reference to a type parameter bound of a generic class or method.
|
newTypeParameterReference | back to summary |
---|---|
public static TypeReference newTypeParameterReference(final int sort, final int paramIndex) Returns a reference to a type parameter of a generic class or method.
|
newTypeReference | back to summary |
---|---|
public static TypeReference newTypeReference(final int sort) Returns a type reference of the given sort.
|
putTarget | back to summary |
---|---|
pack-priv static void putTarget(final int targetTypeAndInfo, final ByteVector output) Puts the given target_type and target_info JVMS structures into the given ByteVector.
|