Interface TypeAnnotation.TargetInfo
- All Known Subinterfaces:
- TypeAnnotation.CatchTarget,- TypeAnnotation.EmptyTarget,- TypeAnnotation.FormalParameterTarget,- TypeAnnotation.LocalVarTarget,- TypeAnnotation.OffsetTarget,- TypeAnnotation.SupertypeTarget,- TypeAnnotation.ThrowsTarget,- TypeAnnotation.TypeArgumentTarget,- TypeAnnotation.TypeParameterBoundTarget,- TypeAnnotation.TypeParameterTarget
- Enclosing interface:
- TypeAnnotation
public static sealed interface TypeAnnotation.TargetInfo
permits TypeAnnotation.TypeParameterTarget, TypeAnnotation.SupertypeTarget, TypeAnnotation.TypeParameterBoundTarget, TypeAnnotation.EmptyTarget, TypeAnnotation.FormalParameterTarget, TypeAnnotation.ThrowsTarget, TypeAnnotation.LocalVarTarget, TypeAnnotation.CatchTarget, TypeAnnotation.OffsetTarget, TypeAnnotation.TypeArgumentTarget
Specifies which type in a declaration or expression is being annotated.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int
- 
Method SummaryModifier and TypeMethodDescriptionstatic TypeAnnotation.EmptyTargetof(TypeAnnotation.TargetType targetType) Returns a target for annotations.ofCastExpr(Label target, int typeArgumentIndex) Returns a target for annotations on the i'th type in a cast expression.ofClassExtends(int supertypeIndex) Returns a target for annotations on the type of an "extends" or "implements" clause.ofClassTypeParameter(int typeParameterIndex) Returns a target for annotations on a class type parameter declaration.ofClassTypeParameterBound(int typeParameterIndex, int boundIndex) Returns a target for annotations on the i'th bound of the j'th type parameter declaration of a generic class, or interface.ofConstructorInvocationTypeArgument(Label target, int typeArgumentIndex) Returns a target for annotations on the i'th type argument in the explicit type argument list for an explicit constructor invocation statement.static TypeAnnotation.OffsetTargetofConstructorReference(Label target) Returns a target for annotations on the type before the :: in a constructor reference expression.ofConstructorReferenceTypeArgument(Label target, int typeArgumentIndex) Returns a target for annotations on the i'th type argument in the explicit type argument list for a new expression.static TypeAnnotation.CatchTargetofExceptionParameter(int exceptionTableIndex) Returns a target for annotations on the i'th type in an exception parameter declaration.static TypeAnnotation.EmptyTargetofField()Returns a target for annotations on the type in a field or record declaration.static TypeAnnotation.OffsetTargetofInstanceofExpr(Label target) Returns a target for annotations on the type in an instanceof expression.Returns a target for annotations on the type in a local variable declaration.ofMethodFormalParameter(int formalParameterIndex) Returns a target for annotations on the type in a formal parameter declaration of a method, constructor, or lambda expression.ofMethodInvocationTypeArgument(Label target, int typeArgumentIndex) Returns a target for annotations on the i'th type argument in the explicit type argument list for a method invocation expression.static TypeAnnotation.EmptyTargetReturns a target for annotations on the receiver type of a method or constructor.static TypeAnnotation.OffsetTargetofMethodReference(Label target) Returns a target for annotations on the type before the :: in a method reference expression.ofMethodReferenceTypeArgument(Label target, int typeArgumentIndex) Returns a target for annotations on the i'th type argument in the explicit type argument list for a method reference expression.static TypeAnnotation.EmptyTargetReturns a target for annotations on the return type of a method or a newly constructed object.ofMethodTypeParameter(int typeParameterIndex) Returns a target for annotations on a method type parameter declaration.ofMethodTypeParameterBound(int typeParameterIndex, int boundIndex) Returns a target for annotations on the i'th bound of the j'th type parameter declaration of a generic method, or constructor.static TypeAnnotation.OffsetTargetReturns a target for annotations on the type in a new expression.static TypeAnnotation.OffsetTargetofOffset(TypeAnnotation.TargetType targetType, Label target) Returns a target for annotations on the type in an instanceof expression or a new expression, or the type before the :: in a method reference expression.Returns a target for annotations on the type in a local variable declared as a resource in a try-with-resources statement.static TypeAnnotation.ThrowsTargetofThrows(int throwsTargetIndex) Returns a target for annotations on the i'th type in the throws clause of a method or constructor declaration.ofTypeArgument(TypeAnnotation.TargetType targetType, Label target, int typeArgumentIndex) Returns a target for annotations on the i'th type in a cast expression, or on the i'th type argument in the explicit type argument list for any of the following: a new expression, an explicit constructor invocation statement, a method invocation expression, or a method reference expression.ofTypeParameter(TypeAnnotation.TargetType targetType, int typeParameterIndex) Returns a target for annotations on a class or method type parameter declaration.ofTypeParameterBound(TypeAnnotation.TargetType targetType, int typeParameterIndex, int boundIndex) Returns a target for annotations on the i'th bound of the j'th type parameter declaration of a generic class, interface, method, or constructor.ofVariable(TypeAnnotation.TargetType targetType, List<TypeAnnotation.LocalVarTargetInfo> table) Returns a target for annotations on the type in a local variable declaration, including a variable declared as a resource in a try-with-resources statement.default intsize()Returns the size of the target info.Returns the type of the target.
- 
Field Details- 
TARGET_CLASS_TYPE_PARAMETERstatic final int TARGET_CLASS_TYPE_PARAMETER- See Also:
 
