Interface AnnotationMetadata

All Superinterfaces:
AnnotationSource
All Known Subinterfaces:
AbstractAnnotationMetadataBuilder.CachedAnnotationMetadata, AnnotationElement, AnnotationMetadataDelegate, ArrayableClassElement, BeanConstructorElement, BeanDefinition<T>, BeanDefinitionMethodReference<T,R>, BeanDefinitionReference<T>, BeanElement, BeanElementBuilder, BeanFieldElement, BeanIntrospection<T>, BeanMethodElement, BeanParameterElement, BeanProperty<B,T>, ClassElement, ConfigurableElement, ConstructorElement, ConstructorInvocationContext<T>, DelegatingBeanDefinition<T>, DelegatingExecutableMethod<T,R>, DisposableBeanDefinition<T>, Element, ElementAnnotationMetadata, ElementMutableAnnotationMetadataDelegate<R>, EnumConstantElement, EnumElement, ExecutableMethod<T,R>, ExecutionHandle<T,R>, FieldElement, GenericElement, GenericPlaceholderElement, InitializingBeanDefinition<T>, InjectableBeanDefinition<T>, InjectableElement, InstantiatableBeanDefinition<T>, InvocationContext<T,R>, MemberElement, MethodBasedRouteMatch<T,R>, MethodElement, MethodExecutionHandle<T,R>, MethodInvocationContext<T,R>, MethodReference<T,R>, MutableAnnotationMetadataDelegate<R>, PackageElement, ParameterElement, ParametrizedInstantiatableBeanDefinition<T>, PropertyElement, ProxyBeanDefinition<T>, QualifiedBeanType<T>, RuntimeBeanDefinition<T>, TypedElement, UnsafeBeanInstantiationIntrospection<T>, UnsafeBeanProperty<B,T>, UnsafeExecutionHandle<T,R>, UriRouteMatch<T,R>, ValidatedBeanDefinition<T>, WildcardElement
All Known Implementing Classes:
AbstractAnnotationElement, AbstractBeanDefinitionBuilder, AbstractBeanProperty, AbstractElementAnnotationMetadata, AbstractElementAnnotationMetadataFactory.AbstractElementAnnotationMetadata, AbstractElementAnnotationMetadataFactory.MutableElementAnnotationMetadata, AbstractEnvironmentAnnotationMetadata, AbstractExecutableBeanMethod, AbstractExecutableMethod, AbstractGroovyElement, AbstractInitializableBeanDefinition, AbstractInitializableBeanDefinitionReference, AbstractInitializableBeanIntrospection, AbstractJavaElement, AbstractMutableAnnotationMetadata, AbstractProviderDefinition, AnnotationMetadataHierarchy, AnnotationMetadataReference, ApplicationEventPublisherFactory, BeanDefinitionWriter, BeanProviderDefinition, ConstructorInterceptorChain, DefaultAnnotationMetadata, DisabledBean, EvaluatedAnnotationMetadata, GenericPlaceholderElementAnnotationMetadata, GroovyClassElement, GroovyConstructorElement, GroovyEnumConstantElement, GroovyFieldElement, GroovyMethodElement, GroovyPackageElement, GroovyParameterElement, InterceptorChain, InterceptorRegistryBean, JakartaProviderBeanDefinition, JavaClassElement, JavaMethodElement, JavaPackageElement, JavaxProviderBeanDefinition, MappingAnnotationMetadataDelegate, MethodElementAnnotationMetadata, MethodInterceptorChain, MutableAnnotationMetadata, MutatedMethodElementAnnotationMetadata, PrimitiveElement, PropertyElementAnnotationMetadata, WildcardElementAnnotationMetadata

public interface AnnotationMetadata extends AnnotationSource

An interface implemented at compile time by Micronaut that allows the inspection of annotation metadata and stereotypes (meta-annotations)

.

This interface exposes fast and efficient means to expose annotation data at runtime without requiring reflective tricks to read the annotation metadata

Users of Micronaut should in general avoid the methods of the AnnotatedElement interface and use this interface instead to obtain maximum efficiency

Core framework types such as io.micronaut.inject.BeanDefinition and io.micronaut.inject.ExecutableMethod implement this interface

