Top Description Methods
jakarta.enterprise.inject.build.compatible.spi

public Interface DeclarationConfig

Known Direct Subinterfaces
jakarta.enterprise.inject.build.compatible.spi.FieldConfig, jakarta.enterprise.inject.build.compatible.spi.ParameterConfig, jakarta.enterprise.inject.build.compatible.spi.MethodConfig, jakarta.enterprise.inject.build.compatible.spi.ClassConfig
Imports
jakarta.enterprise.lang.model.AnnotationInfo, jakarta.enterprise.lang.model.declarations.DeclarationInfo, java.lang.annotation.Annotation, java.util.function.Predicate

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
Enhancement

Method Summary

Modifier and TypeMethod and Description
public DeclarationConfig

Returns:

this configurator object, to allow fluent usage
addAnnotation
(Class<? extends Annotation>
the annotation type, must not be null
annotationType
)

Adds a marker annotation of given type to this declaration.

public DeclarationConfig

Returns:

this configurator object, to allow fluent usage
addAnnotation
(AnnotationInfo
the annotation to add to this declaration, must not be null
annotation
)

Adds given annotation to this declaration.

public DeclarationConfig

Returns:

this configurator object, to allow fluent usage
addAnnotation
(Annotation
the annotation to add to this declaration, must not be null
annotation
)

Adds given annotation to this declaration.

public DeclarationInfo

Returns:

the DeclarationInfo corresponding to this transformed declaration, never null
info
()

Returns the DeclarationInfo corresponding to this transformed declaration.

public DeclarationConfig

Returns:

this configurator object, to allow fluent usage
removeAllAnnotations
()

Removes all annotations from this declaration.

public DeclarationConfig

Returns:

this configurator object, to allow fluent usage
removeAnnotation
(Predicate<AnnotationInfo>
an annotation predicate, must not be null
predicate
)

Removes all annotations matching given predicate from this declaration.

Method Detail

addAnnotationback to summary
public DeclarationConfig addAnnotation(Class<? extends Annotation> annotationType)

Adds a marker annotation of given type to this declaration. Does not allow configuring annotation members.

Parameters
annotationType:Class<? extends Annotation>

the annotation type, must not be null

Returns:DeclarationConfig

this configurator object, to allow fluent usage

addAnnotationback to summary
public 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:AnnotationInfo

the annotation to add to this declaration, must not be null

Returns:DeclarationConfig

this configurator object, to allow fluent usage

addAnnotationback to summary
public DeclarationConfig addAnnotation(Annotation annotation)

Adds given annotation to this declaration. The annotation instance is typically a subclass of AnnotationLiteral.

Parameters
annotation:Annotation

the annotation to add to this declaration, must not be null

Returns:DeclarationConfig

this configurator object, to allow fluent usage

infoback to summary
public DeclarationInfo info()

Returns the DeclarationInfo corresponding to this transformed declaration.

Returns:DeclarationInfo

the DeclarationInfo corresponding to this transformed declaration, never null

removeAllAnnotationsback to summary
public DeclarationConfig removeAllAnnotations()

Removes all annotations from this declaration.

Returns:DeclarationConfig

this configurator object, to allow fluent usage

removeAnnotationback to summary
public DeclarationConfig removeAnnotation(Predicate<AnnotationInfo> predicate)

Removes all annotations matching given predicate from this declaration.

Parameters
predicate:Predicate<AnnotationInfo>

an annotation predicate, must not be null

Returns:DeclarationConfig

this configurator object, to allow fluent usage