Interface CanBeAnnotated
- All Known Subinterfaces:
HasAnnotations<SELF>
- All Known Implementing Classes:
AccessTarget
,AccessTarget.CodeUnitAccessTarget
,AccessTarget.CodeUnitCallTarget
,AccessTarget.CodeUnitReferenceTarget
,AccessTarget.ConstructorCallTarget
,AccessTarget.ConstructorReferenceTarget
,AccessTarget.FieldAccessTarget
,AccessTarget.MethodCallTarget
,AccessTarget.MethodReferenceTarget
,JavaClass
,JavaCodeUnit
,JavaConstructor
,JavaField
,JavaMember
,JavaMethod
,JavaPackage
,JavaParameter
,JavaStaticInitializer
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
Predefinedpredicates
targeting objects that implementCanBeAnnotated
static final class
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isAnnotatedWith
(DescribedPredicate<? super JavaAnnotation<?>> predicate) Returnstrue
, if this element is annotated with an annotation matching the given predicate.boolean
isAnnotatedWith
(Class<? extends Annotation> annotationType) Returnstrue
, if this element is annotated with the given annotation type.boolean
isAnnotatedWith
(String annotationTypeName) boolean
isMetaAnnotatedWith
(DescribedPredicate<? super JavaAnnotation<?>> predicate) Returnstrue
, if this element is meta-annotated with an annotation matching the given predicate.boolean
isMetaAnnotatedWith
(Class<? extends Annotation> annotationType) Returnstrue
, if this element is meta-annotated with the given annotation type.boolean
isMetaAnnotatedWith
(String annotationTypeName)
-
Method Details
-
isAnnotatedWith
Returnstrue
, if this element is annotated with the given annotation type.- Parameters:
annotationType
- The type of the annotation to check for
-
isAnnotatedWith
- Parameters:
annotationTypeName
- Fully qualified class name of a specific type ofAnnotation
- See Also:
-
isAnnotatedWith
@PublicAPI(usage=ACCESS) boolean isAnnotatedWith(DescribedPredicate<? super JavaAnnotation<?>> predicate) Returnstrue
, if this element is annotated with an annotation matching the given predicate.- Parameters:
predicate
- Qualifies matching annotations
-
isMetaAnnotatedWith
Returnstrue
, if this element is meta-annotated with the given annotation type. A meta-annotation is an annotation that is declared on another annotation.This method also returns
true
if this element is directly annotated with the given annotation type.- Parameters:
annotationType
- The type of the annotation to check for
-
isMetaAnnotatedWith
- Parameters:
annotationTypeName
- Fully qualified class name of a specific type ofAnnotation
- See Also:
-
isMetaAnnotatedWith
@PublicAPI(usage=ACCESS) boolean isMetaAnnotatedWith(DescribedPredicate<? super JavaAnnotation<?>> predicate) Returnstrue
, if this element is meta-annotated with an annotation matching the given predicate. A meta-annotation is an annotation that is declared on another annotation.This method also returns
true
if this element is directly annotated with an annotation matching the given predicate.- Parameters:
predicate
- Qualifies matching annotations
-