public class MutableAnnotationMetadata extends DefaultAnnotationMetadata
DefaultAnnotationMetadata
that is used only at build time.Modifier and Type | Field and 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 |
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
EMPTY
Constructor and Description |
---|
MutableAnnotationMetadata() |
Modifier and Type | Method and Description |
---|---|
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.
|
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.
|
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.
|
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,
AnnotationValue annotationValue)
Adds a repeatable annotation value.
|
protected void |
addDeclaredRepeatable(java.lang.String annotationName,
AnnotationValue annotationValue,
java.lang.annotation.RetentionPolicy retentionPolicy)
Adds a repeatable annotation value.
|
void |
addDeclaredRepeatableStereotype(java.util.List<java.lang.String> parents,
java.lang.String stereotype,
AnnotationValue annotationValue)
Adds a repeatable declared stereotype value.
|
protected void |
addRepeatable(java.lang.String annotationName,
AnnotationValue annotationValue)
Adds a repeatable annotation value.
|
protected void |
addRepeatable(java.lang.String annotationName,
AnnotationValue annotationValue,
java.lang.annotation.RetentionPolicy retentionPolicy)
Adds a repeatable annotation value.
|
void |
addRepeatableStereotype(java.util.List<java.lang.String> parents,
java.lang.String stereotype,
AnnotationValue annotationValue)
Adds a repeatable stereotype value.
|
protected void |
addValuesToResults(java.util.List<AnnotationValue> results,
AnnotationValue values)
Adds a values instance to the results.
|
boolean |
hasPropertyExpressions()
Does the metadata contain any property expressions like
${foo.bar} . |
<T extends java.lang.annotation.Annotation> |
synthesize(java.lang.Class<T> annotationClass)
Synthesizes a new annotation from the metadata for the given annotation type.
|
java.lang.annotation.Annotation[] |
synthesizeAll()
Synthesizes a new annotations from the metadata.
|
java.lang.annotation.Annotation[] |
synthesizeDeclared()
Synthesizes a new annotations from the metadata.
|
<T extends java.lang.annotation.Annotation> |
synthesizeDeclared(java.lang.Class<T> annotationClass)
Synthesizes a new annotation from the metadata for the given annotation type.
|
addDeclaredStereotype, addDeclaredStereotype, addDefaultAnnotationValues, addStereotype, addStereotype, areAnnotationDefaultsRegistered, booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, clone, contributeDefaults, doubleValue, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, enumValues, enumValues, findAnnotation, findDeclaredAnnotation, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationValuesByType, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationValuesByType, getDefaultValue, getDefaultValue, getDefaultValues, getValue, getValue, getValue, getValues, hasAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasStereotype, intValue, intValue, intValue, intValue, isEmpty, isFalse, isPresent, isTrue, isTrue, isTrue, isTrue, longValue, longValue, longValue, longValue, mutateMember, mutateMember, registerAnnotationDefaults, registerAnnotationDefaults, registerAnnotationType, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, synthesizeAnnotationsByType, synthesizeDeclaredAnnotationsByType
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
booleanValue, booleanValue, classValue, classValue, classValues, classValues, doubleValue, findAnnotation, findDeclaredAnnotation, getAnnotationNameByStereotype, getAnnotationNamesByStereotype, getAnnotationTypeByStereotype, 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, isDeclaredAnnotationPresent, isFalse, isPresent, stringValue, stringValue, stringValues
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, synthesize, synthesizeAll, synthesizeDeclared, synthesizeDeclared
protected final java.util.Map<java.lang.String,java.lang.annotation.Annotation> annotationMap
protected final java.util.Map<java.lang.String,java.lang.annotation.Annotation> declaredAnnotationMap
public boolean hasPropertyExpressions()
AnnotationMetadata
${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.hasPropertyExpressions
in interface AnnotationMetadata
hasPropertyExpressions
in class DefaultAnnotationMetadata
public void addAnnotation(java.lang.String annotation, java.util.Map<java.lang.CharSequence,java.lang.Object> values)
DefaultAnnotationMetadata
addAnnotation
in class DefaultAnnotationMetadata
annotation
- The annotationvalues
- The valuespublic void addAnnotation(java.lang.String annotation, java.util.Map<java.lang.CharSequence,java.lang.Object> values, java.lang.annotation.RetentionPolicy retentionPolicy)
DefaultAnnotationMetadata
addAnnotation
in class DefaultAnnotationMetadata
annotation
- The annotationvalues
- The valuesretentionPolicy
- The retention policypublic void addRepeatableStereotype(java.util.List<java.lang.String> parents, java.lang.String stereotype, AnnotationValue annotationValue)
DefaultAnnotationMetadata
addRepeatableStereotype
in class DefaultAnnotationMetadata
parents
- The parent annotationsstereotype
- The annotation nameannotationValue
- The annotation valuepublic void addDeclaredRepeatableStereotype(java.util.List<java.lang.String> parents, java.lang.String stereotype, AnnotationValue annotationValue)
DefaultAnnotationMetadata
addDeclaredRepeatableStereotype
in class DefaultAnnotationMetadata
parents
- The parent annotationsstereotype
- The annotation nameannotationValue
- The annotation valuepublic void addDeclaredAnnotation(java.lang.String annotation, java.util.Map<java.lang.CharSequence,java.lang.Object> values)
DefaultAnnotationMetadata
addDeclaredAnnotation
in class DefaultAnnotationMetadata
annotation
- The annotationvalues
- The valuespublic void addDeclaredAnnotation(java.lang.String annotation, java.util.Map<java.lang.CharSequence,java.lang.Object> values, java.lang.annotation.RetentionPolicy retentionPolicy)
DefaultAnnotationMetadata
addDeclaredAnnotation
in class DefaultAnnotationMetadata
annotation
- The annotationvalues
- The valuesretentionPolicy
- The retention policyprotected void addRepeatable(java.lang.String annotationName, AnnotationValue annotationValue)
DefaultAnnotationMetadata
addRepeatable
in class DefaultAnnotationMetadata
annotationName
- The annotation nameannotationValue
- The annotation valueprotected void addRepeatable(java.lang.String annotationName, AnnotationValue annotationValue, java.lang.annotation.RetentionPolicy retentionPolicy)
DefaultAnnotationMetadata
addRepeatable
in class DefaultAnnotationMetadata
annotationName
- The annotation nameannotationValue
- The annotation valueretentionPolicy
- The retention policyprotected void addDeclaredRepeatable(java.lang.String annotationName, AnnotationValue annotationValue)
DefaultAnnotationMetadata
addDeclaredRepeatable
in class DefaultAnnotationMetadata
annotationName
- The annotation nameannotationValue
- The annotation valueprotected void addDeclaredRepeatable(java.lang.String annotationName, AnnotationValue annotationValue, java.lang.annotation.RetentionPolicy retentionPolicy)
DefaultAnnotationMetadata
addDeclaredRepeatable
in class DefaultAnnotationMetadata
annotationName
- The annotation nameannotationValue
- The annotation valueretentionPolicy
- The retention policy@Nullable public <T extends java.lang.annotation.Annotation> T synthesize(@NonNull java.lang.Class<T> annotationClass)
AnnotationSource
synthesize
in interface AnnotationSource
T
- The annotation generic typeannotationClass
- The annotation class@Nullable public <T extends java.lang.annotation.Annotation> T synthesizeDeclared(@NonNull java.lang.Class<T> annotationClass)
AnnotationSource
This method ignores inherited annotations. (Returns null if no annotations are directly present on this element.)
synthesizeDeclared
in interface AnnotationSource
T
- The annotation generic typeannotationClass
- The annotation class@NonNull public java.lang.annotation.Annotation[] synthesizeAll()
AnnotationSource
synthesizeAll
in interface AnnotationSource
@NonNull public java.lang.annotation.Annotation[] synthesizeDeclared()
AnnotationSource
synthesizeDeclared
in interface AnnotationSource
protected final void addAnnotationValuesFromData(java.util.List results, java.util.Map<java.lang.CharSequence,java.lang.Object> values)
results
- The resultsvalues
- The valuesprotected void addValuesToResults(java.util.List<AnnotationValue> results, AnnotationValue values)
results
- The resultsvalues
- The values