Top Description Constructors Methods
org.jboss.jandex

public Class TypeParameterTypeTarget

extends PositionBasedTypeTarget
Class Inheritance
Known Direct Subclasses
org.jboss.jandex.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.

Author
Jason T. Greene
Since
2.0

Constructor Summary

AccessConstructor and Description
pack-priv
TypeParameterTypeTarget(AnnotationTarget enclosingTarget, int position)

pack-priv
TypeParameterTypeTarget(AnnotationTarget enclosingTarget, Type target, int position)

Method Summary

Modifier and TypeMethod and Description
public TypeParameterTypeTarget
asTypeParameter()

Overrides org.jboss.jandex.TypeTarget.asTypeParameter.

Casts and returns this type target as a TypeParameterTypeTarget.
public TypeTarget.Usage
usage()

Implements abstract org.jboss.jandex.TypeTarget.usage.

Returns the kind of usage of this type target.
Inherited from org.jboss.jandex.PositionBasedTypeTarget:
position

Constructor Detail

TypeParameterTypeTargetback to summary
pack-priv TypeParameterTypeTarget(AnnotationTarget enclosingTarget, int position)
TypeParameterTypeTargetback to summary
pack-priv TypeParameterTypeTarget(AnnotationTarget enclosingTarget, Type target, int position)

Method Detail

asTypeParameterback to summary
public TypeParameterTypeTarget asTypeParameter()

Overrides org.jboss.jandex.TypeTarget.asTypeParameter.

Doc from org.jboss.jandex.TypeTarget.asTypeParameter.

Casts and returns this type target as a TypeParameterTypeTarget. If this type target is not a TypeParameterTypeTarget, then an exception will be thrown.

Returns:TypeParameterTypeTarget

an instance of TypeParameterTypeTarget

Annotations
@Override
usageback to summary
public TypeTarget.Usage usage()

Implements abstract org.jboss.jandex.TypeTarget.usage.

Doc from org.jboss.jandex.TypeTarget.usage.

Returns the kind of usage of this type target. This allows a caller to use a switch statement as opposed to getClass() comparisons.

Returns:TypeTarget.Usage

the kind of usage of this type target

Annotations
@Override