Interface MethodConfig

All Superinterfaces:
DeclarationConfig

public interface MethodConfig extends 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 Details

    • info

      jakarta.enterprise.lang.model.declarations.MethodInfo info()
      Returns the MethodInfo corresponding to this transformed method.
      Specified by:
      info in interface DeclarationConfig
      Returns:
      the MethodInfo corresponding to this transformed method, never null
    • addAnnotation

      MethodConfig addAnnotation(Class<? extends Annotation> annotationType)
      Adds a marker annotation of given type to this method. Does not allow configuring annotation members.
      Specified by:
      addAnnotation in interface DeclarationConfig
      Parameters:
      annotationType - the annotation type, must not be null
      Returns:
      this configurator object, to allow fluent usage
    • addAnnotation

      MethodConfig addAnnotation(jakarta.enterprise.lang.model.AnnotationInfo annotation)
      Adds given annotation to this method. The AnnotationInfo can be obtained from an annotation target, or constructed from scratch using AnnotationBuilder.
      Specified by:
      addAnnotation in interface DeclarationConfig
      Parameters:
      annotation - the annotation to add to this method, must not be null
      Returns:
      this configurator object, to allow fluent usage
    • addAnnotation

      MethodConfig addAnnotation(Annotation annotation)
      Adds given annotation to this method. The annotation instance is typically a subclass of AnnotationLiteral.
      Specified by:
      addAnnotation in interface DeclarationConfig
      Parameters:
      annotation - the annotation to add to this method, must not be null
      Returns:
      this configurator object, to allow fluent usage
    • removeAnnotation

      MethodConfig removeAnnotation(Predicate<jakarta.enterprise.lang.model.AnnotationInfo> predicate)
      Removes all annotations matching given predicate from this method.
      Specified by:
      removeAnnotation in interface DeclarationConfig
      Parameters:
      predicate - an annotation predicate, must not be null
      Returns:
      this configurator object, to allow fluent usage
    • removeAllAnnotations

      MethodConfig removeAllAnnotations()
      Removes all annotations from this method.
      Specified by:
      removeAllAnnotations in interface DeclarationConfig
      Returns:
      this configurator object, to allow fluent usage
    • parameters

      List<ParameterConfig> parameters()
      Returns a list of ParameterConfig objects for each parameter of this method.
      Returns:
      immutable list of ParameterConfig objects, never null