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
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classPredefinedpredicatestargeting objects that implementCanBeAnnotatedstatic final class -
Method Summary
Modifier and TypeMethodDescriptionbooleanisAnnotatedWith(DescribedPredicate<? super JavaAnnotation<?>> predicate) Returnstrue, if this element is annotated with an annotation matching the given predicate.booleanisAnnotatedWith(Class<? extends Annotation> annotationType) Returnstrue, if this element is annotated with the given annotation type.booleanisAnnotatedWith(String annotationTypeName) booleanisMetaAnnotatedWith(DescribedPredicate<? super JavaAnnotation<?>> predicate) Returnstrue, if this element is meta-annotated with an annotation matching the given predicate.booleanisMetaAnnotatedWith(Class<? extends Annotation> annotationType) Returnstrue, if this element is meta-annotated with the given annotation type.booleanisMetaAnnotatedWith(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
trueif 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
trueif this element is directly annotated with an annotation matching the given predicate.- Parameters:
predicate- Qualifies matching annotations
-