public class MethodParameterTypeTarget extends PositionBasedTypeTarget
Consider the following example involving a type target using the "Bar" annotation:
public void foo(List<@Bar T> { ... }
This example would be represented as a MethodParameterTypeTarget with an enclosing target
of foo's MethodInfo, and position() would return 0. The "Bar" annotation
would appear on the type variable T.
TypeTarget.UsageAnnotationTarget.Kind| Constructor and Description |
|---|
MethodParameterTypeTarget(AnnotationTarget enclosingTarget,
Type target,
int position) |
MethodParameterTypeTarget(MethodInfo enclosingTarget,
int position) |
| Modifier and Type | Method and Description |
|---|---|
MethodParameterTypeTarget |
asMethodParameterType()
Casts and returns this type target as a
MethodParameterTypeTarget. |
MethodInfo |
enclosingTarget()
Returns the enclosing target that contains the type referred to by the
TypeTarget.target() method. |
TypeTarget.Usage |
usage()
Returns the kind of usage of this type target.
|
positionasClass, asClassExtends, asEmpty, asField, asMethod, asMethodParameter, asThrows, asType, asTypeParameter, asTypeParameterBound, kind, setTarget, targetMethodParameterTypeTarget(MethodInfo enclosingTarget, int position)
MethodParameterTypeTarget(AnnotationTarget enclosingTarget, Type target, int position)
public final TypeTarget.Usage usage()
TypeTargetgetClass() comparisons.usage in class TypeTargetpublic MethodInfo enclosingTarget()
TypeTargetTypeTarget.target() method.enclosingTarget in class TypeTargetpublic MethodParameterTypeTarget asMethodParameterType()
TypeTargetMethodParameterTypeTarget. If this type target
is not a MethodParameterTypeTarget, then an exception will be thrown.asMethodParameterType in class TypeTargetMethodParameterTypeTarget