Interface ParameterConfig
-
- All Superinterfaces:
DeclarationConfig
public interface ParameterConfig extends DeclarationConfig
Allows adding annotations to and removing annotations from a method parameter. Note that the method parameter 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 ParameterConfig
addAnnotation(jakarta.enterprise.lang.model.AnnotationInfo annotation)
Adds given annotation to this method parameter.ParameterConfig
addAnnotation(java.lang.annotation.Annotation annotation)
Adds given annotation to this method parameter.ParameterConfig
addAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Adds a marker annotation of given type to this method parameter.jakarta.enterprise.lang.model.declarations.ParameterInfo
info()
Returns theParameterInfo
corresponding to this transformed method parameter.ParameterConfig
removeAllAnnotations()
Removes all annotations from this method parameter.ParameterConfig
removeAnnotation(java.util.function.Predicate<jakarta.enterprise.lang.model.AnnotationInfo> predicate)
Removes all annotations matching given predicate from this method parameter.
-
-
-
Method Detail
-
info
jakarta.enterprise.lang.model.declarations.ParameterInfo info()
Returns theParameterInfo
corresponding to this transformed method parameter.- Specified by:
info
in interfaceDeclarationConfig
- Returns:
- the
ParameterInfo
corresponding to this transformed method parameter, nevernull
-
addAnnotation
ParameterConfig addAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Adds a marker annotation of given type to this method parameter. 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
ParameterConfig addAnnotation(jakarta.enterprise.lang.model.AnnotationInfo annotation)
Adds given annotation to this method parameter. 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 method parameter, must not benull
- Returns:
- this configurator object, to allow fluent usage
-
addAnnotation
ParameterConfig addAnnotation(java.lang.annotation.Annotation annotation)
Adds given annotation to this method parameter. The annotation instance is typically a subclass ofAnnotationLiteral
.- Specified by:
addAnnotation
in interfaceDeclarationConfig
- Parameters:
annotation
- the annotation to add to this method parameter, must not benull
- Returns:
- this configurator object, to allow fluent usage
-
removeAnnotation
ParameterConfig removeAnnotation(java.util.function.Predicate<jakarta.enterprise.lang.model.AnnotationInfo> predicate)
Removes all annotations matching given predicate from this method parameter.- Specified by:
removeAnnotation
in interfaceDeclarationConfig
- Parameters:
predicate
- an annotation predicate, must not benull
- Returns:
- this configurator object, to allow fluent usage
-
removeAllAnnotations
ParameterConfig removeAllAnnotations()
Removes all annotations from this method parameter.- Specified by:
removeAllAnnotations
in interfaceDeclarationConfig
- Returns:
- this configurator object, to allow fluent usage
-
-