Interface FieldConfig
- All Superinterfaces:
DeclarationConfig
Allows adding annotations to and removing annotations from a field.
Note that the field is not physically altered, the modifications
are only seen by the CDI container.
- Since:
- 4.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaddAnnotation
(AnnotationInfo annotation) Adds given annotation to this field.addAnnotation
(Annotation annotation) Adds given annotation to this field.addAnnotation
(Class<? extends Annotation> annotationType) Adds a marker annotation of given type to this field.info()
Returns theFieldInfo
corresponding to this transformed field.Removes all annotations from this field.removeAnnotation
(Predicate<AnnotationInfo> predicate) Removes all annotations matching given predicate from this field.
-
Method Details
-
info
FieldInfo info()Returns theFieldInfo
corresponding to this transformed field.- Specified by:
info
in interfaceDeclarationConfig
- Returns:
- the
FieldInfo
corresponding to this transformed field, nevernull
-
addAnnotation
Adds a marker annotation of given type to this field. Does not allow configuring annotation members.- Specified by:
addAnnotation
in interfaceDeclarationConfig
- Parameters:
annotationType
- the annotation type, must not benull
- Returns:
- this configurator object, to allow fluent usage
-
addAnnotation
Adds given annotation to this field. TheAnnotationInfo
can be obtained from an annotation target, or constructed from scratch usingAnnotationBuilder
.- Specified by:
addAnnotation
in interfaceDeclarationConfig
- Parameters:
annotation
- the annotation to add to this field, must not benull
- Returns:
- this configurator object, to allow fluent usage
-
addAnnotation
Adds given annotation to this field. The annotation instance is typically a subclass ofAnnotationLiteral
.- Specified by:
addAnnotation
in interfaceDeclarationConfig
- Parameters:
annotation
- the annotation to add to this field, must not benull
- Returns:
- this configurator object, to allow fluent usage
-
removeAnnotation
Removes all annotations matching given predicate from this field.- Specified by:
removeAnnotation
in interfaceDeclarationConfig
- Parameters:
predicate
- an annotation predicate, must not benull
- Returns:
- this configurator object, to allow fluent usage
-
removeAllAnnotations
FieldConfig removeAllAnnotations()Removes all annotations from this field.- Specified by:
removeAllAnnotations
in interfaceDeclarationConfig
- Returns:
- this configurator object, to allow fluent usage
-