Class PropertyElementAnnotationMetadata
java.lang.Object
io.micronaut.inject.ast.annotation.PropertyElementAnnotationMetadata
- All Implemented Interfaces:
AnnotationMetadata,AnnotationMetadataDelegate,AnnotationMetadataProvider,AnnotationSource,ElementAnnotationMetadata,MutableAnnotationMetadataDelegate<AnnotationMetadata>
public final class PropertyElementAnnotationMetadata
extends Object
implements ElementAnnotationMetadata
The element annotation metadata for property element.
- Since:
- 4.0.0
- Author:
- Denis Stepanov
-
Field Summary
Fields inherited from interface io.micronaut.core.annotation.AnnotationMetadata
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBERFields inherited from interface io.micronaut.inject.ast.annotation.MutableAnnotationMetadataDelegate
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionPropertyElementAnnotationMetadata(Element thisElement, @Nullable MethodElement getter, @Nullable MethodElement setter, @Nullable FieldElement field, @Nullable ParameterElement constructorParameter, boolean includeSynthetic) -
Method Summary
Modifier and TypeMethodDescription<T extends Annotation>
Elementannotate(AnnotationValue<T> annotationValue) Annotate this element with the given annotation type.<T extends Annotation>
ElementAnnotate this element with the given annotation type.<T extends Annotation>
Elementannotate(Class<T> annotationType, Consumer<AnnotationValueBuilder<T>> consumer) Annotate this element with the given annotation type.Annotate this element with the given annotation type.<T extends Annotation>
Elementannotate(String annotationType, Consumer<AnnotationValueBuilder<T>> consumer) Annotate this element with the given annotation type.Supplies the metadata.removeAnnotation(String annotationType) Removes an annotation of the given type from the element.<T extends Annotation>
ElementremoveAnnotationIf(Predicate<AnnotationValue<T>> predicate) Removes all annotations that pass the given predicate.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.core.annotation.AnnotationMetadata
enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasEvaluatedExpressions, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresentMethods 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, synthesizeDeclaredAnnotationsByTypeMethods inherited from interface io.micronaut.inject.ast.annotation.MutableAnnotationMetadataDelegate
removeAnnotation, removeStereotype, removeStereotype
-
Constructor Details
-
PropertyElementAnnotationMetadata
public PropertyElementAnnotationMetadata(@NonNull Element thisElement, @Nullable @Nullable MethodElement getter, @Nullable @Nullable MethodElement setter, @Nullable @Nullable FieldElement field, @Nullable @Nullable ParameterElement constructorParameter, boolean includeSynthetic)
-
-
Method Details
-
annotate
Description copied from interface:MutableAnnotationMetadataDelegateAnnotate 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.- Specified by:
annotatein interfaceMutableAnnotationMetadataDelegate<AnnotationMetadata>- Type Parameters:
T- The annotation generic type- Parameters:
annotationValue- The annotation type- Returns:
- This element
-
annotate
public <T extends Annotation> Element annotate(String annotationType, Consumer<AnnotationValueBuilder<T>> consumer) Description copied from interface:MutableAnnotationMetadataDelegateAnnotate 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.- Specified by:
annotatein interfaceMutableAnnotationMetadataDelegate<AnnotationMetadata>- Type Parameters:
T- The annotation generic type- Parameters:
annotationType- The annotation typeconsumer- A function that receives theAnnotationValueBuilder- Returns:
- This element
-
annotate
Description copied from interface:MutableAnnotationMetadataDelegateAnnotate 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.- Specified by:
annotatein interfaceMutableAnnotationMetadataDelegate<AnnotationMetadata>- Type Parameters:
T- The annotation generic type- Parameters:
annotationType- The annotation type- Returns:
- This element
-
annotate
Description copied from interface:MutableAnnotationMetadataDelegateAnnotate 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.- Specified by:
annotatein interfaceMutableAnnotationMetadataDelegate<AnnotationMetadata>- Parameters:
annotationType- The annotation type- Returns:
- This element
-
annotate
public <T extends Annotation> Element annotate(Class<T> annotationType, Consumer<AnnotationValueBuilder<T>> consumer) Description copied from interface:MutableAnnotationMetadataDelegateAnnotate 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.- Specified by:
annotatein interfaceMutableAnnotationMetadataDelegate<AnnotationMetadata>- Type Parameters:
T- The annotation generic type- Parameters:
annotationType- The annotation typeconsumer- A function that receives theAnnotationValueBuilder- Returns:
- This element
-
removeAnnotation
Description copied from interface:MutableAnnotationMetadataDelegateRemoves 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.
- Specified by:
removeAnnotationin interfaceMutableAnnotationMetadataDelegate<AnnotationMetadata>- Parameters:
annotationType- The annotation type- Returns:
- This element
-
removeAnnotationIf
Description copied from interface:MutableAnnotationMetadataDelegateRemoves all annotations that pass the given predicate.- Specified by:
removeAnnotationIfin interfaceMutableAnnotationMetadataDelegate<AnnotationMetadata>- Type Parameters:
T- The annotation generic type- Parameters:
predicate- The predicate- Returns:
- This element
-
getAnnotationMetadata
Description copied from interface:AnnotationMetadataProviderSupplies the metadata. Defaults toAnnotationMetadata.EMPTY_METADATA.- Specified by:
getAnnotationMetadatain interfaceAnnotationMetadataProvider- Returns:
- The
AnnotationMetadata
-
getReadAnnotationMetadata
- Returns:
- The read annotation metadata
-
getWriteAnnotationMetadata
- Returns:
- The write annotation metadata
-