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