Top Description Fields Constructors Methods
org.jboss.jandex

public Class EmptyTypeTarget

extends TypeTarget
Class Inheritance

Represents a target of type annotation which occurs directly on a field type, a method return type, or a method receiver type. This class conveys the enclosing field or method, and if a method, also differentiates between the receiver and return value. 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 List<@Bar T> foo() { ... }
This example would be represented as an EmptyTypeTarget with an enclosing target of the MethodInfo of foo, and isReceiver() would be false.
Author
Jason T. Greene

Field Summary

Modifier and TypeField and Description
private boolean

Constructor Summary

AccessConstructor and Description
pack-priv
EmptyTypeTarget(AnnotationTarget enclosingTarget, boolean receiver)

pack-priv
EmptyTypeTarget(AnnotationTarget enclosingTarget, Type target, boolean receiver)

Method Summary

Modifier and TypeMethod and Description
public EmptyTypeTarget
public boolean

Returns:

true if the annotated type occurs within a method receiver type, otherwise false
isReceiver
()

Returns whether the annotated type occurs within a method receiver (the this reference the method receives).

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.TypeTarget:
annotationannotationsannotationsannotationsWithRepeatableasClassasClassExtendsasDeclarationasFieldasMethodasMethodParameterasMethodParameterTypeasRecordComponentasThrowsasTypeasTypeParameterasTypeParameterBounddeclaredAnnotationdeclaredAnnotationsdeclaredAnnotationsWithRepeatableenclosingTargethasAnnotationhasDeclaredAnnotationisDeclarationkindsetTargettarget

Field Detail

receiverback to summary
private boolean receiver

Constructor Detail

EmptyTypeTargetback to summary
pack-priv EmptyTypeTarget(AnnotationTarget enclosingTarget, boolean receiver)
EmptyTypeTargetback to summary
pack-priv EmptyTypeTarget(AnnotationTarget enclosingTarget, Type target, boolean receiver)

Method Detail

asEmptyback to summary
public EmptyTypeTarget asEmpty()

Overrides org.jboss.jandex.TypeTarget.asEmpty.

Annotations
@Override
isReceiverback to summary
public boolean isReceiver()

Returns whether the annotated type occurs within a method receiver (the this reference the method receives). It will return false if the type occurs in a method return type or in a field type.

Returns:boolean

true if the annotated type occurs within a method receiver type, otherwise false

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