- 
TARGET_METHOD_TYPE_PARAMETERstatic final int TARGET_METHOD_TYPE_PARAMETER- See Also:
 
- 
TARGET_CLASS_EXTENDSstatic final int TARGET_CLASS_EXTENDS- See Also:
 
- 
TARGET_CLASS_TYPE_PARAMETER_BOUNDstatic final int TARGET_CLASS_TYPE_PARAMETER_BOUND- See Also:
 
- 
TARGET_METHOD_TYPE_PARAMETER_BOUNDstatic final int TARGET_METHOD_TYPE_PARAMETER_BOUND- See Also:
 
- 
TARGET_FIELD
- 
TARGET_METHOD_RETURNstatic final int TARGET_METHOD_RETURN- See Also:
 
- 
TARGET_METHOD_RECEIVERstatic final int TARGET_METHOD_RECEIVER- See Also:
 
- 
TARGET_METHOD_FORMAL_PARAMETERstatic final int TARGET_METHOD_FORMAL_PARAMETER- See Also:
 
- 
TARGET_THROWS
- 
TARGET_LOCAL_VARIABLEstatic final int TARGET_LOCAL_VARIABLE- See Also:
 
- 
TARGET_RESOURCE_VARIABLEstatic final int TARGET_RESOURCE_VARIABLE- See Also:
 
- 
TARGET_EXCEPTION_PARAMETERstatic final int TARGET_EXCEPTION_PARAMETER- See Also:
 
- 
TARGET_INSTANCEOF
- 
TARGET_NEW
- 
TARGET_CONSTRUCTOR_REFERENCEstatic final int TARGET_CONSTRUCTOR_REFERENCE- See Also:
 
- 
TARGET_METHOD_REFERENCEstatic final int TARGET_METHOD_REFERENCE- See Also:
 
- 
TARGET_CAST
- 
TARGET_CONSTRUCTOR_INVOCATION_TYPE_ARGUMENTstatic final int TARGET_CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT- See Also:
 
- 
TARGET_METHOD_INVOCATION_TYPE_ARGUMENTstatic final int TARGET_METHOD_INVOCATION_TYPE_ARGUMENT- See Also:
 
- 
TARGET_CONSTRUCTOR_REFERENCE_TYPE_ARGUMENTstatic final int TARGET_CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT- See Also:
 
- 
TARGET_METHOD_REFERENCE_TYPE_ARGUMENTstatic final int TARGET_METHOD_REFERENCE_TYPE_ARGUMENT- See Also:
 
 
- 
- 
Method Details- 
targetTypeTypeAnnotation.TargetType targetType()Returns the type of the target.- Returns:
- the type of the target
 
- 
sizedefault int size()Returns the size of the target info.- Returns:
- the size of the target info
 
- 
ofTypeParameterstatic TypeAnnotation.TypeParameterTarget ofTypeParameter(TypeAnnotation.TargetType targetType, int typeParameterIndex) Returns a target for annotations on a class or method type parameter declaration.- Parameters:
- targetType-- TypeAnnotation.TargetType.CLASS_TYPE_PARAMETERor- TypeAnnotation.TargetType.METHOD_TYPE_PARAMETER
- typeParameterIndex- specifies which type parameter declaration is annotated
- Returns:
- a target for annotations on a class or method type parameter declaration
 
- 
ofClassTypeParameterReturns a target for annotations on a class type parameter declaration.- Parameters:
- typeParameterIndex- specifies which type parameter declaration is annotated
- Returns:
- a target for annotations on a class type parameter declaration
 
- 
ofMethodTypeParameterReturns a target for annotations on a method type parameter declaration.- Parameters:
- typeParameterIndex- specifies which type parameter declaration is annotated
- Returns:
- a target for annotations on a method type parameter declaration
 
- 
ofClassExtendsReturns a target for annotations on the type of an "extends" or "implements" clause.- Parameters:
- supertypeIndex- the index into the interfaces array or 65535 to indicate it is the superclass
- Returns:
- a target for annotations on the type of an "extends" or "implements" clause
 
