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_MEMBEREMPTY| 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, synthesizeDeclaredAnnotationsByTypeequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbooleanValue, 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, stringValuesgetAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, synthesize, synthesizeAll, synthesizeDeclared, synthesizeDeclaredprotected 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 AnnotationMetadatahasPropertyExpressions in class DefaultAnnotationMetadatapublic void addAnnotation(java.lang.String annotation,
java.util.Map<java.lang.CharSequence,java.lang.Object> values)
DefaultAnnotationMetadataaddAnnotation in class DefaultAnnotationMetadataannotation - 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)
DefaultAnnotationMetadataaddAnnotation in class DefaultAnnotationMetadataannotation - The annotationvalues - The valuesretentionPolicy - The retention policypublic void addRepeatableStereotype(java.util.List<java.lang.String> parents,
java.lang.String stereotype,
AnnotationValue annotationValue)
DefaultAnnotationMetadataaddRepeatableStereotype in class DefaultAnnotationMetadataparents - The parent annotationsstereotype - The annotation nameannotationValue - The annotation valuepublic void addDeclaredRepeatableStereotype(java.util.List<java.lang.String> parents,
java.lang.String stereotype,
AnnotationValue annotationValue)
DefaultAnnotationMetadataaddDeclaredRepeatableStereotype in class DefaultAnnotationMetadataparents - 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)
DefaultAnnotationMetadataaddDeclaredAnnotation in class DefaultAnnotationMetadataannotation - 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)
DefaultAnnotationMetadataaddDeclaredAnnotation in class DefaultAnnotationMetadataannotation - The annotationvalues - The valuesretentionPolicy - The retention policyprotected void addRepeatable(java.lang.String annotationName,
AnnotationValue annotationValue)
DefaultAnnotationMetadataaddRepeatable in class DefaultAnnotationMetadataannotationName - The annotation nameannotationValue - The annotation valueprotected void addRepeatable(java.lang.String annotationName,
AnnotationValue annotationValue,
java.lang.annotation.RetentionPolicy retentionPolicy)
DefaultAnnotationMetadataaddRepeatable in class DefaultAnnotationMetadataannotationName - The annotation nameannotationValue - The annotation valueretentionPolicy - The retention policyprotected void addDeclaredRepeatable(java.lang.String annotationName,
AnnotationValue annotationValue)
DefaultAnnotationMetadataaddDeclaredRepeatable in class DefaultAnnotationMetadataannotationName - The annotation nameannotationValue - The annotation valueprotected void addDeclaredRepeatable(java.lang.String annotationName,
AnnotationValue annotationValue,
java.lang.annotation.RetentionPolicy retentionPolicy)
DefaultAnnotationMetadataaddDeclaredRepeatable in class DefaultAnnotationMetadataannotationName - 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)
AnnotationSourcesynthesize in interface AnnotationSourceT - The annotation generic typeannotationClass - The annotation class@Nullable public <T extends java.lang.annotation.Annotation> T synthesizeDeclared(@NonNull java.lang.Class<T> annotationClass)
AnnotationSourceThis method ignores inherited annotations. (Returns null if no annotations are directly present on this element.)
synthesizeDeclared in interface AnnotationSourceT - The annotation generic typeannotationClass - The annotation class@NonNull public java.lang.annotation.Annotation[] synthesizeAll()
AnnotationSourcesynthesizeAll in interface AnnotationSource@NonNull public java.lang.annotation.Annotation[] synthesizeDeclared()
AnnotationSourcesynthesizeDeclared in interface AnnotationSourceprotected 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