-
- All Superinterfaces:
DeclarationConfig
public interface FieldConfig extends 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:
Enhancement
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FieldConfigaddAnnotation(AnnotationInfo annotation)Adds given annotation to this field.FieldConfigaddAnnotation(java.lang.annotation.Annotation annotation)Adds given annotation to this field.FieldConfigaddAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)Adds a marker annotation of given type to this field.FieldInfoinfo()Returns theFieldInfocorresponding to this transformed field.FieldConfigremoveAllAnnotations()Removes all annotations from this field.FieldConfigremoveAnnotation(java.util.function.Predicate<AnnotationInfo> predicate)Removes all annotations matching given predicate from this field.
-
-
-
Method Detail
-
info
FieldInfo info()
Returns theFieldInfocorresponding to this transformed field.- Specified by:
infoin interfaceDeclarationConfig- Returns:
- the
FieldInfocorresponding to this transformed field, nevernull
-
addAnnotation
FieldConfig addAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Adds a marker annotation of given type to this field. Does not allow configuring annotation members.- Specified by:
addAnnotationin interfaceDeclarationConfig- Parameters:
annotationType- the annotation type, must not benull- Returns:
- this configurator object, to allow fluent usage
-
addAnnotation
FieldConfig addAnnotation(AnnotationInfo annotation)
Adds given annotation to this field. TheAnnotationInfocan be obtained from an annotation target, or constructed from scratch usingAnnotationBuilder.- Specified by:
addAnnotationin interfaceDeclarationConfig- Parameters:
annotation- the annotation to add to this field, must not benull- Returns:
- this configurator object, to allow fluent usage
-
addAnnotation
FieldConfig addAnnotation(java.lang.annotation.Annotation annotation)
Adds given annotation to this field. The annotation instance is typically a subclass ofAnnotationLiteral.- Specified by:
addAnnotationin interfaceDeclarationConfig- Parameters:
annotation- the annotation to add to this field, must not benull- Returns:
- this configurator object, to allow fluent usage
-
removeAnnotation
FieldConfig removeAnnotation(java.util.function.Predicate<AnnotationInfo> predicate)
Removes all annotations matching given predicate from this field.- Specified by:
removeAnnotationin 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:
removeAllAnnotationsin interfaceDeclarationConfig- Returns:
- this configurator object, to allow fluent usage
-
-