Since:
1.0
Author:
Graeme Rocher
  • Field Details

    • EMPTY_METADATA

      static final AnnotationMetadata EMPTY_METADATA
      A constant for representing empty metadata.
    • VALUE_MEMBER

      static final String VALUE_MEMBER
      The default value() member.
      See Also:
    • CLASS_NAME_SUFFIX

      static final String CLASS_NAME_SUFFIX
      The suffix used when saving compiled metadata to classes.
      See Also:
  • Method Details

    • getDeclaredMetadata

      @NonNull default @NonNull AnnotationMetadata getDeclaredMetadata()
      Gets the declared metadata without inherited metdata.
      Returns:
      The declared metadata
      Since:
      3.0.0
    • hasPropertyExpressions

      default boolean hasPropertyExpressions()
      Does the metadata contain any property expressions like ${foo.bar}. Note this by default returns true as previous versions of Micronaut must assume metadata is present. The compilation time this is computed in order to decide whether to instrument annotation metadata with environment specific logic.
      Returns:
      True if property expressions are present
    • hasEvaluatedExpressions

      default boolean hasEvaluatedExpressions()
      Does the metadata contain any evaluated expressions like #{ T(java.lang.Math).random() }.
      Returns:
      True if evaluated expressions are present
      Since:
      4.0.0
    • getAnnotationNamesByStereotype

      @NonNull default @NonNull List<String> getAnnotationNamesByStereotype(@Nullable @Nullable String stereotype)
      Resolve all of the annotation names that feature the given stereotype.
      Parameters:
      stereotype - The annotation names
      Returns:
      A set of annotation names
    • getAnnotationValuesByStereotype

      @NonNull default <T extends Annotation> @NonNull List<AnnotationValue<T>> getAnnotationValuesByStereotype(@Nullable @Nullable String stereotype)
      Resolve all of the annotation values that feature the given stereotype.
      Type Parameters:
      T - The annotation type
      Parameters:
      stereotype - The annotation names
      Returns:
      A set of annotation names
      Since:
      3.5.2
    • getAnnotationNames

      @NonNull default @NonNull Set<String> getAnnotationNames()
      All the annotation names this metadata declares.
      Returns:
      All the annotation names this metadata declares
    • getStereotypeAnnotationNames

      @NonNull default @NonNull Set<String> getStereotypeAnnotationNames()
      Returns the names of the annotations which are stereotypes.

      A stereotype is a meta-annotation (an annotation declared on another annotation).

      Returns:
      The names of the stereotype annotations
      Since:
      3.4.1
      See Also:
    • getDeclaredStereotypeAnnotationNames

      @NonNull default @NonNull Set<String> getDeclaredStereotypeAnnotationNames()
      Returns the names of the annotations which are declared stereotypes.

      A stereotype is a meta-annotation (an annotation declared on another annotation).

      A stereotype is considered declared when it it is a meta-annotation that is present on an annotation directly declared on the element and not inherited from a super class.

      Returns:
      The names of the stereotype annotations
      Since:
      3.4.1
      See Also:
    • getDeclaredAnnotationNames

      @NonNull default @NonNull Set<String> getDeclaredAnnotationNames()
      All the declared annotation names this metadata declares.
      Returns:
      All the declared annotation names this metadata declares
    • getDeclaredAnnotationNamesByStereotype

      @NonNull default @NonNull List<String> getDeclaredAnnotationNamesByStereotype(@Nullable @Nullable String stereotype)
      Resolve all of the annotations names for the given stereotype that are declared annotations.
      Parameters:
      stereotype - The stereotype
      Returns:
      The declared annotations
    • getValues

      @NonNull default <T> @NonNull OptionalValues<T> getValues(@NonNull @NonNull String annotation, @NonNull @NonNull Class<T> valueType)
      Get all of the values for the given annotation and type of the underlying values.
      Type Parameters:
      T - Generic type
      Parameters:
      annotation - The annotation name
      valueType - valueType
      Returns:
      The OptionalValues
    • getValues

      @NonNull default @NonNull Map<CharSequence,Object> getValues(@NonNull @NonNull String annotation)
      Get all of the values for the given annotation and type of the underlying values.
      Parameters:
      annotation - The annotation name
      Returns:
      An immutable map of values
    • getDefaultValue

      default <T> Optional<T> getDefaultValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member, @NonNull @NonNull Argument<T> requiredType)
      Return the default value for the given annotation member.
      Type Parameters:
      T - The required generic type
      Parameters:
      annotation - The annotation
      member - The member
      requiredType - The required type
      Returns:
      An optional value
    • getAnnotationValuesByType

      @NonNull default <T extends Annotation> @NonNull List<AnnotationValue<T>> getAnnotationValuesByType(@NonNull @NonNull Class<T> annotationType)
      Gets all the annotation values by the given repeatable type.
      Type Parameters:
      T - The annotation type
      Parameters:
      annotationType - The annotation type
      Returns:
      A list of values
    • getAnnotationValuesByName

      @NonNull default <T extends Annotation> @NonNull List<AnnotationValue<T>> getAnnotationValuesByName(@NonNull @NonNull String annotationType)
      Gets all the annotation values by the given repeatable type name.
      Type Parameters:
      T - The annotation type
      Parameters:
      annotationType - The annotation type
      Returns:
      A list of values
      Since:
      3.2.4
    • getDeclaredAnnotationValuesByType

      @NonNull default <T extends Annotation> @NonNull List<AnnotationValue<T>> getDeclaredAnnotationValuesByType(@NonNull @NonNull Class<T> annotationType)
      Gets only declared annotation values by the given repeatable type.
      Type Parameters:
      T - The annotation type
      Parameters:
      annotationType - The annotation type
      Returns:
      A list of values
    • getDeclaredAnnotationValuesByName

      @NonNull default <T extends Annotation> @NonNull List<AnnotationValue<T>> getDeclaredAnnotationValuesByName(@NonNull @NonNull String annotationType)
      Gets only declared annotation values by the given repeatable type name.
      Type Parameters:
      T - The annotation type
      Parameters:
      annotationType - The annotation type
      Returns:
      A list of values
      Since:
      3.2.4
    • hasDeclaredAnnotation

      default boolean hasDeclaredAnnotation(@Nullable @Nullable String annotation)
      Checks whether this object has the given annotation directly declared on the object.
      Parameters:
      annotation - The annotation
      Returns:
      True if the annotation is present
    • hasAnnotation

      default boolean hasAnnotation(@Nullable @Nullable String annotation)
      Checks whether this object has the given annotation on the object itself or inherited from a parent.
      Parameters:
      annotation - The annotation
      Returns:
      True if the annotation is present
    • hasSimpleAnnotation

      default boolean hasSimpleAnnotation(@Nullable @Nullable String annotation)
      Checks whether the given annotation simple name (name without the package) is present in the annotations.
      Parameters:
      annotation - The annotation
      Returns:
      True if the annotation is present
    • hasSimpleDeclaredAnnotation

      default boolean hasSimpleDeclaredAnnotation(@Nullable @Nullable String annotation)
      Checks whether the given annotation simple name (name without the package) is present in the declared annotations.
      Parameters:
      annotation - The annotation
      Returns:
      True if the annotation is present
    • hasStereotype

      default boolean hasStereotype(@Nullable @Nullable String annotation)

      Checks whether this object has the given annotation stereotype on the object itself or inherited from a parent

      .

      An annotation stereotype is a meta annotation potentially applied to another annotation

      Parameters:
      annotation - The annotation
      Returns:
      True if the annotation is present
    • hasDeclaredStereotype

      default boolean hasDeclaredStereotype(@Nullable @Nullable String annotation)

      Checks whether this object has the given annotation stereotype on the object itself and not inherited from a parent

      .

      An annotation stereotype is a meta annotation potentially applied to another annotation

      Parameters:
      annotation - The annotation
      Returns:
      True if the annotation is present
    • hasDeclaredStereotype

      default boolean hasDeclaredStereotype(@Nullable @Nullable String... annotations)
      Checks whether this object has any of the given stereotype directly declared on the object.
      Parameters:
      annotations - The annotations
      Returns:
      True if any of the given stereotypes are present
      Since:
      2.3.3
    • getDefaultValues

      @NonNull default @NonNull Map<CharSequence,Object> getDefaultValues(@NonNull @NonNull String annotation)
      Return the default values for the given annotation name.
      Parameters:
      annotation - The annotation name
      Returns:
      The default values
    • getDefaultValue

      default <T> Optional<T> getDefaultValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member, @NonNull @NonNull Class<T> requiredType)
      Return the default value for the given annotation member.
      Type Parameters:
      T - The required generic type
      Parameters:
      annotation - The annotation
      member - The member
      requiredType - The required type
      Returns:
      An optional value
    • getDefaultValue

      default <T> Optional<T> getDefaultValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member, @NonNull @NonNull Argument<T> requiredType)
      Return the default value for the given annotation member.
      Type Parameters:
      T - The required generic type
      Parameters:
      annotation - The annotation
      member - The member
      requiredType - The required type
      Returns:
      An optional value
    • isAnnotationPresent

      default boolean isAnnotationPresent(@NonNull @NonNull Class<? extends Annotation> annotationClass)
      Description copied from interface: AnnotationSource
      Return whether an annotation is present.
      Specified by:
      isAnnotationPresent in interface AnnotationSource
      Parameters:
      annotationClass - The annotation class
      Returns:
      True if it is
      See Also:
    • isDeclaredAnnotationPresent

      default boolean isDeclaredAnnotationPresent(@NonNull @NonNull Class<? extends Annotation> annotationClass)
      Description copied from interface: AnnotationSource
      Variation of AnnotationSource.isAnnotationPresent(Class) for declared annotations.
      Specified by:
      isDeclaredAnnotationPresent in interface AnnotationSource
      Parameters:
      annotationClass - The annotation class
      Returns:
      True if it is
      See Also:
    • isAnnotationPresent

      default boolean isAnnotationPresent(@NonNull @NonNull String annotationName)
      Description copied from interface: AnnotationSource
      Return whether an annotation is present.
      Specified by:
      isAnnotationPresent in interface AnnotationSource
      Parameters:
      annotationName - The annotation name
      Returns:
      True if it is
      See Also:
    • isDeclaredAnnotationPresent

      default boolean isDeclaredAnnotationPresent(@NonNull @NonNull String annotationName)
      Description copied from interface: AnnotationSource
      Variation of AnnotationSource.isAnnotationPresent(String) for declared annotations.
      Specified by:
      isDeclaredAnnotationPresent in interface AnnotationSource
      Parameters:
      annotationName - The annotation name
      Returns:
      True if it is
      See Also:
    • getDefaultValue

      default <T> Optional<T> getDefaultValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member, @NonNull @NonNull Class<T> requiredType)
      Return the default value for the given annotation member.
      Type Parameters:
      T - The required generic type
      Parameters:
      annotation - The annotation
      member - The member
      requiredType - The required type
      Returns:
      An optional value
    • getValue

      default <T> Optional<T> getValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member, @NonNull @NonNull Class<T> requiredType)
      Get the value of the given annotation member.
      Type Parameters:
      T - The value
      Parameters:
      annotation - The annotation class
      member - The annotation member
      requiredType - The required type
      Returns:
      An Optional of the value
    • getValue

      default <T> Optional<T> getValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member, @NonNull @NonNull Argument<T> requiredType)
      Get the value of the given annotation member.
      Type Parameters:
      T - The value
      Parameters:
      annotation - The annotation class
      member - The annotation member
      requiredType - The required type
      Returns:
      An Optional of the value
    • getAnnotationNameByStereotype

      default Optional<String> getAnnotationNameByStereotype(@Nullable @Nullable String stereotype)
      Find the first annotation name for the given stereotype.
      Parameters:
      stereotype - The stereotype
      Returns:
      The annotation name
    • getDeclaredAnnotationNameByStereotype

      default Optional<String> getDeclaredAnnotationNameByStereotype(@Nullable @Nullable String stereotype)
      Find the first annotation name for the given stereotype.
      Parameters:
      stereotype - The stereotype
      Returns:
      The annotation name
    • getAnnotationTypeByStereotype

      default Optional<Class<? extends Annotation>> getAnnotationTypeByStereotype(@NonNull @NonNull Class<? extends Annotation> stereotype)
      Find the first annotation name for the given stereotype.
      Parameters:
      stereotype - The stereotype
      Returns:
      The annotation name
    • getDeclaredAnnotationTypeByStereotype

      default Optional<Class<? extends Annotation>> getDeclaredAnnotationTypeByStereotype(@NonNull @NonNull Class<? extends Annotation> stereotype)
      Find the first declared annotation name for the given stereotype.
      Parameters:
      stereotype - The stereotype
      Returns:
      The annotation name
    • getDeclaredAnnotationTypeByStereotype

      default Optional<Class<? extends Annotation>> getDeclaredAnnotationTypeByStereotype(@Nullable @Nullable String stereotype)
      Find the first annotation name for the given stereotype.
      Parameters:
      stereotype - The stereotype
      Returns:
      The annotation name
    • getAnnotationType

      default Optional<Class<? extends Annotation>> getAnnotationType(@NonNull @NonNull String name, @NonNull @NonNull ClassLoader classLoader)
      Gets the type for a given annotation if it is present on the classpath. Subclasses can potentially override to provide optimized loading.
      Parameters:
      name - The type name
      classLoader - The ClassLoader to load the type
      Returns:
      The type if present
    • getAnnotationType

      default Optional<Class<? extends Annotation>> getAnnotationType(@NonNull @NonNull String name)
      Gets the type for a given annotation if it is present on the classpath. Subclasses can potentially override to provide optimized loading.
      Parameters:
      name - The type name
      Returns:
      The type if present
    • getAnnotationTypeByStereotype

      default Optional<Class<? extends Annotation>> getAnnotationTypeByStereotype(@Nullable @Nullable String stereotype)
      Find the first annotation name for the given stereotype.
      Parameters:
      stereotype - The stereotype
      Returns:
      The annotation name
    • getAnnotationNameByStereotype

      default Optional<String> getAnnotationNameByStereotype(@NonNull @NonNull Class<? extends Annotation> stereotype)
      Find the first annotation name for the given stereotype.
      Parameters:
      stereotype - The stereotype
      Returns:
      The annotation name
    • getValues

      @NonNull default <T> @NonNull OptionalValues<T> getValues(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull Class<T> valueType)
      Get all of the values for the given annotation.
      Type Parameters:
      T - Generic type
      Parameters:
      annotation - The annotation name
      valueType - valueType
      Returns:
      The OptionalValues
    • getAnnotationNamesByStereotype

      @NonNull default @NonNull List<String> getAnnotationNamesByStereotype(@NonNull @NonNull Class<? extends Annotation> stereotype)
      Resolve all of the annotation names that feature the given stereotype.
      Parameters:
      stereotype - The annotation names
      Returns:
      A set of annotation names
    • getAnnotationTypesByStereotype

      @NonNull default @NonNull List<Class<? extends Annotation>> getAnnotationTypesByStereotype(@NonNull @NonNull Class<? extends Annotation> stereotype)
      Resolve all of the annotation names that feature the given stereotype.
      Parameters:
      stereotype - The annotation names
      Returns:
      A set of annotation names
    • getAnnotationTypesByStereotype

      @NonNull default @NonNull List<Class<? extends Annotation>> getAnnotationTypesByStereotype(@NonNull @NonNull String stereotype)
      Resolve all of the annotation names that feature the given stereotype.
      Parameters:
      stereotype - The annotation names
      Returns:
      A set of annotation names
    • getAnnotationTypesByStereotype

      @NonNull default @NonNull List<Class<? extends Annotation>> getAnnotationTypesByStereotype(@NonNull @NonNull Class<? extends Annotation> stereotype, @NonNull @NonNull ClassLoader classLoader)
      Resolve all of the annotation names that feature the given stereotype.
      Parameters:
      stereotype - The annotation names
      classLoader - The classloader to load annotation type
      Returns:
      A set of annotation names
    • findAnnotation

      default <T extends Annotation> Optional<AnnotationValue<T>> findAnnotation(@NonNull @NonNull Class<T> annotationClass)
      Get all of the values for the given annotation.
      Specified by:
      findAnnotation in interface AnnotationSource
      Type Parameters:
      T - The annotation type
      Parameters:
      annotationClass - The annotation name
      Returns:
      The AnnotationValue
    • findDeclaredAnnotation

      default <T extends Annotation> Optional<AnnotationValue<T>> findDeclaredAnnotation(@NonNull @NonNull Class<T> annotationClass)
      Get all of the values for the given annotation that are directly declared on the annotated element.
      Specified by:
      findDeclaredAnnotation in interface AnnotationSource
      Type Parameters:
      T - The annotation type
      Parameters:
      annotationClass - The annotation name
      Returns:
      A AnnotationValue instance
    • getValue

      default <T> Optional<T> getValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member, @NonNull @NonNull Class<T> requiredType)
      Get the value of the given annotation member.
      Type Parameters:
      T - The value
      Parameters:
      annotation - The annotation class
      member - The annotation member
      requiredType - The required type
      Returns:
      An Optional of the value
    • getValue

      default <T> Optional<T> getValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member, @NonNull @NonNull Argument<T> requiredType)
      Get the value of the given annotation member.
      Type Parameters:
      T - The value
      Parameters:
      annotation - The annotation class
      member - The annotation member
      requiredType - The required type
      Returns:
      An Optional of the value
    • longValue

      default OptionalLong longValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member)
      The value as an OptionalLong for the given annotation and member.
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      THe OptionalLong value
    • longValue

      default OptionalLong longValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member)
      The value as an OptionalLong for the given annotation and member.
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      THe OptionalLong value
    • enumValue

      default <E extends Enum<E>> Optional<E> enumValue(@NonNull @NonNull String annotation, Class<E> enumType)
      The value of the given enum.
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      enumType - The enum type
      Returns:
      An Optional enum value
    • enumValue

      default <E extends Enum<E>> Optional<E> enumValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member, Class<E> enumType)
      The value of the annotation as a Class.
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      member - The annotation member
      enumType - The enum type
      Returns:
      An Optional class
    • enumValue

      default <E extends Enum<E>> Optional<E> enumValue(@NonNull @NonNull Class<? extends Annotation> annotation, Class<E> enumType)
      The value of the annotation as a Class.
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      enumType - The enum type
      Returns:
      An Optional class
    • enumValue

      default <E extends Enum<E>> Optional<E> enumValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member, Class<E> enumType)
      The value of the annotation as a Class.
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      member - The annotation member
      enumType - The enum type
      Returns:
      An Optional class
    • enumValues

      default <E extends Enum<E>> E[] enumValues(@NonNull @NonNull String annotation, Class<E> enumType)
      The enum values for the given annotation.
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      enumType - The enum type
      Returns:
      An array of enum values
    • enumValues

      default <E extends Enum<E>> E[] enumValues(@NonNull @NonNull String annotation, @NonNull @NonNull String member, Class<E> enumType)
      The enum values for the given annotation.
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      member - The annotation member
      enumType - The enum type
      Returns:
      An array of enum values
    • enumValuesSet

      default <E extends Enum<E>> EnumSet<E> enumValuesSet(@NonNull @NonNull String annotation, @NonNull @NonNull String member, Class<E> enumType)
      The enum values for the given annotation.
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      member - The annotation member
      enumType - The enum type
      Returns:
      An enum set of enum values
      Since:
      4.0.0
    • enumValues

      default <E extends Enum<E>> E[] enumValues(@NonNull @NonNull Class<? extends Annotation> annotation, Class<E> enumType)
      The enum values for the given annotation.
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      enumType - The enum type
      Returns:
      An array of enum values
    • enumValues

      default <E extends Enum<E>> E[] enumValues(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member, Class<E> enumType)
      The enum values for the given annotation.
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      member - The annotation member
      enumType - The enum type
      Returns:
      An array of enum values
    • enumValuesSet

      default <E extends Enum<E>> EnumSet<E> enumValuesSet(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member, Class<E> enumType)
      The enum values for the given annotation.
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      member - The annotation member
      enumType - The enum type
      Returns:
      An enum set of enum values
      Since:
      4.0.0
    • classValues

      @NonNull default <T> @NonNull Class<T>[] classValues(@NonNull @NonNull String annotation)
      The value of the annotation as a Class.
      Type Parameters:
      T - The type of the class
      Parameters:
      annotation - The annotation
      Returns:
      An Optional class
    • classValues

      @NonNull default <T> @NonNull Class<T>[] classValues(@NonNull @NonNull String annotation, @NonNull @NonNull String member)
      The value of the annotation as a Class.
      Type Parameters:
      T - The type of the class
      Parameters:
      annotation - The annotation
      member - The annotation member
      Returns:
      An Optional class
    • classValues

      @NonNull default <T> @NonNull Class<T>[] classValues(@NonNull @NonNull Class<? extends Annotation> annotation)
      The value of the annotation as a Class.
      Type Parameters:
      T - The type of the class
      Parameters:
      annotation - The annotation
      Returns:
      An Optional class
    • classValues

      @NonNull default <T> @NonNull Class<T>[] classValues(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member)
      The value of the annotation as a Class.
      Type Parameters:
      T - The type of the class
      Parameters:
      annotation - The annotation
      member - The annotation member
      Returns:
      An Optional class
    • classValue

      default Optional<Class> classValue(@NonNull @NonNull String annotation)
      The value of the annotation as a Class.
      Parameters:
      annotation - The annotation
      Returns:
      An Optional class
    • classValue

      default Optional<Class> classValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member)
      The value of the annotation as a Class.
      Parameters:
      annotation - The annotation
      member - The annotation member
      Returns:
      An Optional class
    • classValue

      default Optional<Class> classValue(@NonNull @NonNull Class<? extends Annotation> annotation)
      The value of the annotation as a Class.
      Parameters:
      annotation - The annotation
      Returns:
      An Optional class
    • classValue

      default Optional<Class> classValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member)
      The value of the annotation as a Class.
      Parameters:
      annotation - The annotation
      member - The annotation member
      Returns:
      An Optional class
    • intValue

      default OptionalInt intValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member)
      The value as an OptionalInt for the given annotation and member.
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      THe OptionalInt value
    • intValue

      default OptionalInt intValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member)
      The value as an OptionalInt for the given annotation and member.
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      THe OptionalInt value
    • intValue

      default OptionalInt intValue(@NonNull @NonNull Class<? extends Annotation> annotation)
      The value as an OptionalInt for the given annotation and member.
      Parameters:
      annotation - The annotation
      Returns:
      THe OptionalInt value
    • stringValue

      default Optional<String> stringValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member)
      The value as an optional string for the given annotation and member.
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      The string value if it is present
    • stringValue

      default Optional<String> stringValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member)
      The value as an optional string for the given annotation and member.
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      The string value if it is present
    • stringValue

      @NonNull default @NonNull Optional<String> stringValue(@NonNull @NonNull Class<? extends Annotation> annotation)
      The value as an optional string for the given annotation and member.
      Parameters:
      annotation - The annotation
      Returns:
      The string value if it is present
    • stringValue

      @NonNull default @NonNull Optional<String> stringValue(@NonNull @NonNull String annotation)
      The value as an optional string for the given annotation and member.
      Parameters:
      annotation - The annotation
      Returns:
      The string value if it is present
    • booleanValue

      default Optional<Boolean> booleanValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member)
      The value as an optional boolean for the given annotation and member.
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      The string value if it is present
    • booleanValue

      default Optional<Boolean> booleanValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member)
      The value as an optional boolean for the given annotation and member.
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      The string value if it is present
    • booleanValue

      @NonNull default @NonNull Optional<Boolean> booleanValue(@NonNull @NonNull Class<? extends Annotation> annotation)
      The value as an optional boolean for the given annotation and member.
      Parameters:
      annotation - The annotation
      Returns:
      The string value if it is present
    • booleanValue

      @NonNull default @NonNull Optional<Boolean> booleanValue(@NonNull @NonNull String annotation)
      The value as an optional boolean for the given annotation and member.
      Parameters:
      annotation - The annotation
      Returns:
      The string value if it is present
    • stringValues

      @NonNull default @NonNull String[] stringValues(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member)
      The values as string array for the given annotation and member.
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      The string values if it is present
    • stringValues

      @NonNull default @NonNull String[] stringValues(@NonNull @NonNull Class<? extends Annotation> annotation)
      The values as string array for the given annotation and member.
      Parameters:
      annotation - The annotation
      Returns:
      The string values if it is present
    • stringValues

      @NonNull default @NonNull String[] stringValues(@NonNull @NonNull String annotation, @NonNull @NonNull String member)
      The values as string array for the given annotation and member.
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      The string values if it is present
    • stringValues

      @NonNull default @NonNull String[] stringValues(@NonNull @NonNull String annotation)
      The values as string array for the given annotation and member.
      Parameters:
      annotation - The annotation
      Returns:
      The string values if it is present
    • doubleValue

      @NonNull default @NonNull OptionalDouble doubleValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member)
      The value as an OptionalDouble for the given annotation and member.
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      THe OptionalDouble value
    • doubleValue

      @NonNull default @NonNull OptionalDouble doubleValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member)
      The value as an OptionalDouble for the given annotation and member.
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      THe OptionalDouble value
    • doubleValue

      @NonNull default @NonNull OptionalDouble doubleValue(@NonNull @NonNull Class<? extends Annotation> annotation)
      The value as an OptionalDouble for the given annotation and member.
      Parameters:
      annotation - The annotation
      Returns:
      THe OptionalDouble value
    • getValue

      @NonNull default <T> @NonNull Optional<T> getValue(@NonNull @NonNull String annotation, @NonNull @NonNull Class<T> requiredType)
      Get the value of default "value" the given annotation.
      Type Parameters:
      T - The value
      Parameters:
      annotation - The annotation class
      requiredType - The required type
      Returns:
      An Optional of the value
    • getValue

      @NonNull default @NonNull Optional<Object> getValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member)
      Get the value of the given annotation member.
      Parameters:
      annotation - The annotation class
      member - The annotation member
      Returns:
      An Optional of the value
    • getValue

      @NonNull default @NonNull Optional<Object> getValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member)
      Get the value of the given annotation member.
      Parameters:
      annotation - The annotation class
      member - The annotation member
      Returns:
      An Optional of the value
    • isTrue

      default boolean isTrue(@NonNull @NonNull String annotation, @NonNull @NonNull String member)
      Returns whether the value of the given member is true.
      Parameters:
      annotation - The annotation class
      member - The annotation member
      Returns:
      True if the value is true
    • isTrue

      default boolean isTrue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member)
      Returns whether the value of the given member is true.
      Parameters:
      annotation - The annotation class
      member - The annotation member
      Returns:
      True if the value is true
    • isPresent

      default boolean isPresent(@NonNull @NonNull String annotation, @NonNull @NonNull String member)
      Returns whether the value of the given member is present.
      Parameters:
      annotation - The annotation class
      member - The annotation member
      Returns:
      True if the value is true
    • isPresent

      default boolean isPresent(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member)
      Returns whether the value of the given member is present.
      Parameters:
      annotation - The annotation class
      member - The annotation member
      Returns:
      True if the value is true
    • isFalse

      default boolean isFalse(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member)
      Returns whether the value of the given member is true.
      Parameters:
      annotation - The annotation class
      member - The annotation member
      Returns:
      True if the value is true
    • isFalse

      default boolean isFalse(@NonNull @NonNull String annotation, @NonNull @NonNull String member)
      Returns whether the value of the given member is true.
      Parameters:
      annotation - The annotation class
      member - The annotation member
      Returns:
      True if the value is true
    • getValue

      @NonNull default @NonNull Optional<Object> getValue(@NonNull @NonNull String annotation)
      Get the value of default "value" the given annotation.
      Parameters:
      annotation - The annotation class
      Returns:
      An Optional of the value
    • getValue

      @NonNull default @NonNull Optional<Object> getValue(@NonNull @NonNull Class<? extends Annotation> annotation)
      Get the value of default "value" the given annotation.
      Parameters:
      annotation - The annotation class
      Returns:
      An Optional of the value
    • getValue

      @NonNull default <T> @NonNull Optional<T> getValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull Class<T> requiredType)
      Get the value of default "value" the given annotation.
      Type Parameters:
      T - Generic type
      Parameters:
      annotation - The annotation class
      requiredType - requiredType
      Returns:
      An Optional of the value
    • getValue

      @NonNull default <T> @NonNull Optional<T> getValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull Argument<T> requiredType)
      Get the value of default "value" the given annotation.
      Type Parameters:
      T - Generic type
      Parameters:
      annotation - The annotation class
      requiredType - requiredType
      Returns:
      An Optional of the value
    • getValue

      @NonNull default <T> @NonNull Optional<T> getValue(@NonNull @NonNull String annotation, @NonNull @NonNull Argument<T> requiredType)
      Get the value of default "value" the given annotation.
      Type Parameters:
      T - Generic type
      Parameters:
      annotation - The annotation class
      requiredType - requiredType
      Returns:
      An Optional of the value
    • hasAnnotation

      default boolean hasAnnotation(@Nullable @Nullable Class<? extends Annotation> annotation)
      Checks whether this object has the given annotation on the object itself or inherited from a parent.
      Parameters:
      annotation - The annotation
      Returns:
      True if the annotation is present
    • hasStereotype

      default boolean hasStereotype(@Nullable @Nullable Class<? extends Annotation> annotation)

      Checks whether this object has the given annotation stereotype on the object itself or inherited from a parent

      .

      An annotation stereotype is a meta annotation potentially applied to another annotation

      Parameters:
      annotation - The annotation
      Returns:
      True if the annotation is present
    • hasStereotypeNonRepeating

      @Internal default boolean hasStereotypeNonRepeating(@NonNull @NonNull Class<? extends Annotation> annotation)
      Faster version of hasStereotype(Class) that does not support repeatable annotations.
      Parameters:
      annotation - The annotation type
      Returns:
      Whether this metadata has the given stereotype
    • hasStereotype

      default boolean hasStereotype(@Nullable @Nullable Class<? extends Annotation>... annotations)
      Check whether any of the given stereotypes is present.
      Parameters:
      annotations - The annotations
      Returns:
      True if any of the given stereotypes are present
    • hasStereotype

      default boolean hasStereotype(@Nullable @Nullable String[] annotations)
      Check whether any of the given stereotypes is present.
      Parameters:
      annotations - The annotations
      Returns:
      True if any of the given stereotypes are present
    • hasDeclaredAnnotation

      default boolean hasDeclaredAnnotation(@Nullable @Nullable Class<? extends Annotation> annotation)
      Checks whether this object has the given annotation directly declared on the object.
      Parameters:
      annotation - The annotation
      Returns:
      True if the annotation is present
    • hasDeclaredStereotype

      default boolean hasDeclaredStereotype(@Nullable @Nullable Class<? extends Annotation> stereotype)
      Checks whether this object has the given stereotype directly declared on the object.
      Parameters:
      stereotype - The annotation
      Returns:
      True if the annotation is present
    • hasDeclaredStereotype

      default boolean hasDeclaredStereotype(@Nullable @Nullable Class<? extends Annotation>... annotations)
      Checks whether this object has any of the given stereotype directly declared on the object.
      Parameters:
      annotations - The annotations
      Returns:
      True if any of the given stereotypes are present
    • isRepeatableAnnotation

      default boolean isRepeatableAnnotation(@NonNull @NonNull Class<? extends Annotation> annotation)
      Is repeatable annotation?
      Parameters:
      annotation - The annotation
      Returns:
      true if repeatable
      Since:
      3.1
    • isRepeatableAnnotation

      default boolean isRepeatableAnnotation(@NonNull @NonNull String annotation)
      Is repeatable annotation?
      Parameters:
      annotation - The annotation
      Returns:
      true if repeatable
      Since:
      3.1
    • findRepeatableAnnotation

      default Optional<String> findRepeatableAnnotation(@NonNull @NonNull Class<? extends Annotation> annotation)
      Find repeatable annotation container.
      Parameters:
      annotation - The annotation
      Returns:
      optional repeatable annotation container
      Since:
      3.1
    • findRepeatableAnnotation

      default Optional<String> findRepeatableAnnotation(@NonNull @NonNull String annotation)
      Find repeatable annotation container.
      Parameters:
      annotation - The annotation
      Returns:
      optional repeatable annotation container
      Since:
      3.1
    • isEmpty

      default boolean isEmpty()
      Is the annotation metadata empty.
      Returns:
      True if it is
    • copyAnnotationMetadata

      @NonNull default @NonNull AnnotationMetadata copyAnnotationMetadata()
      Makes a copy of the annotation or returns this.
      Returns:
      the copy
      Since:
      4.0.0
    • getTargetAnnotationMetadata

      @NonNull default @NonNull AnnotationMetadata getTargetAnnotationMetadata()
      Unwraps possible a possible delegate or a provider, returns this otherwise.
      Specified by:
      getTargetAnnotationMetadata in interface AnnotationSource
      Returns:
      unwrapped
      Since:
      4.0.0
      See Also: