public class ThrowsTypeTarget extends PositionBasedTypeTarget
Consider the following example involving a type target using the "Bar" annotation:
public void foo(List<T>) throws FooException<@Bar T> { ... }
This example would be represented as a ThrowsTypeTarget
with an enclosing target
of foo's MethodInfo
, and position()
would return 0, indicating the first
entry of the list returned by exceptions()
. The "Bar" annotation would appear on the
type variable T.
TypeTarget.Usage
AnnotationTarget.Kind
Modifier and Type | Method and Description |
---|---|
ThrowsTypeTarget |
asThrows()
Casts and returns this type target as a
ThrowsTypeTarget . |
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.
|
position
asClass, asClassExtends, asEmpty, asField, asMethod, asMethodParameter, asMethodParameterType, asType, asTypeParameter, asTypeParameterBound, kind, target
public TypeTarget.Usage usage()
TypeTarget
getClass()
comparisons.usage
in class TypeTarget
public MethodInfo enclosingTarget()
TypeTarget
TypeTarget.target()
method.enclosingTarget
in class TypeTarget
public ThrowsTypeTarget asThrows()
TypeTarget
ThrowsTypeTarget
. If this type target
is not a ThrowsTypeTarget
, then an exception will be thrown.asThrows
in class TypeTarget
ThrowsTypeTarget
Copyright © 2018 JBoss by Red Hat. All rights reserved.