Top Description Methods
jakarta.enterprise.inject.spi.configurator

public Interface AnnotatedFieldConfigurator<T>

Type Parameters
<T>
the class declaring the field
Imports
java.lang.annotation.Annotation, java.util.function.Predicate, jakarta.enterprise.inject.spi.AnnotatedField

This interface is part of the AnnotatedTypeConfigurator SPI and helps defining an AnnotatedField

CDI Lite implementations are not required to provide support for Portable Extensions.

Authors
Martin Kouba, Antoine Sabot-Durand
Since
2.0

Method Summary

Modifier and TypeMethod and Description
public AnnotatedFieldConfigurator<T>

Returns:

self
add
(Annotation
the annotation to add
annotation
)

Add an annotation to the field.

public AnnotatedField<T>

Returns:

the original AnnotatedField
getAnnotated
()

public AnnotatedFieldConfigurator<T>

Returns:

self
remove
(Predicate<Annotation>
Predicate used to filter annotations to remove
predicate
)

Remove annotations that match the specified predicate.

public default AnnotatedFieldConfigurator<T>

Returns:

self
removeAll
()

Remove all the annotations.

Method Detail

addback to summary
public AnnotatedFieldConfigurator<T> add(Annotation annotation)

Add an annotation to the field.

Parameters
annotation:Annotation

the annotation to add

Returns:AnnotatedFieldConfigurator<T>

self

getAnnotatedback to summary
public AnnotatedField<T> getAnnotated()
Returns:AnnotatedField<T>

the original AnnotatedField

removeback to summary
public AnnotatedFieldConfigurator<T> remove(Predicate<Annotation> predicate)

Remove annotations that match the specified predicate.

Example predicates:

 // To remove all the annotations:
(a) -> true

// To remove annotations with a concrete annotation type:
(a) -> a.annotationType().equals(Foo.class)

// To remove annotation equal to a specified object:
(a) -> a.equals(fooAnnotation)

// To remove annotations that are considered equivalent for the purposes of typesafe resolution:
(a) -> beanManager.areQualifiersEquivalent(a, fooQualifier)
(a) -> beanManager.areInterceptorBindingsEquivalent(a, fooInterceptorBinding)

Parameters
predicate:Predicate<Annotation>

Predicate used to filter annotations to remove

Returns:AnnotatedFieldConfigurator<T>

self

removeAllback to summary
public default AnnotatedFieldConfigurator<T> removeAll()

Remove all the annotations.

Returns:AnnotatedFieldConfigurator<T>

self