Interface DeclarationConfig

All Known Subinterfaces:
ClassConfig, FieldConfig, MethodConfig, ParameterConfig

public interface DeclarationConfig
Allows 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:
  • Method Details Link icon

    • info Link icon

      Returns the DeclarationInfo corresponding to this transformed declaration.
      Returns:
      the DeclarationInfo corresponding to this transformed declaration, never null
    • addAnnotation Link icon

      DeclarationConfig addAnnotation(Class<? extends 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 be null
      Returns:
      this configurator object, to allow fluent usage
    • addAnnotation Link icon

      DeclarationConfig addAnnotation(AnnotationInfo annotation)
      Adds given annotation to this declaration. The AnnotationInfo can be obtained from an annotation target, or constructed from scratch using AnnotationBuilder.
      Parameters:
      annotation - the annotation to add to this declaration, must not be null
      Returns:
      this configurator object, to allow fluent usage
    • addAnnotation Link icon

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

      DeclarationConfig removeAnnotation(Predicate<AnnotationInfo> predicate)
      Removes all annotations matching given predicate from this declaration.
      Parameters:
      predicate - an annotation predicate, must not be null
      Returns:
      this configurator object, to allow fluent usage
    • removeAllAnnotations Link icon

      DeclarationConfig removeAllAnnotations()
      Removes all annotations from this declaration.
      Returns:
      this configurator object, to allow fluent usage