Top Description Constructors Methods
org.jboss.jandex

public Class ThrowsTypeTarget

extends PositionBasedTypeTarget
Class Inheritance

Represents a target of type annotation which occurs in the throws clause of an enclosing method. This class conveys the enclosing method and the zero-based position of the throwable type. The corresponding type reference is also included.

Consider the following example involving a type target using the Bar annotation:

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

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

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

Method Summary

Modifier and TypeMethod and Description
public ThrowsTypeTarget
asThrows()

Overrides org.jboss.jandex.TypeTarget.asThrows.

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

Overrides org.jboss.jandex.TypeTarget.enclosingTarget.

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

ThrowsTypeTargetback to summary
pack-priv ThrowsTypeTarget(MethodInfo enclosingTarget, int position)
ThrowsTypeTargetback to summary
pack-priv ThrowsTypeTarget(AnnotationTarget enclosingTarget, Type target, int position)

Method Detail

asThrowsback to summary
public ThrowsTypeTarget asThrows()

Overrides org.jboss.jandex.TypeTarget.asThrows.

Doc from org.jboss.jandex.TypeTarget.asThrows.

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

Returns:ThrowsTypeTarget

an instance of ThrowsTypeTarget

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 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