Package org.jboss.jandex
Class MethodParameterTypeTarget
- java.lang.Object
-
- org.jboss.jandex.TypeTarget
-
- org.jboss.jandex.PositionBasedTypeTarget
-
- org.jboss.jandex.MethodParameterTypeTarget
-
- All Implemented Interfaces:
AnnotationTarget
public class MethodParameterTypeTarget extends PositionBasedTypeTarget
Represents a type annotation target which occurs within a method parameter type. This class conveys the enclosing method and the zero-based position of the parameter. 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
Barannotation:public void foo(List<@Bar T> l) { ... }This example would be represented as a
MethodParameterTypeTargetwith an enclosing target of theMethodInfooffoo, andposition()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
Constructors Constructor Description MethodParameterTypeTarget(AnnotationTarget enclosingTarget, Type target, int position)MethodParameterTypeTarget(MethodInfo enclosingTarget, int position)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MethodParameterTypeTargetasMethodParameterType()Casts and returns this type target as aMethodParameterTypeTarget.MethodInfoenclosingTarget()Returns the enclosing target that contains the type referred to by theTypeTarget.target()method.TypeTarget.Usageusage()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, asRecordComponent, asThrows, asType, asTypeParameter, asTypeParameterBound, declaredAnnotation, declaredAnnotations, declaredAnnotationsWithRepeatable, 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 Detail
-
MethodParameterTypeTarget
MethodParameterTypeTarget(MethodInfo enclosingTarget, int position)
-
MethodParameterTypeTarget
MethodParameterTypeTarget(AnnotationTarget enclosingTarget, Type target, int position)
-
-
Method Detail
-
usage
public final TypeTarget.Usage 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
public MethodInfo 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
-
asMethodParameterType
public MethodParameterTypeTarget asMethodParameterType()
Description copied from class:TypeTargetCasts and returns this type target as aMethodParameterTypeTarget. If this type target is not aMethodParameterTypeTarget, then an exception will be thrown.- Overrides:
asMethodParameterTypein classTypeTarget- Returns:
- an instance of
MethodParameterTypeTarget
-
-