Class DefaultAnnotationMetadata

java.lang.Object
io.micronaut.inject.annotation.DefaultAnnotationMetadata
All Implemented Interfaces:
AnnotationMetadata, AnnotationSource, Cloneable
Direct Known Subclasses:
MutableAnnotationMetadata

@Internal public class DefaultAnnotationMetadata extends Object implements AnnotationMetadata, Cloneable
Default implementation of AnnotationMetadata.

NOTE: Although required to be public This is an internal class and should not be referenced directly in user code

Since:
1.0
Author:
Graeme Rocher
  • Constructor Details

    • DefaultAnnotationMetadata

      @Internal protected DefaultAnnotationMetadata()
      Constructs empty annotation metadata.
    • DefaultAnnotationMetadata

      @Internal public DefaultAnnotationMetadata(@Nullable Map<String,Map<CharSequence,Object>> declaredAnnotations, @Nullable Map<String,Map<CharSequence,Object>> declaredStereotypes, @Nullable Map<String,Map<CharSequence,Object>> allStereotypes, @Nullable Map<String,Map<CharSequence,Object>> allAnnotations, @Nullable Map<String,List<String>> annotationsByStereotype)
      This constructor is designed to be used by compile time produced subclasses.
      Parameters:
      declaredAnnotations - The directly declared annotations
      declaredStereotypes - The directly declared stereotypes
      allStereotypes - All stereotypes
      allAnnotations - All annotations
      annotationsByStereotype - The annotations by stereotype
    • DefaultAnnotationMetadata

      @Internal public DefaultAnnotationMetadata(@Nullable Map<String,Map<CharSequence,Object>> declaredAnnotations, @Nullable Map<String,Map<CharSequence,Object>> declaredStereotypes, @Nullable Map<String,Map<CharSequence,Object>> allStereotypes, @Nullable Map<String,Map<CharSequence,Object>> allAnnotations, @Nullable Map<String,List<String>> annotationsByStereotype, boolean hasPropertyExpressions)
      This constructor is designed to be used by compile time produced subclasses.
      Parameters:
      declaredAnnotations - The directly declared annotations
      declaredStereotypes - The directly declared stereotypes
      allStereotypes - All stereotypes
      allAnnotations - All annotations
      annotationsByStereotype - The annotations by stereotype
      hasPropertyExpressions - Whether property expressions exist in the metadata
    • DefaultAnnotationMetadata

      @Internal public DefaultAnnotationMetadata(@Nullable Map<String,Map<CharSequence,Object>> declaredAnnotations, @Nullable Map<String,Map<CharSequence,Object>> declaredStereotypes, @Nullable Map<String,Map<CharSequence,Object>> allStereotypes, @Nullable Map<String,Map<CharSequence,Object>> allAnnotations, @Nullable Map<String,List<String>> annotationsByStereotype, boolean hasPropertyExpressions, boolean hasEvaluatedExpressions)
      This constructor is designed to be used by compile time produced subclasses.
      Parameters:
      declaredAnnotations - The directly declared annotations
      declaredStereotypes - The directly declared stereotypes
      allStereotypes - All stereotypes
      allAnnotations - All annotations
      annotationsByStereotype - The annotations by stereotype
      hasPropertyExpressions - Whether property expressions exist in the metadata
      hasEvaluatedExpressions - Whether evaluated expressions exist in the metadata
  • Method Details

    • getDeclaredMetadata

      public @NonNull AnnotationMetadata getDeclaredMetadata()
      Description copied from interface: AnnotationMetadata
      Gets the declared metadata without inherited metdata.
      Specified by:
      getDeclaredMetadata in interface AnnotationMetadata
      Returns:
      The declared metadata
    • hasPropertyExpressions

      public boolean hasPropertyExpressions()
      Description copied from interface: AnnotationMetadata
      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.
      Specified by:
      hasPropertyExpressions in interface AnnotationMetadata
      Returns:
      True if property expressions are present
    • hasEvaluatedExpressions

      public boolean hasEvaluatedExpressions()
      Description copied from interface: AnnotationMetadata
      Does the metadata contain any evaluated expressions like #{ T(java.lang.Math).random() }.
      Specified by:
      hasEvaluatedExpressions in interface AnnotationMetadata
      Returns:
      True if evaluated expressions are present
    • getDefaultValues

      public @NonNull Map<CharSequence,Object> getDefaultValues(@NonNull String annotation)
      Description copied from interface: AnnotationMetadata
      Return the default values for the given annotation name.
      Specified by:
      getDefaultValues in interface AnnotationMetadata
      Parameters:
      annotation - The annotation name
      Returns:
      The default values
    • isPresent

      public boolean isPresent(@NonNull String annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      Returns whether the value of the given member is present.
      Specified by:
      isPresent in interface AnnotationMetadata
      Parameters:
      annotation - The annotation class
      member - The annotation member
      Returns:
      True if the value is true
    • enumValue

      public <E extends Enum<E>> Optional<E> enumValue(@NonNull String annotation, Class<E> enumType)
      Description copied from interface: AnnotationMetadata
      The value of the given enum.
      Specified by:
      enumValue in interface AnnotationMetadata
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      enumType - The enum type
      Returns:
      An Optional enum value
    • enumValue

      public <E extends Enum<E>> Optional<E> enumValue(@NonNull String annotation, @NonNull String member, Class<E> enumType)
      Description copied from interface: AnnotationMetadata
      The value of the annotation as a Class.
      Specified by:
      enumValue in interface AnnotationMetadata
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      member - The annotation member
      enumType - The enum type
      Returns:
      An Optional class
    • enumValue

      public <E extends Enum<E>> Optional<E> enumValue(@NonNull Class<? extends Annotation> annotation, Class<E> enumType)
      Description copied from interface: AnnotationMetadata
      The value of the annotation as a Class.
      Specified by:
      enumValue in interface AnnotationMetadata
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      enumType - The enum type
      Returns:
      An Optional class
    • enumValue

      public <E extends Enum<E>> Optional<E> enumValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, Class<E> enumType)
      Description copied from interface: AnnotationMetadata
      The value of the annotation as a Class.
      Specified by:
      enumValue in interface AnnotationMetadata
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      member - The annotation member
      enumType - The enum type
      Returns:
      An Optional class
    • enumValue

      @Internal public <E extends Enum<E>> Optional<E> enumValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, Class<E> enumType, @Nullable Function<Object,Object> valueMapper)
      Retrieve the class value and optionally map its value.
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      member - The member
      enumType - The enum type
      valueMapper - The value mapper
      Returns:
      The class value
    • enumValues

      public <E extends Enum<E>> E[] enumValues(@NonNull String annotation, Class<E> enumType)
      Description copied from interface: AnnotationMetadata
      The enum values for the given annotation.
      Specified by:
      enumValues in interface AnnotationMetadata
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      enumType - The enum type
      Returns:
      An array of enum values
    • enumValues

      public <E extends Enum<E>> E[] enumValues(@NonNull String annotation, @NonNull String member, Class<E> enumType)
      Description copied from interface: AnnotationMetadata
      The enum values for the given annotation.
      Specified by:
      enumValues in interface AnnotationMetadata
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      member - The annotation member
      enumType - The enum type
      Returns:
      An array of enum values
    • enumValues

      public <E extends Enum<E>> E[] enumValues(@NonNull Class<? extends Annotation> annotation, Class<E> enumType)
      Description copied from interface: AnnotationMetadata
      The enum values for the given annotation.
      Specified by:
      enumValues in interface AnnotationMetadata
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      enumType - The enum type
      Returns:
      An array of enum values
    • enumValues

      public <E extends Enum<E>> E[] enumValues(@NonNull Class<? extends Annotation> annotation, @NonNull String member, Class<E> enumType)
      Description copied from interface: AnnotationMetadata
      The enum values for the given annotation.
      Specified by:
      enumValues in interface AnnotationMetadata
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      member - The annotation member
      enumType - The enum type
      Returns:
      An array of enum values
    • enumValues

      public <E extends Enum<E>> E[] enumValues(@NonNull Class<? extends Annotation> annotation, @NonNull String member, Class<E> enumType, @Nullable Function<Object,Object> valueMapper)
    • enumValues

      public <E extends Enum<E>> E[] enumValues(@NonNull String annotation, @NonNull String member, Class<E> enumType, @Nullable Function<Object,Object> valueMapper)
    • enumValue

      @Internal public <E extends Enum<E>> Optional<E> enumValue(@NonNull String annotation, @NonNull String member, Class<E> enumType, @Nullable Function<Object,Object> valueMapper)
      Retrieve the class value and optionally map its value.
      Type Parameters:
      E - The enum type
      Parameters:
      annotation - The annotation
      member - The member
      enumType - The enum type
      valueMapper - The value mapper
      Returns:
      The class value
    • classValues

      public <T> Class<T>[] classValues(@NonNull String annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      The value of the annotation as a Class.
      Specified by:
      classValues in interface AnnotationMetadata
      Type Parameters:
      T - The type of the class
      Parameters:
      annotation - The annotation
      member - The annotation member
      Returns:
      An Optional class
    • classValues

      public <T> Class<T>[] classValues(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      The value of the annotation as a Class.
      Specified by:
      classValues in interface AnnotationMetadata
      Type Parameters:
      T - The type of the class
      Parameters:
      annotation - The annotation
      member - The annotation member
      Returns:
      An Optional class
    • classValue

      public @NonNull Optional<Class> classValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      The value of the annotation as a Class.
      Specified by:
      classValue in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      member - The annotation member
      Returns:
      An Optional class
    • classValue

      public Optional<Class> classValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, Function<Object,Object> valueMapper)
      Retrieve the class value and optionally map its value.
      Parameters:
      annotation - The annotation
      member - The member
      valueMapper - The value mapper
      Returns:
      The class value
    • classValue

      public @NonNull Optional<Class> classValue(@NonNull String annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      The value of the annotation as a Class.
      Specified by:
      classValue in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      member - The annotation member
      Returns:
      An Optional class
    • classValue

      @Internal public Optional<Class> classValue(@NonNull String annotation, @NonNull String member, @Nullable Function<Object,Object> valueMapper)
      Retrieve the class value and optionally map its value.
      Parameters:
      annotation - The annotation
      member - The member
      valueMapper - The value mapper
      Returns:
      The class value
    • intValue

      public @NonNull OptionalInt intValue(@NonNull String annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      The value as an OptionalInt for the given annotation and member.
      Specified by:
      intValue in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      THe OptionalInt value
    • intValue

      public @NonNull OptionalInt intValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      The value as an OptionalInt for the given annotation and member.
      Specified by:
      intValue in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      THe OptionalInt value
    • intValue

      @Internal public OptionalInt intValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, @Nullable Function<Object,Object> valueMapper)
      Retrieve the int value and optionally map its value.
      Parameters:
      annotation - The annotation
      member - The member
      valueMapper - The value mapper
      Returns:
      The int value
    • booleanValue

      public Optional<Boolean> booleanValue(@NonNull String annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      The value as an optional boolean for the given annotation and member.
      Specified by:
      booleanValue in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      The string value if it is present
    • booleanValue

      public Optional<Boolean> booleanValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      The value as an optional boolean for the given annotation and member.
      Specified by:
      booleanValue in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      The string value if it is present
    • booleanValue

      public Optional<Boolean> booleanValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, Function<Object,Object> valueMapper)
      Retrieve the boolean value and optionally map its value.
      Parameters:
      annotation - The annotation
      member - The member
      valueMapper - The value mapper
      Returns:
      The boolean value
    • booleanValue

      public @NonNull Optional<Boolean> booleanValue(@NonNull String annotation, @NonNull String member, @Nullable Function<Object,Object> valueMapper)
      Retrieve the boolean value and optionally map its value.
      Parameters:
      annotation - The annotation
      member - The member
      valueMapper - The value mapper
      Returns:
      The boolean value
    • longValue

      public @NonNull OptionalLong longValue(@NonNull String annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      The value as an OptionalLong for the given annotation and member.
      Specified by:
      longValue in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      THe OptionalLong value
    • longValue

      public @NonNull OptionalLong longValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      The value as an OptionalLong for the given annotation and member.
      Specified by:
      longValue in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      THe OptionalLong value
    • longValue

      @Internal public OptionalLong longValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, @Nullable Function<Object,Object> valueMapper)
      Retrieve the long value and optionally map its value.
      Parameters:
      annotation - The annotation
      member - The member
      valueMapper - The value mapper
      Returns:
      The long value
    • longValue

      public @NonNull OptionalLong longValue(@NonNull String annotation, @NonNull String member, @Nullable Function<Object,Object> valueMapper)
      Retrieve the long value and optionally map its value.
      Parameters:
      annotation - The annotation
      member - The member
      valueMapper - The value mapper
      Returns:
      The long value
    • intValue

      public @NonNull OptionalInt intValue(@NonNull String annotation, @NonNull String member, @Nullable Function<Object,Object> valueMapper)
      Retrieve the int value and optionally map its value.
      Parameters:
      annotation - The annotation
      member - The member
      valueMapper - The value mapper
      Returns:
      The int value
    • stringValue

      public @NonNull Optional<String> stringValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      The value as an optional string for the given annotation and member.
      Specified by:
      stringValue in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      The string value if it is present
    • stringValue

      public Optional<String> stringValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, Function<Object,Object> valueMapper)
      Retrieve the string value and optionally map its value.
      Parameters:
      annotation - The annotation
      member - The member
      valueMapper - The value mapper
      Returns:
      The int value
    • stringValues

      public @NonNull String[] stringValues(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      The values as string array for the given annotation and member.
      Specified by:
      stringValues in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      The string values if it is present
    • stringValues

      public @NonNull String[] stringValues(@NonNull String annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      The values as string array for the given annotation and member.
      Specified by:
      stringValues in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      The string values if it is present
    • stringValues

      public @NonNull String[] stringValues(@NonNull Class<? extends Annotation> annotation, @NonNull String member, Function<Object,Object> valueMapper)
      Retrieve the string value and optionally map its value.
      Parameters:
      annotation - The annotation
      member - The member
      valueMapper - The value mapper
      Returns:
      The int value
    • stringValues

      public @NonNull String[] stringValues(@NonNull String annotation, @NonNull String member, Function<Object,Object> valueMapper)
      Retrieve the string value and optionally map its value.
      Parameters:
      annotation - The annotation
      member - The member
      valueMapper - The value mapper
      Returns:
      The int value
    • stringValue

      public @NonNull Optional<String> stringValue(@NonNull String annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      The value as an optional string for the given annotation and member.
      Specified by:
      stringValue in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      The string value if it is present
    • stringValue

      public @NonNull Optional<String> stringValue(@NonNull String annotation, @NonNull String member, @Nullable Function<Object,Object> valueMapper)
      Retrieve the string value and optionally map its value.
      Parameters:
      annotation - The annotation
      member - The member
      valueMapper - The value mapper
      Returns:
      The string value
    • isTrue

      public boolean isTrue(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      Returns whether the value of the given member is true.
      Specified by:
      isTrue in interface AnnotationMetadata
      Parameters:
      annotation - The annotation class
      member - The annotation member
      Returns:
      True if the value is true
    • isTrue

      public boolean isTrue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, Function<Object,Object> valueMapper)
      Retrieve the boolean value and optionally map its value.
      Parameters:
      annotation - The annotation
      member - The member
      valueMapper - The value mapper
      Returns:
      The boolean value
    • isTrue

      public boolean isTrue(@NonNull String annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      Returns whether the value of the given member is true.
      Specified by:
      isTrue in interface AnnotationMetadata
      Parameters:
      annotation - The annotation class
      member - The annotation member
      Returns:
      True if the value is true
    • isTrue

      public boolean isTrue(@NonNull String annotation, @NonNull String member, @Nullable Function<Object,Object> valueMapper)
      Retrieve the boolean value and optionally map its value.
      Parameters:
      annotation - The annotation
      member - The member
      valueMapper - The value mapper
      Returns:
      The boolean value
    • isFalse

      public boolean isFalse(@NonNull String annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      Returns whether the value of the given member is true.
      Specified by:
      isFalse in interface AnnotationMetadata
      Parameters:
      annotation - The annotation class
      member - The annotation member
      Returns:
      True if the value is true
    • doubleValue

      public @NonNull OptionalDouble doubleValue(@NonNull String annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      The value as an OptionalDouble for the given annotation and member.
      Specified by:
      doubleValue in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      THe OptionalDouble value
    • doubleValue

      public @NonNull OptionalDouble doubleValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
      Description copied from interface: AnnotationMetadata
      The value as an OptionalDouble for the given annotation and member.
      Specified by:
      doubleValue in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      member - The member
      Returns:
      THe OptionalDouble value
    • doubleValue

      @Internal public OptionalDouble doubleValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, @Nullable Function<Object,Object> valueMapper)
      Retrieve the double value and optionally map its value.
      Parameters:
      annotation - The annotation
      member - The member
      valueMapper - The value mapper
      Returns:
      The double value
    • doubleValue

      @Internal public @NonNull OptionalDouble doubleValue(@NonNull String annotation, @NonNull String member, Function<Object,Object> valueMapper)
      Retrieve the double value and optionally map its value.
      Parameters:
      annotation - The annotation
      member - The member
      valueMapper - The value mapper
      Returns:
      The double value
    • getValue

      public <T> @NonNull Optional<T> getValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, @NonNull Class<T> requiredType)
      Description copied from interface: AnnotationMetadata
      Get the value of the given annotation member.
      Specified by:
      getValue in interface AnnotationMetadata
      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

      public <T> @NonNull Optional<T> getValue(@NonNull String annotation, @NonNull String member, @NonNull Argument<T> requiredType)
      Description copied from interface: AnnotationMetadata
      Get the value of the given annotation member.
      Specified by:
      getValue in interface AnnotationMetadata
      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

      public <T> @NonNull Optional<T> getValue(@NonNull String annotation, @NonNull String member, @NonNull Argument<T> requiredType, @Nullable Function<Object,Object> valueMapper)
      Resolves the given value performing type conversion as necessary.
      Type Parameters:
      T - The generic type
      Parameters:
      annotation - The annotation
      member - The member
      requiredType - The required type
      valueMapper - The value mapper
      Returns:
      The resolved value
    • getDefaultValue

      public <T> @NonNull Optional<T> getDefaultValue(@NonNull String annotation, @NonNull String member, @NonNull Class<T> requiredType)
      Description copied from interface: AnnotationMetadata
      Return the default value for the given annotation member.
      Specified by:
      getDefaultValue in interface AnnotationMetadata
      Type Parameters:
      T - The required generic type
      Parameters:
      annotation - The annotation
      member - The member
      requiredType - The required type
      Returns:
      An optional value
    • getAnnotationValuesByType

      public <T extends Annotation> @NonNull List<AnnotationValue<T>> getAnnotationValuesByType(@Nullable Class<T> annotationType)
      Description copied from interface: AnnotationMetadata
      Gets all the annotation values by the given repeatable type.
      Specified by:
      getAnnotationValuesByType in interface AnnotationMetadata
      Type Parameters:
      T - The annotation type
      Parameters:
      annotationType - The annotation type
      Returns:
      A list of values
    • getAnnotationValuesByName

      public <T extends Annotation> List<AnnotationValue<T>> getAnnotationValuesByName(String annotationType)
      Description copied from interface: AnnotationMetadata
      Gets all the annotation values by the given repeatable type name.
      Specified by:
      getAnnotationValuesByName in interface AnnotationMetadata
      Type Parameters:
      T - The annotation type
      Parameters:
      annotationType - The annotation type
      Returns:
      A list of values
    • newAnnotationValue

      protected <T extends Annotation> @NonNull AnnotationValue<T> newAnnotationValue(String annotationType, Map<CharSequence,Object> values)
    • getDeclaredAnnotationValuesByType

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

      public <T extends Annotation> List<AnnotationValue<T>> getDeclaredAnnotationValuesByName(String annotationType)
      Description copied from interface: AnnotationMetadata
      Gets only declared annotation values by the given repeatable type name.
      Specified by:
      getDeclaredAnnotationValuesByName in interface AnnotationMetadata
      Type Parameters:
      T - The annotation type
      Parameters:
      annotationType - The annotation type
      Returns:
      A list of values
    • synthesizeAnnotationsByType

      public <T extends Annotation> T[] synthesizeAnnotationsByType(@NonNull Class<T> annotationClass)
      Description copied from interface: AnnotationSource
      Synthesizes a new annotations from the metadata for the given type. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.
      Specified by:
      synthesizeAnnotationsByType in interface AnnotationSource
      Type Parameters:
      T - The annotation generic type
      Parameters:
      annotationClass - The annotation type
      Returns:
      All annotations by the given type
    • synthesizeDeclaredAnnotationsByType

      public <T extends Annotation> T[] synthesizeDeclaredAnnotationsByType(@NonNull Class<T> annotationClass)
      Description copied from interface: AnnotationSource
      Synthesizes a new annotations from the metadata for the given type. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.
      Specified by:
      synthesizeDeclaredAnnotationsByType in interface AnnotationSource
      Type Parameters:
      T - The annotation generic type
      Parameters:
      annotationClass - The annotation type
      Returns:
      Declared annotations by the given type
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: AnnotationMetadata
      Is the annotation metadata empty.
      Specified by:
      isEmpty in interface AnnotationMetadata
      Returns:
      True if it is
    • hasDeclaredAnnotation

      public boolean hasDeclaredAnnotation(String annotation)
      Description copied from interface: AnnotationMetadata
      Checks whether this object has the given annotation directly declared on the object.
      Specified by:
      hasDeclaredAnnotation in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      Returns:
      True if the annotation is present
    • hasAnnotation

      public boolean hasAnnotation(String annotation)
      Description copied from interface: AnnotationMetadata
      Checks whether this object has the given annotation on the object itself or inherited from a parent.
      Specified by:
      hasAnnotation in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      Returns:
      True if the annotation is present
    • hasStereotype

      public boolean hasStereotype(String annotation)
      Description copied from interface: AnnotationMetadata

      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

      Specified by:
      hasStereotype in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      Returns:
      True if the annotation is present
    • hasStereotype

      public boolean hasStereotype(Class<? extends Annotation> annotation)
      Description copied from interface: AnnotationMetadata

      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

      Specified by:
      hasStereotype in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      Returns:
      True if the annotation is present
    • hasDeclaredStereotype

      public boolean hasDeclaredStereotype(String annotation)
      Description copied from interface: AnnotationMetadata

      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

      Specified by:
      hasDeclaredStereotype in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      Returns:
      True if the annotation is present
    • hasDeclaredAnnotation

      public boolean hasDeclaredAnnotation(Class<? extends Annotation> annotation)
      Description copied from interface: AnnotationMetadata
      Checks whether this object has the given annotation directly declared on the object.
      Specified by:
      hasDeclaredAnnotation in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      Returns:
      True if the annotation is present
    • getAnnotationTypeByStereotype

      public @NonNull Optional<Class<? extends Annotation>> getAnnotationTypeByStereotype(@Nullable String stereotype)
      Description copied from interface: AnnotationMetadata
      Find the first annotation name for the given stereotype.
      Specified by:
      getAnnotationTypeByStereotype in interface AnnotationMetadata
      Parameters:
      stereotype - The stereotype
      Returns:
      The annotation name
    • getAnnotationNameByStereotype

      public @NonNull Optional<String> getAnnotationNameByStereotype(@Nullable String stereotype)
      Description copied from interface: AnnotationMetadata
      Find the first annotation name for the given stereotype.
      Specified by:
      getAnnotationNameByStereotype in interface AnnotationMetadata
      Parameters:
      stereotype - The stereotype
      Returns:
      The annotation name
    • getAnnotationNamesByStereotype

      public @NonNull List<String> getAnnotationNamesByStereotype(@Nullable String stereotype)
      Description copied from interface: AnnotationMetadata
      Resolve all annotation names that feature the given stereotype.
      Specified by:
      getAnnotationNamesByStereotype in interface AnnotationMetadata
      Parameters:
      stereotype - The annotation names
      Returns:
      A set of annotation names
    • getAnnotationValuesByStereotype

      public <T extends Annotation> List<AnnotationValue<T>> getAnnotationValuesByStereotype(String stereotype)
      Description copied from interface: AnnotationMetadata
      Resolve all annotation values that feature the given stereotype.
      Specified by:
      getAnnotationValuesByStereotype in interface AnnotationMetadata
      Type Parameters:
      T - The annotation type
      Parameters:
      stereotype - The annotation names
      Returns:
      A set of annotation names
    • getAnnotationNames

      public @NonNull Set<String> getAnnotationNames()
      Description copied from interface: AnnotationMetadata
      All the annotation names this metadata declares.
      Specified by:
      getAnnotationNames in interface AnnotationMetadata
      Returns:
      All the annotation names this metadata declares
    • getStereotypeAnnotationNames

      public @NonNull Set<String> getStereotypeAnnotationNames()
      Description copied from interface: AnnotationMetadata
      Returns the names of the annotations which are stereotypes.

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

      Specified by:
      getStereotypeAnnotationNames in interface AnnotationMetadata
      Returns:
      The names of the stereotype annotations
      See Also:
    • getDeclaredStereotypeAnnotationNames

      public @NonNull Set<String> getDeclaredStereotypeAnnotationNames()
      Description copied from interface: AnnotationMetadata
      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.

      Specified by:
      getDeclaredStereotypeAnnotationNames in interface AnnotationMetadata
      Returns:
      The names of the stereotype annotations
      See Also:
    • getDeclaredAnnotationNames

      public @NonNull Set<String> getDeclaredAnnotationNames()
      Description copied from interface: AnnotationMetadata
      All the declared annotation names this metadata declares.
      Specified by:
      getDeclaredAnnotationNames in interface AnnotationMetadata
      Returns:
      All the declared annotation names this metadata declares
    • getDeclaredAnnotationNamesByStereotype

      public @NonNull List<String> getDeclaredAnnotationNamesByStereotype(@Nullable String stereotype)
      Description copied from interface: AnnotationMetadata
      Resolve all annotations names for the given stereotype that are declared annotations.
      Specified by:
      getDeclaredAnnotationNamesByStereotype in interface AnnotationMetadata
      Parameters:
      stereotype - The stereotype
      Returns:
      The declared annotations
    • getAnnotationType

      public @NonNull Optional<Class<? extends Annotation>> getAnnotationType(@NonNull String name)
      Description copied from interface: AnnotationMetadata
      Gets the type for a given annotation if it is present on the classpath. Subclasses can potentially override to provide optimized loading.
      Specified by:
      getAnnotationType in interface AnnotationMetadata
      Parameters:
      name - The type name
      Returns:
      The type if present
    • getAnnotationType

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

      public <T extends Annotation> @NonNull Optional<AnnotationValue<T>> findAnnotation(@NonNull String annotation)
      Description copied from interface: AnnotationSource
      Find an AnnotationValue for the given annotation name.
      Specified by:
      findAnnotation in interface AnnotationSource
      Type Parameters:
      T - The annotation type
      Parameters:
      annotation - The annotation name
      Returns:
      A AnnotationValue instance
    • findDeclaredAnnotation

      public <T extends Annotation> @NonNull Optional<AnnotationValue<T>> findDeclaredAnnotation(@NonNull String annotation)
      Description copied from interface: AnnotationSource
      Get all 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:
      annotation - The annotation name
      Returns:
      A AnnotationValue instance
    • getValues

      public <T> @NonNull OptionalValues<T> getValues(@NonNull String annotation, @NonNull Class<T> valueType)
      Description copied from interface: AnnotationMetadata
      Get all values for the given annotation and type of the underlying values.
      Specified by:
      getValues in interface AnnotationMetadata
      Type Parameters:
      T - Generic type
      Parameters:
      annotation - The annotation name
      valueType - valueType
      Returns:
      The OptionalValues
    • getValues

      public @NonNull Map<CharSequence,Object> getValues(@NonNull String annotation)
      Description copied from interface: AnnotationMetadata
      Get all values for the given annotation and type of the underlying values.
      Specified by:
      getValues in interface AnnotationMetadata
      Parameters:
      annotation - The annotation name
      Returns:
      An immutable map of values
    • getDefaultValue

      public <T> @NonNull Optional<T> getDefaultValue(@NonNull String annotation, @NonNull String member, @NonNull Argument<T> requiredType)
      Description copied from interface: AnnotationMetadata
      Return the default value for the given annotation member.
      Specified by:
      getDefaultValue in interface AnnotationMetadata
      Type Parameters:
      T - The required generic type
      Parameters:
      annotation - The annotation
      member - The member
      requiredType - The required type
      Returns:
      An optional value
    • isRepeatableAnnotation

      public boolean isRepeatableAnnotation(Class<? extends Annotation> annotation)
      Description copied from interface: AnnotationMetadata
      Is repeatable annotation?
      Specified by:
      isRepeatableAnnotation in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      Returns:
      true if repeatable
    • isRepeatableAnnotation

      public boolean isRepeatableAnnotation(String annotation)
      Description copied from interface: AnnotationMetadata
      Is repeatable annotation?
      Specified by:
      isRepeatableAnnotation in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      Returns:
      true if repeatable
    • findRepeatableAnnotation

      public Optional<String> findRepeatableAnnotation(Class<? extends Annotation> annotation)
      Description copied from interface: AnnotationMetadata
      Find repeatable annotation container.
      Specified by:
      findRepeatableAnnotation in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      Returns:
      optional repeatable annotation container
    • findRepeatableAnnotation

      public Optional<String> findRepeatableAnnotation(String annotation)
      Description copied from interface: AnnotationMetadata
      Find repeatable annotation container.
      Specified by:
      findRepeatableAnnotation in interface AnnotationMetadata
      Parameters:
      annotation - The annotation
      Returns:
      optional repeatable annotation container
    • copyAnnotationMetadata

      public AnnotationMetadata copyAnnotationMetadata()
      Description copied from interface: AnnotationMetadata
      Makes a copy of the annotation or returns this.
      Specified by:
      copyAnnotationMetadata in interface AnnotationMetadata
      Returns:
      the copy
    • clone

      public DefaultAnnotationMetadata clone()
      Overrides:
      clone in class Object
    • cloneMapOfMapValue

      protected final <X, Y, K> Map<K,Map<X,Y>> cloneMapOfMapValue(Map<K,Map<X,Y>> toClone)
    • cloneMapOfListValue

      protected final <K, V> Map<K,List<V>> cloneMapOfListValue(Map<K,List<V>> toClone)
    • cloneMap

      protected final <K, V> Map<K,V> cloneMap(Map<K,V> map)
    • registerAnnotationDefaults

      @Internal public static void registerAnnotationDefaults(String annotation, Map<CharSequence,Object> defaultValues)
      Registers annotation default values. Used by generated byte code. DO NOT REMOVE.
      Parameters:
      annotation - The annotation name
      defaultValues - The default values
    • registerAnnotationDefaults

      @Internal public static void registerAnnotationDefaults(AnnotationClassValue<?> annotation, Map<CharSequence,Object> defaultValues)
      Registers annotation default values. Used by generated byte code. DO NOT REMOVE.
      Parameters:
      annotation - The annotation name
      defaultValues - The default values
    • registerAnnotationType

      @Internal public static void registerAnnotationType(AnnotationClassValue<?> annotation)
      Registers annotation default values. Used by generated byte code. DO NOT REMOVE.
      Parameters:
      annotation - The annotation
    • registerRepeatableAnnotations

      @Internal public static void registerRepeatableAnnotations(Map<String,String> repeatableAnnotations)
      Registers repeatable annotations. Annotation container -> annotations item. Used by generated byte code. DO NOT REMOVE.
      Parameters:
      repeatableAnnotations - The annotation
    • findRepeatableAnnotationContainerInternal

      protected @Nullable String findRepeatableAnnotationContainerInternal(@NonNull String annotation)
      Find annotation's repeatable container.
      Parameters:
      annotation - The annotation
      Returns:
      the repeatable container or null
    • synthesize

      public <T extends Annotation> @Nullable T synthesize(@NonNull Class<T> annotationClass)
      Description copied from interface: AnnotationSource
      Synthesizes a new annotation from the metadata for the given annotation type. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.
      Specified by:
      synthesize in interface AnnotationSource
      Type Parameters:
      T - The annotation generic type
      Parameters:
      annotationClass - The annotation class
      Returns:
      The annotation or null if it doesn't exist
    • synthesize

      public <T extends Annotation> @Nullable T synthesize(@NonNull Class<T> annotationClass, @NonNull String sourceAnnotation)
      Description copied from interface: AnnotationSource
      Synthesizes a new annotation for the given annotation type using the member values of the given source annotation.

      This method allows supporting synthesizing annotations that have been renamed, for example a jakarta.inject.Named annotation an be synthesized from the metadata of the a jakarta.inject.Named annotation.

      Specified by:
      synthesize in interface AnnotationSource
      Type Parameters:
      T - The annotation generic type
      Parameters:
      annotationClass - The annotation class
      sourceAnnotation - The source annotation that provides the member values
      Returns:
      The annotation or null if it doesn't exist
    • synthesizeDeclared

      public <T extends Annotation> @Nullable T synthesizeDeclared(@NonNull Class<T> annotationClass, @NonNull String sourceAnnotation)
      Description copied from interface: AnnotationSource
      Synthesizes a new annotation declared for the given annotation type using the member values of the given source annotation.

      This method allows supporting synthesizing annotations that have been renamed, for example a jakarta.inject.Named annotation an be synthesized from the metadata of the a jakarta.inject.Named annotation.

      Specified by:
      synthesizeDeclared in interface AnnotationSource
      Type Parameters:
      T - The annotation generic type
      Parameters:
      annotationClass - The annotation class
      sourceAnnotation - The source annotation that provides the member values
      Returns:
      The annotation or null if it doesn't exist
    • synthesizeDeclared

      public <T extends Annotation> @Nullable T synthesizeDeclared(@NonNull Class<T> annotationClass)
      Description copied from interface: AnnotationSource
      Synthesizes a new annotation from the metadata for the given annotation type. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.

      This method ignores inherited annotations. (Returns null if no annotations are directly present on this element.)

      Specified by:
      synthesizeDeclared in interface AnnotationSource
      Type Parameters:
      T - The annotation generic type
      Parameters:
      annotationClass - The annotation class
      Returns:
      The annotation or null if it doesn't exist
    • synthesizeAll

      public @NonNull Annotation[] synthesizeAll()
      Description copied from interface: AnnotationSource
      Synthesizes a new annotations from the metadata. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.
      Specified by:
      synthesizeAll in interface AnnotationSource
      Returns:
      All the annotations
    • synthesizeDeclared

      public @NonNull Annotation[] synthesizeDeclared()
      Description copied from interface: AnnotationSource
      Synthesizes a new annotations from the metadata. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.
      Specified by:
      synthesizeDeclared in interface AnnotationSource
      Returns:
      All declared annotations