Interface MutableAnnotationMetadataDelegate<R>
- Type Parameters:
R
- The return type
- All Superinterfaces:
AnnotationMetadata
,AnnotationMetadataDelegate
,AnnotationMetadataProvider
,AnnotationSource
- All Known Subinterfaces:
AnnotationElement
,ArrayableClassElement
,BeanConstructorElement
,BeanElement
,BeanElementBuilder
,BeanFieldElement
,BeanMethodElement
,BeanParameterElement
,ClassElement
,ConfigurableElement
,ConstructorElement
,Element
,ElementAnnotationMetadata
,ElementMutableAnnotationMetadataDelegate<R>
,EnumConstantElement
,EnumElement
,FieldElement
,GenericElement
,GenericPlaceholderElement
,InjectableElement
,MemberElement
,MethodElement
,PackageElement
,ParameterElement
,PropertyElement
,TypedElement
,WildcardElement
- All Known Implementing Classes:
AbstractAnnotationElement
,AbstractBeanDefinitionBuilder
,AbstractElementAnnotationMetadata
,AbstractElementAnnotationMetadataFactory.AbstractElementAnnotationMetadata
,AbstractElementAnnotationMetadataFactory.MutableElementAnnotationMetadata
,AbstractGroovyElement
,AbstractJavaElement
,AbstractMutableAnnotationMetadata
,BeanDefinitionWriter
,GenericPlaceholderElementAnnotationMetadata
,GroovyClassElement
,GroovyConstructorElement
,GroovyEnumConstantElement
,GroovyFieldElement
,GroovyMethodElement
,GroovyPackageElement
,GroovyParameterElement
,JavaClassElement
,JavaMethodElement
,JavaPackageElement
,MethodElementAnnotationMetadata
,MutatedMethodElementAnnotationMetadata
,PrimitiveElement
,PropertyElementAnnotationMetadata
,WildcardElementAnnotationMetadata
Mutable annotation metadata.
- Since:
- 4.0.0
- Author:
- Denis Stepanov
-
Field Summary
Modifier and TypeFieldDescriptionstatic final MutableAnnotationMetadataDelegate<?>
The empty metadata.Fields inherited from interface io.micronaut.core.annotation.AnnotationMetadata
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T extends Annotation>
Rannotate
(@NonNull AnnotationValue<T> annotationValue) Annotate this element with the given annotation type.default <T extends Annotation>
RAnnotate this element with the given annotation type.default <T extends Annotation>
RAnnotate this element with the given annotation type.default R
Annotate this element with the given annotation type.default <T extends Annotation>
RAnnotate this element with the given annotation type.default <T extends Annotation>
RremoveAnnotation
(@NonNull Class<T> annotationType) default R
removeAnnotation
(@NonNull String annotationType) Removes an annotation of the given type from the element.default <T extends Annotation>
RremoveAnnotationIf
(@NonNull Predicate<AnnotationValue<T>> predicate) Removes all annotations that pass the given predicate.default <T extends Annotation>
RremoveStereotype
(@NonNull Class<T> annotationType) Removes a stereotype annotation of the given type from the element.default R
removeStereotype
(@NonNull String annotationType) Removes a stereotype of the given name from the element.Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadata
enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasEvaluatedExpressions, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresent
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataDelegate
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, copyAnnotationMetadata, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, findRepeatableAnnotation, findRepeatableAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByName, getAnnotationValuesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByName, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, getTargetAnnotationMetadata, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasPropertyExpressions, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isRepeatableAnnotation, isRepeatableAnnotation, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
getAnnotationMetadata
-
Field Details
-
EMPTY
The empty metadata.
-
-
Method Details
-
annotate
@NonNull default <T extends Annotation> R annotate(@NonNull @NonNull String annotationType, @NonNull @NonNull Consumer<AnnotationValueBuilder<T>> consumer) Annotate this element with the given annotation type. If the annotation is already present then any values populated by the builder will be merged/overridden with the existing values.- Type Parameters:
T
- The annotation generic type- Parameters:
annotationType
- The annotation typeconsumer
- A function that receives theAnnotationValueBuilder
- Returns:
- This element
-
removeAnnotation
Removes an annotation of the given type from the element.If the annotation features any stereotypes these will also be removed unless there are other annotations that reference the stereotype to be removed.
In the case of repeatable annotations this method will remove all repeated annotations, effectively clearing out all declared repeated annotations of the given type.
- Parameters:
annotationType
- The annotation type- Returns:
- This element
-
removeAnnotation
@NonNull default <T extends Annotation> R removeAnnotation(@NonNull @NonNull Class<T> annotationType) - Type Parameters:
T
- The annotation generic type- Parameters:
annotationType
- The annotation type- Returns:
- This element
- See Also:
-
removeAnnotationIf
@NonNull default <T extends Annotation> R removeAnnotationIf(@NonNull @NonNull Predicate<AnnotationValue<T>> predicate) Removes all annotations that pass the given predicate.- Type Parameters:
T
- The annotation generic type- Parameters:
predicate
- The predicate- Returns:
- This element
-
removeStereotype
Removes a stereotype of the given name from the element.- Parameters:
annotationType
- The annotation type- Returns:
- This element
-
removeStereotype
@NonNull default <T extends Annotation> R removeStereotype(@NonNull @NonNull Class<T> annotationType) Removes a stereotype annotation of the given type from the element.- Type Parameters:
T
- The annotation generic type- Parameters:
annotationType
- The annotation type- Returns:
- This element
-
annotate
Annotate this element with the given annotation type. If the annotation is already present then any values populated by the builder will be merged/overridden with the existing values.- Parameters:
annotationType
- The annotation type- Returns:
- This element
-
annotate
@NonNull default <T extends Annotation> R annotate(@NonNull @NonNull Class<T> annotationType, @NonNull @NonNull Consumer<AnnotationValueBuilder<T>> consumer) Annotate this element with the given annotation type. If the annotation is already present then any values populated by the builder will be merged/overridden with the existing values.- Type Parameters:
T
- The annotation generic type- Parameters:
annotationType
- The annotation typeconsumer
- A function that receives theAnnotationValueBuilder
- Returns:
- This element
-
annotate
Annotate this element with the given annotation type. If the annotation is already present then any values populated by the builder will be merged/overridden with the existing values.- Type Parameters:
T
- The annotation generic type- Parameters:
annotationType
- The annotation type- Returns:
- This element
-
annotate
@NonNull default <T extends Annotation> R annotate(@NonNull @NonNull AnnotationValue<T> annotationValue) Annotate this element with the given annotation type. If the annotation is already present then any values populated by the builder will be merged/overridden with the existing values.- Type Parameters:
T
- The annotation generic type- Parameters:
annotationValue
- The annotation type- Returns:
- This element
- Since:
- 3.0.0
-