Package org.jboss.jandex
Class TypeParameterTypeTarget
java.lang.Object
org.jboss.jandex.TypeTarget
org.jboss.jandex.PositionBasedTypeTarget
org.jboss.jandex.TypeParameterTypeTarget
- All Implemented Interfaces:
AnnotationTarget
- Direct Known Subclasses:
TypeParameterBoundTypeTarget
Represents a target of type annotation which occurs within a type parameter. This class conveys
the zero-based position of the parameter, and the enclosing method or class where it occurs.
Since type targets can appear at any depth of the type tree at this location, the corresponding
type reference is also included.
Consider the following example involving a type target using the Bar
annotation:
public <@Bar T> void foo(List<T> l) { ... }
This example would be represented as a TypeParameterTypeTarget
with an enclosing target
of the MethodInfo
of foo
, and position()
would be 0.
- Since:
- 2.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jboss.jandex.TypeTarget
TypeTarget.Usage
Nested classes/interfaces inherited from interface org.jboss.jandex.AnnotationTarget
AnnotationTarget.Kind
-
Constructor Summary
ConstructorsConstructorDescriptionTypeParameterTypeTarget
(AnnotationTarget enclosingTarget, int position) TypeParameterTypeTarget
(AnnotationTarget enclosingTarget, Type target, int position) -
Method Summary
Modifier and TypeMethodDescriptionCasts and returns this type target as aTypeParameterTypeTarget
.usage()
Returns the kind of usage of this type target.Methods inherited from class org.jboss.jandex.PositionBasedTypeTarget
position
Methods inherited from class org.jboss.jandex.TypeTarget
annotation, annotations, annotations, annotationsWithRepeatable, asClass, asClassExtends, asDeclaration, asEmpty, asField, asMethod, asMethodParameter, asMethodParameterType, asRecordComponent, asThrows, asType, asTypeParameterBound, declaredAnnotation, declaredAnnotations, declaredAnnotationsWithRepeatable, enclosingTarget, hasAnnotation, hasDeclaredAnnotation, isDeclaration, kind, setTarget, target
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jboss.jandex.AnnotationTarget
annotation, annotation, annotations, annotations, annotationsWithRepeatable, annotationsWithRepeatable, declaredAnnotation, declaredAnnotation, declaredAnnotationsWithRepeatable, declaredAnnotationsWithRepeatable, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation
-
Constructor Details
-
TypeParameterTypeTarget
TypeParameterTypeTarget(AnnotationTarget enclosingTarget, int position) -
TypeParameterTypeTarget
TypeParameterTypeTarget(AnnotationTarget enclosingTarget, Type target, int position)
-
-
Method Details
-
usage
Description copied from class:TypeTarget
Returns the kind of usage of this type target. This allows a caller to use a switch statement as opposed togetClass()
comparisons.- Specified by:
usage
in classTypeTarget
- Returns:
- the kind of usage of this type target
-
asTypeParameter
Description copied from class:TypeTarget
Casts and returns this type target as aTypeParameterTypeTarget
. If this type target is not aTypeParameterTypeTarget
, then an exception will be thrown.- Overrides:
asTypeParameter
in classTypeTarget
- Returns:
- an instance of
TypeParameterTypeTarget
-