Package org.jboss.jandex
Class ClassExtendsTypeTarget
java.lang.Object
org.jboss.jandex.TypeTarget
org.jboss.jandex.PositionBasedTypeTarget
org.jboss.jandex.ClassExtendsTypeTarget
- All Implemented Interfaces:
AnnotationTarget
Represents a target of type annotation which occurs in the
extends or implements clause
of an enclosing class. This class conveys the enclosing class definition, as well as a position to indicate
the interface or superclass this target applies to. Since type targets can appear at any depth of the type tree
at this location, the corresponding type reference is also included.
The special position 65535 is used to indicate the type usage is on the super type in the extends clause.
All other numbers denote the zero-based offset in the interface list of the implements clause.
Consider the following example involving a type target using the Bar annotation:
class Foo<T> implements List<@Bar T> {
}
This example would be represented as a ClassExtendsTypeTarget with an enclosing target
of the ClassInfo of Foo, and position() would be 0.- Author:
- Jason T. Greene
- Since:
- 2.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jboss.jandex.TypeTarget
TypeTarget.UsageNested classes/interfaces inherited from interface org.jboss.jandex.AnnotationTarget
AnnotationTarget.Kind -
Constructor Summary
ConstructorsConstructorDescriptionClassExtendsTypeTarget(AnnotationTarget enclosingTarget, Type target, int position) -
Method Summary
Modifier and TypeMethodDescriptionCasts and returns this type target as aClassExtendsTypeTarget.Returns the enclosing target that contains the type referred to by theTypeTarget.target()method.final TypeTarget.Usageusage()Returns the kind of usage of this type target.Methods inherited from class org.jboss.jandex.PositionBasedTypeTarget
positionMethods inherited from class org.jboss.jandex.TypeTarget
annotation, annotations, annotations, annotationsWithRepeatable, asClass, asEmpty, asField, asMethod, asMethodParameter, asMethodParameterType, asRecordComponent, asThrows, asType, asTypeParameter, asTypeParameterBound, declaredAnnotation, declaredAnnotations, declaredAnnotationsWithRepeatable, hasAnnotation, hasDeclaredAnnotation, kind, targetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jboss.jandex.AnnotationTarget
annotation, annotation, annotations, annotations, annotationsWithRepeatable, annotationsWithRepeatable, declaredAnnotation, declaredAnnotation, declaredAnnotationsWithRepeatable, declaredAnnotationsWithRepeatable, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation
-
Constructor Details
-
ClassExtendsTypeTarget
-
-
Method Details
-
usage
Description copied from class:TypeTargetReturns the kind of usage of this type target. This allows a caller to use a switch statement as opposed togetClass()comparisons.- Specified by:
usagein classTypeTarget- Returns:
- the kind of usage of this type target
-
enclosingTarget
Description copied from class:TypeTargetReturns the enclosing target that contains the type referred to by theTypeTarget.target()method.- Overrides:
enclosingTargetin classTypeTarget- Returns:
- the enclosing target
-
asClassExtends
Description copied from class:TypeTargetCasts and returns this type target as aClassExtendsTypeTarget. If this type target is not aClassExtendsTypeTarget, then an exception will be thrown.- Overrides:
asClassExtendsin classTypeTarget- Returns:
- an instance of
ClassExtendsTypeTarget
-