Module jakarta.cdi
Interface DeclarationConfig
- 
- All Known Subinterfaces:
 ClassConfig,FieldConfig,MethodConfig,ParameterConfig
public interface DeclarationConfigAllows adding annotations to and removing annotations from a declaration. Note that the declaration 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 DeclarationConfigaddAnnotation(AnnotationInfo annotation)Adds given annotation to this declaration.DeclarationConfigaddAnnotation(java.lang.annotation.Annotation annotation)Adds given annotation to this declaration.DeclarationConfigaddAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)Adds a marker annotation of given type to this declaration.DeclarationInfoinfo()Returns theDeclarationInfocorresponding to this transformed declaration.DeclarationConfigremoveAllAnnotations()Removes all annotations from this declaration.DeclarationConfigremoveAnnotation(java.util.function.Predicate<AnnotationInfo> predicate)Removes all annotations matching given predicate from this declaration. 
 - 
 
- 
- 
Method Detail
- 
info
DeclarationInfo info()
Returns theDeclarationInfocorresponding to this transformed declaration.- Returns:
 - the 
DeclarationInfocorresponding to this transformed declaration, nevernull 
 
- 
addAnnotation
DeclarationConfig addAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Adds a marker annotation of given type to this declaration. Does not allow configuring annotation members.- Parameters:
 annotationType- the annotation type, must not benull- Returns:
 - this configurator object, to allow fluent usage
 
 
- 
addAnnotation
DeclarationConfig addAnnotation(AnnotationInfo annotation)
Adds given annotation to this declaration. TheAnnotationInfocan be obtained from an annotation target, or constructed from scratch usingAnnotationBuilder.- Parameters:
 annotation- the annotation to add to this declaration, must not benull- Returns:
 - this configurator object, to allow fluent usage
 
 
- 
addAnnotation
DeclarationConfig addAnnotation(java.lang.annotation.Annotation annotation)
Adds given annotation to this declaration. The annotation instance is typically a subclass ofAnnotationLiteral.- Parameters:
 annotation- the annotation to add to this declaration, must not benull- Returns:
 - this configurator object, to allow fluent usage
 
 
- 
removeAnnotation
DeclarationConfig removeAnnotation(java.util.function.Predicate<AnnotationInfo> predicate)
Removes all annotations matching given predicate from this declaration.- Parameters:
 predicate- an annotation predicate, must not benull- Returns:
 - this configurator object, to allow fluent usage
 
 
- 
removeAllAnnotations
DeclarationConfig removeAllAnnotations()
Removes all annotations from this declaration.- Returns:
 - this configurator object, to allow fluent usage
 
 
 - 
 
 -