public class EmptyTypeTarget extends TypeTarget
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.TypeTarget.UsageAnnotationTarget.Kind| Modifier and Type | Method and Description |
|---|---|
EmptyTypeTarget |
asEmpty() |
boolean |
isReceiver()
Returns whether the annotated type occurs within a method receiver (the
this reference
the method receives). |
TypeTarget.Usage |
usage()
Returns the kind of usage of this type target.
|
annotation, annotations, annotations, annotationsWithRepeatable, asClass, asClassExtends, asField, asMethod, asMethodParameter, asMethodParameterType, asRecordComponent, asThrows, asType, asTypeParameter, asTypeParameterBound, declaredAnnotation, declaredAnnotations, declaredAnnotationsWithRepeatable, enclosingTarget, hasAnnotation, hasDeclaredAnnotation, kind, targetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitannotation, annotation, annotations, annotations, annotationsWithRepeatable, annotationsWithRepeatable, declaredAnnotation, declaredAnnotation, declaredAnnotationsWithRepeatable, declaredAnnotationsWithRepeatable, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotationpublic boolean isReceiver()
this reference
the method receives). It will return false if the type occurs in a method return type
or in a field type.true if the annotated type occurs within a method receiver type, otherwise falsepublic final TypeTarget.Usage usage()
TypeTargetgetClass() comparisons.usage in class TypeTargetpublic EmptyTypeTarget asEmpty()
asEmpty in class TypeTargetCopyright © 2018–2022. All rights reserved.