Interface MethodConfig
- All Superinterfaces:
DeclarationConfig
Allows adding annotations to and removing annotations from a method.
Note that the method 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 method.addAnnotation(Annotation annotation) Adds given annotation to this method.addAnnotation(Class<? extends Annotation> annotationType) Adds a marker annotation of given type to this method.info()Returns theMethodInfocorresponding to this transformed method.Returns a list ofParameterConfigobjects for each parameter of this method.Removes all annotations from this method.removeAnnotation(Predicate<AnnotationInfo> predicate) Removes all annotations matching given predicate from this method.
-
Method Details
-
info
MethodInfo info()Returns theMethodInfocorresponding to this transformed method.- Specified by:
infoin interfaceDeclarationConfig- Returns:
- the
MethodInfocorresponding to this transformed method, nevernull
-
addAnnotation
Adds a marker annotation of given type to this method. 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
Adds given annotation to this method. TheAnnotationInfocan be obtained from an annotation target, or constructed from scratch usingAnnotationBuilder.- Specified by:
addAnnotationin interfaceDeclarationConfig- Parameters:
annotation- the annotation to add to this method, must not benull- Returns:
- this configurator object, to allow fluent usage
-
addAnnotation
Adds given annotation to this method. The annotation instance is typically a subclass ofAnnotationLiteral.- Specified by:
addAnnotationin interfaceDeclarationConfig- Parameters:
annotation- the annotation to add to this method, must not benull- Returns:
- this configurator object, to allow fluent usage
-
removeAnnotation
Removes all annotations matching given predicate from this method.- Specified by:
removeAnnotationin interfaceDeclarationConfig- Parameters:
predicate- an annotation predicate, must not benull- Returns:
- this configurator object, to allow fluent usage
-
removeAllAnnotations
MethodConfig removeAllAnnotations()Removes all annotations from this method.- Specified by:
removeAllAnnotationsin interfaceDeclarationConfig- Returns:
- this configurator object, to allow fluent usage
-
parameters
List<ParameterConfig> parameters()Returns a list ofParameterConfigobjects for each parameter of this method.- Returns:
- immutable list of
ParameterConfigobjects, nevernull
-