- 
ofTypeParameterBoundstatic TypeAnnotation.TypeParameterBoundTarget ofTypeParameterBound(TypeAnnotation.TargetType targetType, int typeParameterIndex, int boundIndex) Returns a target for annotations on the i'th bound of the j'th type parameter declaration of a generic class, interface, method, or constructor.- Parameters:
- targetType-- TypeAnnotation.TargetType.CLASS_TYPE_PARAMETER_BOUNDor- TypeAnnotation.TargetType.METHOD_TYPE_PARAMETER_BOUND
- typeParameterIndex- specifies which type parameter declaration is annotated
- boundIndex- specifies which bound of the type parameter declaration is annotated
- Returns:
- a target for annotations on the i'th bound of the j'th type parameter declaration of a generic class, interface, method, or constructor
 
- 
ofClassTypeParameterBoundstatic TypeAnnotation.TypeParameterBoundTarget ofClassTypeParameterBound(int typeParameterIndex, int boundIndex) Returns a target for annotations on the i'th bound of the j'th type parameter declaration of a generic class, or interface.- Parameters:
- typeParameterIndex- specifies which type parameter declaration is annotated
- boundIndex- specifies which bound of the type parameter declaration is annotated
- Returns:
- a target for annotations on the i'th bound of the j'th type parameter declaration of a generic class, or interface
 
- 
ofMethodTypeParameterBoundstatic TypeAnnotation.TypeParameterBoundTarget ofMethodTypeParameterBound(int typeParameterIndex, int boundIndex) Returns a target for annotations on the i'th bound of the j'th type parameter declaration of a generic method, or constructor.- Parameters:
- typeParameterIndex- specifies which type parameter declaration is annotated
- boundIndex- specifies which bound of the type parameter declaration is annotated
- Returns:
- a target for annotations on the i'th bound of the j'th type parameter declaration of a generic method, or constructor
 
- 
ofReturns a target for annotations.- Parameters:
- targetType-- TypeAnnotation.TargetType.FIELD,- TypeAnnotation.TargetType.METHOD_RETURNor- TypeAnnotation.TargetType.METHOD_RECEIVER
- Returns:
- a target for annotations
 
- 
ofFieldReturns a target for annotations on the type in a field or record declaration.- Returns:
- a target for annotations on the type in a field or record declaration
 
- 
ofMethodReturnReturns a target for annotations on the return type of a method or a newly constructed object.- Returns:
- a target for annotations on the return type of a method or a newly constructed object
 
- 
ofMethodReceiverReturns a target for annotations on the receiver type of a method or constructor.- Returns:
- a target for annotations on the receiver type of a method or constructor
 
- 
ofMethodFormalParameterReturns a target for annotations on the type in a formal parameter declaration of a method, constructor, or lambda expression. The index may differ from the index in the method descriptor because some synthetic or implicit parameters are omitted.- Parameters:
- formalParameterIndex- specifies which formal parameter declaration has an annotated type
- Returns:
- a target for annotations on the type in a formal parameter declaration of a method, constructor, or lambda expression
 
- 
ofThrowsReturns a target for annotations on the i'th type in the throws clause of a method or constructor declaration.- Parameters:
- throwsTargetIndex- the index into the exception table of the Exceptions attribute of the method
- Returns:
- a target for annotations on the i'th type in the throws clause of a method or constructor declaration
 
- 
ofVariablestatic TypeAnnotation.LocalVarTarget ofVariable(TypeAnnotation.TargetType targetType, List<TypeAnnotation.LocalVarTargetInfo> table) Returns a target for annotations on the type in a local variable declaration, including a variable declared as a resource in a try-with-resources statement.- Parameters:
- targetType-- TypeAnnotation.TargetType.LOCAL_VARIABLEor- TypeAnnotation.TargetType.RESOURCE_VARIABLE
- table- the list of local variable targets
- Returns:
- a target for annotations on the type in a local variable declaration, including a variable declared as a resource in a try-with-resources statement
 
- 
ofLocalVariableReturns a target for annotations on the type in a local variable declaration.- Parameters:
- table- the list of local variable targets
- Returns:
- a target for annotations on the type in a local variable declaration
 
- 
ofResourceVariablestatic TypeAnnotation.LocalVarTarget ofResourceVariable(List<TypeAnnotation.LocalVarTargetInfo> table) Returns a target for annotations on the type in a local variable declared as a resource in a try-with-resources statement.- Parameters:
- table- the list of local variable targets
- Returns:
- a target for annotations on the type in a local variable declared as a resource in a try-with-resources statement
 
- 
ofExceptionParameterReturns a target for annotations on the i'th type in an exception parameter declaration.- Parameters:
- exceptionTableIndex- the index into the exception table of the Code attribute
- Returns:
- a target for annotations on the i'th type in an exception parameter declaration
 
