Package io.micronaut.inject.annotation
Class DefaultAnnotationMetadata
- java.lang.Object
-
- io.micronaut.inject.annotation.DefaultAnnotationMetadata
-
- All Implemented Interfaces:
io.micronaut.core.annotation.AnnotationMetadata
,io.micronaut.core.annotation.AnnotationSource
,java.lang.Cloneable
- Direct Known Subclasses:
MutableAnnotationMetadata
@Internal public class DefaultAnnotationMetadata extends java.lang.Object implements io.micronaut.core.annotation.AnnotationMetadata, java.lang.Cloneable
Default implementation ofAnnotationMetadata
.NOTE: Although required to be public This is an internal class and should not be referenced directly in user code
- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,java.lang.annotation.Annotation>
annotationMap
protected java.util.Map<java.lang.String,java.lang.annotation.Annotation>
declaredAnnotationMap
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultAnnotationMetadata()
Constructs empty annotation metadata.DefaultAnnotationMetadata(java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> declaredAnnotations, java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> declaredStereotypes, java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> allStereotypes, java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> allAnnotations, java.util.Map<java.lang.String,java.util.List<java.lang.String>> annotationsByStereotype)
This constructor is designed to be used by compile time produced subclasses.DefaultAnnotationMetadata(java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> declaredAnnotations, java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> declaredStereotypes, java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> allStereotypes, java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> allAnnotations, java.util.Map<java.lang.String,java.util.List<java.lang.String>> annotationsByStereotype, boolean hasPropertyExpressions)
This constructor is designed to be used by compile time produced subclasses.DefaultAnnotationMetadata(java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> declaredAnnotations, java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> declaredStereotypes, java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> allStereotypes, java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> allAnnotations, java.util.Map<java.lang.String,java.util.List<java.lang.String>> annotationsByStereotype, boolean hasPropertyExpressions, boolean useRepeatableDefaults)
This constructor is designed to be used by compile time produced subclasses.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addAnnotation(java.lang.String annotation, java.util.Map<java.lang.CharSequence,java.lang.Object> values)
Adds an annotation and its member values, if the annotation already exists the data will be merged with existing values replaced.protected void
addAnnotation(java.lang.String annotation, java.util.Map<java.lang.CharSequence,java.lang.Object> values, java.lang.annotation.RetentionPolicy retentionPolicy)
Adds an annotation and its member values, if the annotation already exists the data will be merged with existing values replaced.protected void
addAnnotationValuesFromData(java.util.List results, java.util.Map<java.lang.CharSequence,java.lang.Object> values)
Adds any annotation values found in the values map to the results.protected void
addDeclaredAnnotation(java.lang.String annotation, java.util.Map<java.lang.CharSequence,java.lang.Object> values)
Adds an annotation directly declared on the element and its member values, if the annotation already exists the data will be merged with existing values replaced.protected void
addDeclaredAnnotation(java.lang.String annotation, java.util.Map<java.lang.CharSequence,java.lang.Object> values, java.lang.annotation.RetentionPolicy retentionPolicy)
Adds an annotation directly declared on the element and its member values, if the annotation already exists the data will be merged with existing values replaced.protected void
addDeclaredRepeatable(java.lang.String annotationName, io.micronaut.core.annotation.AnnotationValue annotationValue)
Adds a repeatable annotation value.protected void
addDeclaredRepeatable(java.lang.String annotationName, io.micronaut.core.annotation.AnnotationValue annotationValue, java.lang.annotation.RetentionPolicy retentionPolicy)
Adds a repeatable annotation value.protected void
addDeclaredRepeatableStereotype(java.util.List<java.lang.String> parents, java.lang.String stereotype, io.micronaut.core.annotation.AnnotationValue annotationValue)
Adds a repeatable declared stereotype value.protected void
addDeclaredStereotype(java.util.List<java.lang.String> parentAnnotations, java.lang.String stereotype, java.util.Map<java.lang.CharSequence,java.lang.Object> values)
Adds a stereotype and its member values, if the annotation already exists the data will be merged with existing values replaced.protected void
addDeclaredStereotype(java.util.List<java.lang.String> parentAnnotations, java.lang.String stereotype, java.util.Map<java.lang.CharSequence,java.lang.Object> values, java.lang.annotation.RetentionPolicy retentionPolicy)
Adds a stereotype and its member values, if the annotation already exists the data will be merged with existing values replaced.protected void
addDefaultAnnotationValues(java.lang.String annotation, java.util.Map<java.lang.CharSequence,java.lang.Object> values)
Adds an annotation directly declared on the element and its member values, if the annotation already exists the data will be merged with existing values replaced.protected void
addRepeatable(java.lang.String annotationName, io.micronaut.core.annotation.AnnotationValue annotationValue)
Adds a repeatable annotation value.protected void
addRepeatable(java.lang.String annotationName, io.micronaut.core.annotation.AnnotationValue annotationValue, java.lang.annotation.RetentionPolicy retentionPolicy)
Adds a repeatable annotation value.protected void
addRepeatableStereotype(java.util.List<java.lang.String> parents, java.lang.String stereotype, io.micronaut.core.annotation.AnnotationValue annotationValue)
Adds a repeatable stereotype value.protected void
addStereotype(java.util.List<java.lang.String> parentAnnotations, java.lang.String stereotype, java.util.Map<java.lang.CharSequence,java.lang.Object> values)
Adds a stereotype and its member values, if the annotation already exists the data will be merged with existing values replaced.protected void
addStereotype(java.util.List<java.lang.String> parentAnnotations, java.lang.String stereotype, java.util.Map<java.lang.CharSequence,java.lang.Object> values, java.lang.annotation.RetentionPolicy retentionPolicy)
Adds a stereotype and its member values, if the annotation already exists the data will be merged with existing values replaced.protected void
addValuesToResults(java.util.List<io.micronaut.core.annotation.AnnotationValue> results, io.micronaut.core.annotation.AnnotationValue values)
Adds a values instance to the results.static boolean
areAnnotationDefaultsRegistered(java.lang.String annotation)
Returns whether annotation defaults are registered for the give annotation.java.util.Optional<java.lang.Boolean>
booleanValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member)
java.util.Optional<java.lang.Boolean>
booleanValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the boolean value and optionally map its value.java.util.Optional<java.lang.Boolean>
booleanValue(java.lang.String annotation, java.lang.String member)
java.util.Optional<java.lang.Boolean>
booleanValue(java.lang.String annotation, java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the boolean value and optionally map its value.java.util.Optional<java.lang.Class>
classValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member)
java.util.Optional<java.lang.Class>
classValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the class value and optionally map its value.java.util.Optional<java.lang.Class>
classValue(java.lang.String annotation, java.lang.String member)
java.util.Optional<java.lang.Class>
classValue(java.lang.String annotation, java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the class value and optionally map its value.<T> java.lang.Class<T>[]
classValues(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member)
<T> java.lang.Class<T>[]
classValues(java.lang.String annotation, java.lang.String member)
DefaultAnnotationMetadata
clone()
protected <K,V>
java.util.Map<K,V>cloneMap(java.util.Map<K,V> map)
protected <K,V>
java.util.Map<K,java.util.List<V>>cloneMapOfListValue(java.util.Map<K,java.util.List<V>> toClone)
protected <X,Y,K>
java.util.Map<K,java.util.Map<X,Y>>cloneMapOfMapValue(java.util.Map<K,java.util.Map<X,Y>> toClone)
static void
contributeDefaults(io.micronaut.core.annotation.AnnotationMetadata target, io.micronaut.core.annotation.AnnotationMetadata source)
Contributes defaults to the given target.static void
contributeRepeatable(io.micronaut.core.annotation.AnnotationMetadata target, io.micronaut.core.annotation.AnnotationMetadata source)
Contributes repeatable annotation metadata to the given target.static void
contributeRepeatable(io.micronaut.core.annotation.AnnotationMetadata target, ClassElement classElement)
Contributes repeatable annotation metadata to the given class element.java.util.OptionalDouble
doubleValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member)
java.util.OptionalDouble
doubleValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the double value and optionally map its value.java.util.OptionalDouble
doubleValue(java.lang.String annotation, java.lang.String member)
java.util.OptionalDouble
doubleValue(java.lang.String annotation, java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the double value and optionally map its value.<E extends java.lang.Enum>
java.util.Optional<E>enumValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.Class<E> enumType)
<E extends java.lang.Enum>
java.util.Optional<E>enumValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member, java.lang.Class<E> enumType)
<E extends java.lang.Enum>
java.util.Optional<E>enumValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member, java.lang.Class<E> enumType, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the class value and optionally map its value.<E extends java.lang.Enum>
java.util.Optional<E>enumValue(java.lang.String annotation, java.lang.Class<E> enumType)
<E extends java.lang.Enum>
java.util.Optional<E>enumValue(java.lang.String annotation, java.lang.String member, java.lang.Class<E> enumType)
<E extends java.lang.Enum>
java.util.Optional<E>enumValue(java.lang.String annotation, java.lang.String member, java.lang.Class<E> enumType, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the class value and optionally map its value.<E extends java.lang.Enum>
E[]enumValues(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.Class<E> enumType)
<E extends java.lang.Enum>
E[]enumValues(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member, java.lang.Class<E> enumType)
<E extends java.lang.Enum>
E[]enumValues(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member, java.lang.Class<E> enumType, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
<E extends java.lang.Enum>
E[]enumValues(java.lang.String annotation, java.lang.Class<E> enumType)
<E extends java.lang.Enum>
E[]enumValues(java.lang.String annotation, java.lang.String member, java.lang.Class<E> enumType)
<E extends java.lang.Enum>
E[]enumValues(java.lang.String annotation, java.lang.String member, java.lang.Class<E> enumType, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
<T extends java.lang.annotation.Annotation>
java.util.Optional<io.micronaut.core.annotation.AnnotationValue<T>>findAnnotation(java.lang.String annotation)
<T extends java.lang.annotation.Annotation>
java.util.Optional<io.micronaut.core.annotation.AnnotationValue<T>>findDeclaredAnnotation(java.lang.String annotation)
java.util.Optional<java.lang.String>
findRepeatableAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
java.util.Optional<java.lang.String>
findRepeatableAnnotation(java.lang.String annotation)
java.util.Optional<java.lang.String>
getAnnotationNameByStereotype(java.lang.String stereotype)
java.util.Set<java.lang.String>
getAnnotationNames()
java.util.List<java.lang.String>
getAnnotationNamesByStereotype(java.lang.String stereotype)
java.util.Optional<java.lang.Class<? extends java.lang.annotation.Annotation>>
getAnnotationType(java.lang.String name)
java.util.Optional<java.lang.Class<? extends java.lang.annotation.Annotation>>
getAnnotationType(java.lang.String name, java.lang.ClassLoader classLoader)
java.util.Optional<java.lang.Class<? extends java.lang.annotation.Annotation>>
getAnnotationTypeByStereotype(java.lang.String stereotype)
<T extends java.lang.annotation.Annotation>
java.util.List<io.micronaut.core.annotation.AnnotationValue<T>>getAnnotationValuesByName(java.lang.String annotationType)
<T extends java.lang.annotation.Annotation>
java.util.List<io.micronaut.core.annotation.AnnotationValue<T>>getAnnotationValuesByStereotype(java.lang.String stereotype)
<T extends java.lang.annotation.Annotation>
java.util.List<io.micronaut.core.annotation.AnnotationValue<T>>getAnnotationValuesByType(java.lang.Class<T> annotationType)
java.util.Set<java.lang.String>
getDeclaredAnnotationNames()
java.util.List<java.lang.String>
getDeclaredAnnotationNamesByStereotype(java.lang.String stereotype)
<T extends java.lang.annotation.Annotation>
java.util.List<io.micronaut.core.annotation.AnnotationValue<T>>getDeclaredAnnotationValuesByName(java.lang.String annotationType)
<T extends java.lang.annotation.Annotation>
java.util.List<io.micronaut.core.annotation.AnnotationValue<T>>getDeclaredAnnotationValuesByType(java.lang.Class<T> annotationType)
io.micronaut.core.annotation.AnnotationMetadata
getDeclaredMetadata()
java.util.Set<java.lang.String>
getDeclaredStereotypeAnnotationNames()
<T> java.util.Optional<T>
getDefaultValue(java.lang.String annotation, java.lang.String member, io.micronaut.core.type.Argument<T> requiredType)
<T> java.util.Optional<T>
getDefaultValue(java.lang.String annotation, java.lang.String member, java.lang.Class<T> requiredType)
java.util.Map<java.lang.String,java.lang.Object>
getDefaultValues(java.lang.String annotation)
java.util.Set<java.lang.String>
getStereotypeAnnotationNames()
<T> java.util.Optional<T>
getValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member, java.lang.Class<T> requiredType)
<T> java.util.Optional<T>
getValue(java.lang.String annotation, java.lang.String member, io.micronaut.core.type.Argument<T> requiredType)
<T> java.util.Optional<T>
getValue(java.lang.String annotation, java.lang.String member, io.micronaut.core.type.Argument<T> requiredType, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Resolves the given value performing type conversion as necessary.java.util.Map<java.lang.CharSequence,java.lang.Object>
getValues(java.lang.String annotation)
<T> io.micronaut.core.value.OptionalValues<T>
getValues(java.lang.String annotation, java.lang.Class<T> valueType)
boolean
hasAnnotation(java.lang.String annotation)
boolean
hasDeclaredAnnotation(java.lang.String annotation)
boolean
hasDeclaredStereotype(java.lang.String annotation)
boolean
hasPropertyExpressions()
boolean
hasStereotype(java.lang.String annotation)
java.util.OptionalInt
intValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member)
java.util.OptionalInt
intValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the int value and optionally map its value.java.util.OptionalInt
intValue(java.lang.String annotation, java.lang.String member)
java.util.OptionalInt
intValue(java.lang.String annotation, java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the int value and optionally map its value.boolean
isEmpty()
boolean
isFalse(java.lang.String annotation, java.lang.String member)
boolean
isPresent(java.lang.String annotation, java.lang.String member)
boolean
isRepeatableAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
boolean
isRepeatableAnnotation(java.lang.String annotation)
boolean
isTrue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member)
boolean
isTrue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the boolean value and optionally map its value.boolean
isTrue(java.lang.String annotation, java.lang.String member)
boolean
isTrue(java.lang.String annotation, java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the boolean value and optionally map its value.java.util.OptionalLong
longValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member)
java.util.OptionalLong
longValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the long value and optionally map its value.java.util.OptionalLong
longValue(java.lang.String annotation, java.lang.String member)
java.util.OptionalLong
longValue(java.lang.String annotation, java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the long value and optionally map its value.static io.micronaut.core.annotation.AnnotationMetadata
mutateMember(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, java.lang.String annotationName, java.lang.String member, java.lang.Object value)
Sets a member of the givenAnnotationMetadata
return a new annotation metadata instance without mutating the existing.static io.micronaut.core.annotation.AnnotationMetadata
mutateMember(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, java.lang.String annotationName, java.util.Map<java.lang.CharSequence,java.lang.Object> members)
Sets a member of the givenAnnotationMetadata
return a new annotation metadata instance without mutating the existing.static void
registerAnnotationDefaults(io.micronaut.core.annotation.AnnotationClassValue<?> annotation, java.util.Map<java.lang.String,java.lang.Object> defaultValues)
Registers annotation default values.static void
registerAnnotationDefaults(java.lang.String annotation, java.util.Map<java.lang.String,java.lang.Object> defaultValues)
Registers annotation default values.static void
registerAnnotationType(io.micronaut.core.annotation.AnnotationClassValue<?> annotation)
Registers annotation default values.static void
registerRepeatableAnnotations(java.util.Map<java.lang.String,java.lang.String> repeatableAnnotations)
Registers repeatable annotations.protected void
removeAnnotation(java.lang.String annotationType)
Removes an annotation for the given annotation type.protected <A extends java.lang.annotation.Annotation>
voidremoveAnnotationIf(java.util.function.Predicate<io.micronaut.core.annotation.AnnotationValue<A>> predicate)
Removes an annotation for the given predicate.protected void
removeStereotype(java.lang.String annotationType)
Removes a stereotype annotation for the given annotation type.java.util.Optional<java.lang.String>
stringValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member)
java.util.Optional<java.lang.String>
stringValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the string value and optionally map its value.java.util.Optional<java.lang.String>
stringValue(java.lang.String annotation, java.lang.String member)
java.util.Optional<java.lang.String>
stringValue(java.lang.String annotation, java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the string value and optionally map its value.java.lang.String[]
stringValues(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member)
java.lang.String[]
stringValues(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the string value and optionally map its value.java.lang.String[]
stringValues(java.lang.String annotation, java.lang.String member)
java.lang.String[]
stringValues(java.lang.String annotation, java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the string value and optionally map its value.<T extends java.lang.annotation.Annotation>
Tsynthesize(java.lang.Class<T> annotationClass)
<T extends java.lang.annotation.Annotation>
Tsynthesize(java.lang.Class<T> annotationClass, java.lang.String sourceAnnotation)
java.lang.annotation.Annotation[]
synthesizeAll()
<T extends java.lang.annotation.Annotation>
T[]synthesizeAnnotationsByType(java.lang.Class<T> annotationClass)
java.lang.annotation.Annotation[]
synthesizeDeclared()
<T extends java.lang.annotation.Annotation>
TsynthesizeDeclared(java.lang.Class<T> annotationClass)
<T extends java.lang.annotation.Annotation>
TsynthesizeDeclared(java.lang.Class<T> annotationClass, java.lang.String sourceAnnotation)
<T extends java.lang.annotation.Annotation>
T[]synthesizeDeclaredAnnotationsByType(java.lang.Class<T> annotationClass)
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadata
booleanValue, booleanValue, classValue, classValue, classValues, classValues, doubleValue, findAnnotation, findDeclaredAnnotation, getAnnotationNameByStereotype, getAnnotationNamesByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDefaultValue, getDefaultValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, hasAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, intValue, isAnnotationPresent, isAnnotationPresent, isDeclaredAnnotationPresent, isDeclaredAnnotationPresent, isFalse, isPresent, stringValue, stringValue, stringValues, stringValues
-
-
-
-
Constructor Detail
-
DefaultAnnotationMetadata
@Internal protected DefaultAnnotationMetadata()
Constructs empty annotation metadata.
-
DefaultAnnotationMetadata
@Internal public DefaultAnnotationMetadata(@Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> declaredAnnotations, @Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> declaredStereotypes, @Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> allStereotypes, @Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> allAnnotations, @Nullable java.util.Map<java.lang.String,java.util.List<java.lang.String>> annotationsByStereotype)
This constructor is designed to be used by compile time produced subclasses.- Parameters:
declaredAnnotations
- The directly declared annotationsdeclaredStereotypes
- The directly declared stereotypesallStereotypes
- All of the stereotypesallAnnotations
- All of the annotationsannotationsByStereotype
- The annotations by stereotype
-
DefaultAnnotationMetadata
@Internal public DefaultAnnotationMetadata(@Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> declaredAnnotations, @Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> declaredStereotypes, @Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> allStereotypes, @Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> allAnnotations, @Nullable java.util.Map<java.lang.String,java.util.List<java.lang.String>> annotationsByStereotype, boolean hasPropertyExpressions)
This constructor is designed to be used by compile time produced subclasses.- Parameters:
declaredAnnotations
- The directly declared annotationsdeclaredStereotypes
- The directly declared stereotypesallStereotypes
- All of the stereotypesallAnnotations
- All of the annotationsannotationsByStereotype
- The annotations by stereotypehasPropertyExpressions
- Whether property expressions exist in the metadata
-
DefaultAnnotationMetadata
@Internal public DefaultAnnotationMetadata(@Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> declaredAnnotations, @Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> declaredStereotypes, @Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> allStereotypes, @Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.CharSequence,java.lang.Object>> allAnnotations, @Nullable java.util.Map<java.lang.String,java.util.List<java.lang.String>> annotationsByStereotype, boolean hasPropertyExpressions, boolean useRepeatableDefaults)
This constructor is designed to be used by compile time produced subclasses.- Parameters:
declaredAnnotations
- The directly declared annotationsdeclaredStereotypes
- The directly declared stereotypesallStereotypes
- All of the stereotypesallAnnotations
- All of the annotationsannotationsByStereotype
- The annotations by stereotypehasPropertyExpressions
- Whether property expressions exist in the metadatauseRepeatableDefaults
- Use repeatable defaults
-
-
Method Detail
-
getDeclaredMetadata
@NonNull public io.micronaut.core.annotation.AnnotationMetadata getDeclaredMetadata()
- Specified by:
getDeclaredMetadata
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
hasPropertyExpressions
public boolean hasPropertyExpressions()
- Specified by:
hasPropertyExpressions
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getDefaultValues
@NonNull public java.util.Map<java.lang.String,java.lang.Object> getDefaultValues(@NonNull java.lang.String annotation)
- Specified by:
getDefaultValues
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
isPresent
public boolean isPresent(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
- Specified by:
isPresent
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
enumValue
public <E extends java.lang.Enum> java.util.Optional<E> enumValue(@NonNull java.lang.String annotation, java.lang.Class<E> enumType)
- Specified by:
enumValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
enumValue
public <E extends java.lang.Enum> java.util.Optional<E> enumValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, java.lang.Class<E> enumType)
- Specified by:
enumValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
enumValue
public <E extends java.lang.Enum> java.util.Optional<E> enumValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.Class<E> enumType)
- Specified by:
enumValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
enumValue
public <E extends java.lang.Enum> java.util.Optional<E> enumValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, java.lang.Class<E> enumType)
- Specified by:
enumValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
enumValue
@Internal public <E extends java.lang.Enum> java.util.Optional<E> enumValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, java.lang.Class<E> enumType, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the class value and optionally map its value.- Type Parameters:
E
- The enum type- Parameters:
annotation
- The annotationmember
- The memberenumType
- The enum typevalueMapper
- The value mapper- Returns:
- The class value
-
enumValues
public <E extends java.lang.Enum> E[] enumValues(@NonNull java.lang.String annotation, java.lang.Class<E> enumType)
- Specified by:
enumValues
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
enumValues
public <E extends java.lang.Enum> E[] enumValues(@NonNull java.lang.String annotation, @NonNull java.lang.String member, java.lang.Class<E> enumType)
- Specified by:
enumValues
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
enumValues
public <E extends java.lang.Enum> E[] enumValues(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.Class<E> enumType)
- Specified by:
enumValues
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
enumValues
public <E extends java.lang.Enum> E[] enumValues(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, java.lang.Class<E> enumType)
- Specified by:
enumValues
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
enumValues
public <E extends java.lang.Enum> E[] enumValues(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, java.lang.Class<E> enumType, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
-
enumValues
public <E extends java.lang.Enum> E[] enumValues(@NonNull java.lang.String annotation, @NonNull java.lang.String member, java.lang.Class<E> enumType, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
-
enumValue
@Internal public <E extends java.lang.Enum> java.util.Optional<E> enumValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, java.lang.Class<E> enumType, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the class value and optionally map its value.- Type Parameters:
E
- The enum type- Parameters:
annotation
- The annotationmember
- The memberenumType
- The enum typevalueMapper
- The value mapper- Returns:
- The class value
-
classValues
public <T> java.lang.Class<T>[] classValues(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
- Specified by:
classValues
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
classValues
public <T> java.lang.Class<T>[] classValues(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member)
- Specified by:
classValues
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
classValue
@NonNull public java.util.Optional<java.lang.Class> classValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member)
- Specified by:
classValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
classValue
public java.util.Optional<java.lang.Class> classValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the class value and optionally map its value.- Parameters:
annotation
- The annotationmember
- The membervalueMapper
- The value mapper- Returns:
- The class value
-
classValue
@NonNull public java.util.Optional<java.lang.Class> classValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
- Specified by:
classValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
classValue
@Internal public java.util.Optional<java.lang.Class> classValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the class value and optionally map its value.- Parameters:
annotation
- The annotationmember
- The membervalueMapper
- The value mapper- Returns:
- The class value
-
intValue
@NonNull public java.util.OptionalInt intValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
- Specified by:
intValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
intValue
@NonNull public java.util.OptionalInt intValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member)
- Specified by:
intValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
intValue
@Internal public java.util.OptionalInt intValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the int value and optionally map its value.- Parameters:
annotation
- The annotationmember
- The membervalueMapper
- The value mapper- Returns:
- The int value
-
booleanValue
public java.util.Optional<java.lang.Boolean> booleanValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
- Specified by:
booleanValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
booleanValue
public java.util.Optional<java.lang.Boolean> booleanValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member)
- Specified by:
booleanValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
booleanValue
public java.util.Optional<java.lang.Boolean> booleanValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the boolean value and optionally map its value.- Parameters:
annotation
- The annotationmember
- The membervalueMapper
- The value mapper- Returns:
- The boolean value
-
booleanValue
@NonNull public java.util.Optional<java.lang.Boolean> booleanValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the boolean value and optionally map its value.- Parameters:
annotation
- The annotationmember
- The membervalueMapper
- The value mapper- Returns:
- The boolean value
-
longValue
@NonNull public java.util.OptionalLong longValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
- Specified by:
longValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
longValue
@NonNull public java.util.OptionalLong longValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member)
- Specified by:
longValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
longValue
@Internal public java.util.OptionalLong longValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the long value and optionally map its value.- Parameters:
annotation
- The annotationmember
- The membervalueMapper
- The value mapper- Returns:
- The long value
-
longValue
@NonNull public java.util.OptionalLong longValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the long value and optionally map its value.- Parameters:
annotation
- The annotationmember
- The membervalueMapper
- The value mapper- Returns:
- The long value
-
intValue
@NonNull public java.util.OptionalInt intValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the int value and optionally map its value.- Parameters:
annotation
- The annotationmember
- The membervalueMapper
- The value mapper- Returns:
- The int value
-
stringValue
@NonNull public java.util.Optional<java.lang.String> stringValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member)
- Specified by:
stringValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
stringValue
public java.util.Optional<java.lang.String> stringValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the string value and optionally map its value.- Parameters:
annotation
- The annotationmember
- The membervalueMapper
- The value mapper- Returns:
- The int value
-
stringValues
@NonNull public java.lang.String[] stringValues(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member)
- Specified by:
stringValues
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
stringValues
@NonNull public java.lang.String[] stringValues(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
- Specified by:
stringValues
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
stringValues
@NonNull public java.lang.String[] stringValues(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the string value and optionally map its value.- Parameters:
annotation
- The annotationmember
- The membervalueMapper
- The value mapper- Returns:
- The int value
-
stringValues
@NonNull public java.lang.String[] stringValues(@NonNull java.lang.String annotation, @NonNull java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the string value and optionally map its value.- Parameters:
annotation
- The annotationmember
- The membervalueMapper
- The value mapper- Returns:
- The int value
-
stringValue
@NonNull public java.util.Optional<java.lang.String> stringValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
- Specified by:
stringValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
stringValue
@NonNull public java.util.Optional<java.lang.String> stringValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the string value and optionally map its value.- Parameters:
annotation
- The annotationmember
- The membervalueMapper
- The value mapper- Returns:
- The string value
-
isTrue
public boolean isTrue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member)
- Specified by:
isTrue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
isTrue
public boolean isTrue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the boolean value and optionally map its value.- Parameters:
annotation
- The annotationmember
- The membervalueMapper
- The value mapper- Returns:
- The boolean value
-
isTrue
public boolean isTrue(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
- Specified by:
isTrue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
isTrue
public boolean isTrue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the boolean value and optionally map its value.- Parameters:
annotation
- The annotationmember
- The membervalueMapper
- The value mapper- Returns:
- The boolean value
-
isFalse
public boolean isFalse(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
- Specified by:
isFalse
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
doubleValue
@NonNull public java.util.OptionalDouble doubleValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
- Specified by:
doubleValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
doubleValue
@NonNull public java.util.OptionalDouble doubleValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member)
- Specified by:
doubleValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
doubleValue
@Internal public java.util.OptionalDouble doubleValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the double value and optionally map its value.- Parameters:
annotation
- The annotationmember
- The membervalueMapper
- The value mapper- Returns:
- The double value
-
doubleValue
@NonNull @Internal public java.util.OptionalDouble doubleValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the double value and optionally map its value.- Parameters:
annotation
- The annotationmember
- The membervalueMapper
- The value mapper- Returns:
- The double value
-
getValue
@NonNull public <T> java.util.Optional<T> getValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, @NonNull java.lang.Class<T> requiredType)
- Specified by:
getValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getValue
@NonNull public <T> java.util.Optional<T> getValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, @NonNull io.micronaut.core.type.Argument<T> requiredType)
- Specified by:
getValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getValue
@NonNull public <T> java.util.Optional<T> getValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, @NonNull io.micronaut.core.type.Argument<T> requiredType, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Resolves the given value performing type conversion as necessary.- Type Parameters:
T
- The generic type- Parameters:
annotation
- The annotationmember
- The memberrequiredType
- The required typevalueMapper
- The value mapper- Returns:
- The resolved value
-
getDefaultValue
@NonNull public <T> java.util.Optional<T> getDefaultValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, @NonNull java.lang.Class<T> requiredType)
- Specified by:
getDefaultValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getAnnotationValuesByType
@NonNull public <T extends java.lang.annotation.Annotation> java.util.List<io.micronaut.core.annotation.AnnotationValue<T>> getAnnotationValuesByType(@Nullable java.lang.Class<T> annotationType)
- Specified by:
getAnnotationValuesByType
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getAnnotationValuesByName
public <T extends java.lang.annotation.Annotation> java.util.List<io.micronaut.core.annotation.AnnotationValue<T>> getAnnotationValuesByName(java.lang.String annotationType)
- Specified by:
getAnnotationValuesByName
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getDeclaredAnnotationValuesByType
@NonNull public <T extends java.lang.annotation.Annotation> java.util.List<io.micronaut.core.annotation.AnnotationValue<T>> getDeclaredAnnotationValuesByType(@NonNull java.lang.Class<T> annotationType)
- Specified by:
getDeclaredAnnotationValuesByType
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getDeclaredAnnotationValuesByName
public <T extends java.lang.annotation.Annotation> java.util.List<io.micronaut.core.annotation.AnnotationValue<T>> getDeclaredAnnotationValuesByName(java.lang.String annotationType)
- Specified by:
getDeclaredAnnotationValuesByName
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
synthesizeAnnotationsByType
public <T extends java.lang.annotation.Annotation> T[] synthesizeAnnotationsByType(@NonNull java.lang.Class<T> annotationClass)
- Specified by:
synthesizeAnnotationsByType
in interfaceio.micronaut.core.annotation.AnnotationSource
-
synthesizeDeclaredAnnotationsByType
public <T extends java.lang.annotation.Annotation> T[] synthesizeDeclaredAnnotationsByType(@NonNull java.lang.Class<T> annotationClass)
- Specified by:
synthesizeDeclaredAnnotationsByType
in interfaceio.micronaut.core.annotation.AnnotationSource
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
hasDeclaredAnnotation
public boolean hasDeclaredAnnotation(java.lang.String annotation)
- Specified by:
hasDeclaredAnnotation
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
hasAnnotation
public boolean hasAnnotation(java.lang.String annotation)
- Specified by:
hasAnnotation
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
hasStereotype
public boolean hasStereotype(java.lang.String annotation)
- Specified by:
hasStereotype
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
hasDeclaredStereotype
public boolean hasDeclaredStereotype(java.lang.String annotation)
- Specified by:
hasDeclaredStereotype
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getAnnotationTypeByStereotype
@NonNull public java.util.Optional<java.lang.Class<? extends java.lang.annotation.Annotation>> getAnnotationTypeByStereotype(@Nullable java.lang.String stereotype)
- Specified by:
getAnnotationTypeByStereotype
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getAnnotationNameByStereotype
@NonNull public java.util.Optional<java.lang.String> getAnnotationNameByStereotype(@Nullable java.lang.String stereotype)
- Specified by:
getAnnotationNameByStereotype
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getAnnotationNamesByStereotype
@NonNull public java.util.List<java.lang.String> getAnnotationNamesByStereotype(@Nullable java.lang.String stereotype)
- Specified by:
getAnnotationNamesByStereotype
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getAnnotationValuesByStereotype
public <T extends java.lang.annotation.Annotation> java.util.List<io.micronaut.core.annotation.AnnotationValue<T>> getAnnotationValuesByStereotype(java.lang.String stereotype)
- Specified by:
getAnnotationValuesByStereotype
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getAnnotationNames
@NonNull public java.util.Set<java.lang.String> getAnnotationNames()
- Specified by:
getAnnotationNames
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getStereotypeAnnotationNames
public java.util.Set<java.lang.String> getStereotypeAnnotationNames()
- Specified by:
getStereotypeAnnotationNames
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getDeclaredStereotypeAnnotationNames
public java.util.Set<java.lang.String> getDeclaredStereotypeAnnotationNames()
- Specified by:
getDeclaredStereotypeAnnotationNames
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getDeclaredAnnotationNames
@NonNull public java.util.Set<java.lang.String> getDeclaredAnnotationNames()
- Specified by:
getDeclaredAnnotationNames
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getDeclaredAnnotationNamesByStereotype
@NonNull public java.util.List<java.lang.String> getDeclaredAnnotationNamesByStereotype(@Nullable java.lang.String stereotype)
- Specified by:
getDeclaredAnnotationNamesByStereotype
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getAnnotationType
@NonNull public java.util.Optional<java.lang.Class<? extends java.lang.annotation.Annotation>> getAnnotationType(@NonNull java.lang.String name)
- Specified by:
getAnnotationType
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getAnnotationType
@NonNull public java.util.Optional<java.lang.Class<? extends java.lang.annotation.Annotation>> getAnnotationType(@NonNull java.lang.String name, @NonNull java.lang.ClassLoader classLoader)
- Specified by:
getAnnotationType
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
findAnnotation
@NonNull public <T extends java.lang.annotation.Annotation> java.util.Optional<io.micronaut.core.annotation.AnnotationValue<T>> findAnnotation(@NonNull java.lang.String annotation)
- Specified by:
findAnnotation
in interfaceio.micronaut.core.annotation.AnnotationSource
-
findDeclaredAnnotation
@NonNull public <T extends java.lang.annotation.Annotation> java.util.Optional<io.micronaut.core.annotation.AnnotationValue<T>> findDeclaredAnnotation(@NonNull java.lang.String annotation)
- Specified by:
findDeclaredAnnotation
in interfaceio.micronaut.core.annotation.AnnotationSource
-
getValues
@NonNull public <T> io.micronaut.core.value.OptionalValues<T> getValues(@NonNull java.lang.String annotation, @NonNull java.lang.Class<T> valueType)
- Specified by:
getValues
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getValues
@NonNull public java.util.Map<java.lang.CharSequence,java.lang.Object> getValues(@NonNull java.lang.String annotation)
- Specified by:
getValues
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
getDefaultValue
@NonNull public <T> java.util.Optional<T> getDefaultValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, @NonNull io.micronaut.core.type.Argument<T> requiredType)
- Specified by:
getDefaultValue
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
isRepeatableAnnotation
public boolean isRepeatableAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
- Specified by:
isRepeatableAnnotation
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
isRepeatableAnnotation
public boolean isRepeatableAnnotation(java.lang.String annotation)
- Specified by:
isRepeatableAnnotation
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
findRepeatableAnnotation
public java.util.Optional<java.lang.String> findRepeatableAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
- Specified by:
findRepeatableAnnotation
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
findRepeatableAnnotation
public java.util.Optional<java.lang.String> findRepeatableAnnotation(java.lang.String annotation)
- Specified by:
findRepeatableAnnotation
in interfaceio.micronaut.core.annotation.AnnotationMetadata
-
clone
public DefaultAnnotationMetadata clone()
- Overrides:
clone
in classjava.lang.Object
-
cloneMapOfMapValue
protected final <X,Y,K> java.util.Map<K,java.util.Map<X,Y>> cloneMapOfMapValue(java.util.Map<K,java.util.Map<X,Y>> toClone)
-
cloneMapOfListValue
protected final <K,V> java.util.Map<K,java.util.List<V>> cloneMapOfListValue(java.util.Map<K,java.util.List<V>> toClone)
-
cloneMap
protected final <K,V> java.util.Map<K,V> cloneMap(java.util.Map<K,V> map)
-
addAnnotation
protected void addAnnotation(java.lang.String annotation, java.util.Map<java.lang.CharSequence,java.lang.Object> values)
Adds an annotation and its member values, if the annotation already exists the data will be merged with existing values replaced.- Parameters:
annotation
- The annotationvalues
- The values
-
addAnnotation
protected void addAnnotation(java.lang.String annotation, java.util.Map<java.lang.CharSequence,java.lang.Object> values, java.lang.annotation.RetentionPolicy retentionPolicy)
Adds an annotation and its member values, if the annotation already exists the data will be merged with existing values replaced.- Parameters:
annotation
- The annotationvalues
- The valuesretentionPolicy
- The retention policy
-
addDefaultAnnotationValues
protected final void addDefaultAnnotationValues(java.lang.String annotation, java.util.Map<java.lang.CharSequence,java.lang.Object> values)
Adds an annotation directly declared on the element and its member values, if the annotation already exists the data will be merged with existing values replaced.- Parameters:
annotation
- The annotationvalues
- The values
-
areAnnotationDefaultsRegistered
@Internal public static boolean areAnnotationDefaultsRegistered(java.lang.String annotation)
Returns whether annotation defaults are registered for the give annotation. Used by generated byte code. DO NOT REMOVE.- Parameters:
annotation
- The annotation name- Returns:
- True if defaults have already been registered
-
registerAnnotationDefaults
@Internal public static void registerAnnotationDefaults(java.lang.String annotation, java.util.Map<java.lang.String,java.lang.Object> defaultValues)
Registers annotation default values. Used by generated byte code. DO NOT REMOVE.- Parameters:
annotation
- The annotation namedefaultValues
- The default values
-
registerAnnotationDefaults
@Internal public static void registerAnnotationDefaults(io.micronaut.core.annotation.AnnotationClassValue<?> annotation, java.util.Map<java.lang.String,java.lang.Object> defaultValues)
Registers annotation default values. Used by generated byte code. DO NOT REMOVE.- Parameters:
annotation
- The annotation namedefaultValues
- The default values
-
registerAnnotationType
@Internal public static void registerAnnotationType(io.micronaut.core.annotation.AnnotationClassValue<?> annotation)
Registers annotation default values. Used by generated byte code. DO NOT REMOVE.- Parameters:
annotation
- The annotation
-
registerRepeatableAnnotations
@Internal public static void registerRepeatableAnnotations(java.util.Map<java.lang.String,java.lang.String> repeatableAnnotations)
Registers repeatable annotations. Annotation container -> annotations item. Used by generated byte code. DO NOT REMOVE.- Parameters:
repeatableAnnotations
- The annotation
-
addRepeatable
protected void addRepeatable(java.lang.String annotationName, io.micronaut.core.annotation.AnnotationValue annotationValue)
Adds a repeatable annotation value. If a value already exists will be added- Parameters:
annotationName
- The annotation nameannotationValue
- The annotation value
-
addRepeatable
protected void addRepeatable(java.lang.String annotationName, io.micronaut.core.annotation.AnnotationValue annotationValue, java.lang.annotation.RetentionPolicy retentionPolicy)
Adds a repeatable annotation value. If a value already exists will be added- Parameters:
annotationName
- The annotation nameannotationValue
- The annotation valueretentionPolicy
- The retention policy
-
addRepeatableStereotype
protected void addRepeatableStereotype(java.util.List<java.lang.String> parents, java.lang.String stereotype, io.micronaut.core.annotation.AnnotationValue annotationValue)
Adds a repeatable stereotype value. If a value already exists will be added- Parameters:
parents
- The parent annotationsstereotype
- The annotation nameannotationValue
- The annotation value
-
addDeclaredRepeatableStereotype
protected void addDeclaredRepeatableStereotype(java.util.List<java.lang.String> parents, java.lang.String stereotype, io.micronaut.core.annotation.AnnotationValue annotationValue)
Adds a repeatable declared stereotype value. If a value already exists will be added- Parameters:
parents
- The parent annotationsstereotype
- The annotation nameannotationValue
- The annotation value
-
addDeclaredRepeatable
protected void addDeclaredRepeatable(java.lang.String annotationName, io.micronaut.core.annotation.AnnotationValue annotationValue)
Adds a repeatable annotation value. If a value already exists will be added- Parameters:
annotationName
- The annotation nameannotationValue
- The annotation value
-
addDeclaredRepeatable
protected void addDeclaredRepeatable(java.lang.String annotationName, io.micronaut.core.annotation.AnnotationValue annotationValue, java.lang.annotation.RetentionPolicy retentionPolicy)
Adds a repeatable annotation value. If a value already exists will be added- Parameters:
annotationName
- The annotation nameannotationValue
- The annotation valueretentionPolicy
- The retention policy
-
addStereotype
protected final void addStereotype(java.util.List<java.lang.String> parentAnnotations, java.lang.String stereotype, java.util.Map<java.lang.CharSequence,java.lang.Object> values)
Adds a stereotype and its member values, if the annotation already exists the data will be merged with existing values replaced.- Parameters:
parentAnnotations
- The parent annotationsstereotype
- The annotationvalues
- The values
-
addStereotype
protected final void addStereotype(java.util.List<java.lang.String> parentAnnotations, java.lang.String stereotype, java.util.Map<java.lang.CharSequence,java.lang.Object> values, java.lang.annotation.RetentionPolicy retentionPolicy)
Adds a stereotype and its member values, if the annotation already exists the data will be merged with existing values replaced.- Parameters:
parentAnnotations
- The parent annotationsstereotype
- The annotationvalues
- The valuesretentionPolicy
- The retention policy
-
addDeclaredStereotype
protected void addDeclaredStereotype(java.util.List<java.lang.String> parentAnnotations, java.lang.String stereotype, java.util.Map<java.lang.CharSequence,java.lang.Object> values)
Adds a stereotype and its member values, if the annotation already exists the data will be merged with existing values replaced.- Parameters:
parentAnnotations
- The parent annotationsstereotype
- The annotationvalues
- The values
-
addDeclaredStereotype
protected void addDeclaredStereotype(java.util.List<java.lang.String> parentAnnotations, java.lang.String stereotype, java.util.Map<java.lang.CharSequence,java.lang.Object> values, java.lang.annotation.RetentionPolicy retentionPolicy)
Adds a stereotype and its member values, if the annotation already exists the data will be merged with existing values replaced.- Parameters:
parentAnnotations
- The parent annotationsstereotype
- The annotationvalues
- The valuesretentionPolicy
- The retention policy
-
addDeclaredAnnotation
protected void addDeclaredAnnotation(java.lang.String annotation, java.util.Map<java.lang.CharSequence,java.lang.Object> values)
Adds an annotation directly declared on the element and its member values, if the annotation already exists the data will be merged with existing values replaced.- Parameters:
annotation
- The annotationvalues
- The values
-
addDeclaredAnnotation
protected void addDeclaredAnnotation(java.lang.String annotation, java.util.Map<java.lang.CharSequence,java.lang.Object> values, java.lang.annotation.RetentionPolicy retentionPolicy)
Adds an annotation directly declared on the element and its member values, if the annotation already exists the data will be merged with existing values replaced.- Parameters:
annotation
- The annotationvalues
- The valuesretentionPolicy
- The retention policy
-
mutateMember
@Internal public static io.micronaut.core.annotation.AnnotationMetadata mutateMember(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, java.lang.String annotationName, java.lang.String member, java.lang.Object value)
Sets a member of the given
AnnotationMetadata
return a new annotation metadata instance without mutating the existing.WARNING: for internal use only be the framework
- Parameters:
annotationMetadata
- The metadataannotationName
- The annotation namemember
- The membervalue
- The value- Returns:
- The metadata
-
contributeDefaults
@Internal public static void contributeDefaults(io.micronaut.core.annotation.AnnotationMetadata target, io.micronaut.core.annotation.AnnotationMetadata source)
Contributes defaults to the given target.WARNING: for internal use only be the framework
- Parameters:
target
- The targetsource
- The source
-
contributeRepeatable
@Internal public static void contributeRepeatable(io.micronaut.core.annotation.AnnotationMetadata target, io.micronaut.core.annotation.AnnotationMetadata source)
Contributes repeatable annotation metadata to the given target.WARNING: for internal use only be the framework
- Parameters:
target
- The targetsource
- The source
-
contributeRepeatable
@Internal public static void contributeRepeatable(io.micronaut.core.annotation.AnnotationMetadata target, ClassElement classElement)
Contributes repeatable annotation metadata to the given class element.WARNING: for internal use only be the framework
- Parameters:
target
- The targetclassElement
- The source
-
mutateMember
@Internal public static io.micronaut.core.annotation.AnnotationMetadata mutateMember(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, java.lang.String annotationName, java.util.Map<java.lang.CharSequence,java.lang.Object> members)
Sets a member of the given
AnnotationMetadata
return a new annotation metadata instance without mutating the existing.WARNING: for internal use only be the framework
- Parameters:
annotationMetadata
- The metadataannotationName
- The annotation namemembers
- The key/value set of members and values- Returns:
- The metadata
-
removeAnnotationIf
protected <A extends java.lang.annotation.Annotation> void removeAnnotationIf(@NonNull java.util.function.Predicate<io.micronaut.core.annotation.AnnotationValue<A>> predicate)
Removes an annotation for the given predicate.- Type Parameters:
A
- The annotation- Parameters:
predicate
- The predicate
-
removeAnnotation
protected void removeAnnotation(java.lang.String annotationType)
Removes an annotation for the given annotation type.- Parameters:
annotationType
- The annotation type- Since:
- 3.0.0
-
removeStereotype
protected void removeStereotype(java.lang.String annotationType)
Removes a stereotype annotation for the given annotation type.- Parameters:
annotationType
- The annotation type- Since:
- 3.0.0
-
synthesize
@Nullable public <T extends java.lang.annotation.Annotation> T synthesize(@NonNull java.lang.Class<T> annotationClass)
- Specified by:
synthesize
in interfaceio.micronaut.core.annotation.AnnotationSource
-
synthesize
@Nullable public <T extends java.lang.annotation.Annotation> T synthesize(@NonNull java.lang.Class<T> annotationClass, @NonNull java.lang.String sourceAnnotation)
- Specified by:
synthesize
in interfaceio.micronaut.core.annotation.AnnotationSource
-
synthesizeDeclared
@Nullable public <T extends java.lang.annotation.Annotation> T synthesizeDeclared(@NonNull java.lang.Class<T> annotationClass, @NonNull java.lang.String sourceAnnotation)
- Specified by:
synthesizeDeclared
in interfaceio.micronaut.core.annotation.AnnotationSource
-
synthesizeDeclared
@Nullable public <T extends java.lang.annotation.Annotation> T synthesizeDeclared(@NonNull java.lang.Class<T> annotationClass)
- Specified by:
synthesizeDeclared
in interfaceio.micronaut.core.annotation.AnnotationSource
-
synthesizeAll
@NonNull public java.lang.annotation.Annotation[] synthesizeAll()
- Specified by:
synthesizeAll
in interfaceio.micronaut.core.annotation.AnnotationSource
-
synthesizeDeclared
@NonNull public java.lang.annotation.Annotation[] synthesizeDeclared()
- Specified by:
synthesizeDeclared
in interfaceio.micronaut.core.annotation.AnnotationSource
-
addAnnotationValuesFromData
protected final void addAnnotationValuesFromData(java.util.List results, java.util.Map<java.lang.CharSequence,java.lang.Object> values)
Adds any annotation values found in the values map to the results.- Parameters:
results
- The resultsvalues
- The values
-
addValuesToResults
protected void addValuesToResults(java.util.List<io.micronaut.core.annotation.AnnotationValue> results, io.micronaut.core.annotation.AnnotationValue values)
Adds a values instance to the results.- Parameters:
results
- The resultsvalues
- The values
-
-