Top Description Constructors Methods
org.jboss.jandex

public Class MethodParameterTypeTarget

extends PositionBasedTypeTarget
Class Inheritance

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 Bar annotation:

public void foo(List<@Bar T> l) { ... }

This example would be represented as a MethodParameterTypeTarget 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
MethodParameterTypeTarget(MethodInfo enclosingTarget, int position)

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

Method Summary

Modifier and TypeMethod and Description
public MethodParameterTypeTarget
asMethodParameterType()

Overrides org.jboss.jandex.TypeTarget.asMethodParameterType.

Casts and returns this type target as a MethodParameterTypeTarget.
public MethodInfo
enclosingTarget()

Overrides org.jboss.jandex.TypeTarget.enclosingTarget.

Returns the enclosing target that contains the type referred to by the target() method.
public final 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

MethodParameterTypeTargetback to summary
pack-priv MethodParameterTypeTarget(MethodInfo enclosingTarget, int position)
MethodParameterTypeTargetback to summary
pack-priv MethodParameterTypeTarget(AnnotationTarget enclosingTarget, Type target, int position)

Method Detail

asMethodParameterTypeback to summary
public MethodParameterTypeTarget asMethodParameterType()

Overrides org.jboss.jandex.TypeTarget.asMethodParameterType.

Doc from org.jboss.jandex.TypeTarget.asMethodParameterType.

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

Returns:MethodParameterTypeTarget

an instance of MethodParameterTypeTarget

Annotations
@Override
enclosingTargetback to summary
public MethodInfo enclosingTarget()

Overrides org.jboss.jandex.TypeTarget.enclosingTarget.

Doc from org.jboss.jandex.TypeTarget.enclosingTarget.

Returns the enclosing target that contains the type referred to by the target() method.

Returns:MethodInfo

the enclosing target

Annotations
@Override
usageback to summary
public final 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