- 
ofOffsetReturns a target for annotations on the type in an instanceof expression or a new expression, or the type before the :: in a method reference expression.- Parameters:
- targetType-- TypeAnnotation.TargetType.INSTANCEOF,- TypeAnnotation.TargetType.NEW,- TypeAnnotation.TargetType.CONSTRUCTOR_REFERENCE, or- TypeAnnotation.TargetType.METHOD_REFERENCE
- target- the label right before the instruction
- Returns:
- a target for annotations on the type in an instanceof expression or a new expression, or the type before the :: in a method reference expression
 
- 
ofInstanceofExprReturns a target for annotations on the type in an instanceof expression.- Parameters:
- target- the label right before the instruction
- Returns:
- a target for annotations on the type in an instanceof expression
 
- 
ofNewExprReturns a target for annotations on the type in a new expression.- Parameters:
- target- the label right before the instruction
- Returns:
- a target for annotations on the type in a new expression
 
- 
ofConstructorReferenceReturns a target for annotations on the type before the :: in a constructor reference expression.- Parameters:
- target- the label right before the instruction
- Returns:
- a target for annotations on the type before the :: in a constructor reference expression
 
- 
ofMethodReferenceReturns a target for annotations on the type before the :: in a method reference expression.- Parameters:
- target- the label right before the instruction
- Returns:
- a target for annotations on the type before the :: in a method reference expression
 
- 
ofTypeArgumentstatic TypeAnnotation.TypeArgumentTarget ofTypeArgument(TypeAnnotation.TargetType targetType, Label target, int typeArgumentIndex) Returns a target for annotations on the i'th type in a cast expression, or on the i'th type argument in the explicit type argument list for any of the following: a new expression, an explicit constructor invocation statement, a method invocation expression, or a method reference expression.- Parameters:
- targetType-- TypeAnnotation.TargetType.CAST,- TypeAnnotation.TargetType.CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT,- TypeAnnotation.TargetType.METHOD_INVOCATION_TYPE_ARGUMENT,- TypeAnnotation.TargetType.CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT, or- TypeAnnotation.TargetType.METHOD_REFERENCE_TYPE_ARGUMENT
- target- the label right before the instruction
- typeArgumentIndex- specifies which type in the cast operator or argument is annotated
- Returns:
- a target for annotations on the i'th type in a cast expression, or on the i'th type argument in the explicit type argument list for any of the following: a new expression, an explicit constructor invocation statement, a method invocation expression, or a method reference expression
 
- 
ofCastExprReturns a target for annotations on the i'th type in a cast expression.- Parameters:
- target- the label right before the instruction
- typeArgumentIndex- specifies which type in the cast operator is annotated
- Returns:
- a target for annotations on the i'th type in a cast expression
 
- 
ofConstructorInvocationTypeArgumentstatic TypeAnnotation.TypeArgumentTarget ofConstructorInvocationTypeArgument(Label target, int typeArgumentIndex) Returns a target for annotations on the i'th type argument in the explicit type argument list for an explicit constructor invocation statement.- Parameters:
- target- the label right before the instruction
- typeArgumentIndex- specifies which type in the argument is annotated
- Returns:
- a target for annotations on the i'th type argument in the explicit type argument list for an explicit constructor invocation statement
 
- 
ofMethodInvocationTypeArgumentstatic TypeAnnotation.TypeArgumentTarget ofMethodInvocationTypeArgument(Label target, int typeArgumentIndex) Returns a target for annotations on the i'th type argument in the explicit type argument list for a method invocation expression.- Parameters:
- target- the label right before the instruction
- typeArgumentIndex- specifies which type in the argument is annotated
- Returns:
- a target for annotations on the i'th type argument in the explicit type argument list for a method invocation expression
 
- 
ofConstructorReferenceTypeArgumentstatic TypeAnnotation.TypeArgumentTarget ofConstructorReferenceTypeArgument(Label target, int typeArgumentIndex) Returns a target for annotations on the i'th type argument in the explicit type argument list for a new expression.- Parameters:
- target- the label right before the instruction
- typeArgumentIndex- specifies which type in the argument is annotated
- Returns:
- a target for annotations on the i'th type argument in the explicit type argument list for a new expression
 
- 
ofMethodReferenceTypeArgumentstatic TypeAnnotation.TypeArgumentTarget ofMethodReferenceTypeArgument(Label target, int typeArgumentIndex) Returns a target for annotations on the i'th type argument in the explicit type argument list for a method reference expression.- Parameters:
- target- the label right before the instruction
- typeArgumentIndex- specifies which type in the argument is annotated
- Returns:
- a target for annotations on the i'th type argument in the explicit type argument list for a method reference expression
 
 
-