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

public Interface AnnotatedMethodConfigurator<T>

Type Parameters
<T>
the class declaring the method
Imports
java.lang.annotation.Annotation, java.util.List, java.util.function.Predicate, java.util.stream.Stream, jakarta.enterprise.inject.spi.AnnotatedMethod, .AnnotatedParameter

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

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 AnnotatedMethodConfigurator<T>

Returns:

self
add
(Annotation
the annotation to add
annotation
)

Add an annotation to the method.

public default Stream<AnnotatedParameterConfigurator<T>>

Returns:

a sequence of AnnotatedParameterConfigurators matching the given predicate
filterParams
(Predicate<AnnotatedParameter<T>>
Testing the original AnnotatedParameter
predicate
)

public AnnotatedMethod<T>

Returns:

the original AnnotatedMethod
getAnnotated
()

public List<AnnotatedParameterConfigurator<T>>

Returns:

an immutable list of AnnotatedParameterConfigurators reflecting the AnnotatedMethod#getParameters()
params
()

public AnnotatedMethodConfigurator<T>

Returns:

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

Remove annotations that match the specified predicate.

public default AnnotatedMethodConfigurator<T>

Returns:

self
removeAll
()

Remove all the annotations.

Method Detail

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

Add an annotation to the method.

Parameters
annotation:Annotation

the annotation to add

Returns:AnnotatedMethodConfigurator<T>

self

filterParamsback to summary
public default Stream<AnnotatedParameterConfigurator<T>> filterParams(Predicate<AnnotatedParameter<T>> predicate)
Parameters
predicate:Predicate<AnnotatedParameter<T>>

Testing the original AnnotatedParameter

Returns:Stream<AnnotatedParameterConfigurator<T>>

a sequence of AnnotatedParameterConfigurators matching the given predicate

See Also
AnnotatedParameterConfigurator#getAnnotated()
getAnnotatedback to summary
public AnnotatedMethod<T> getAnnotated()
Returns:AnnotatedMethod<T>

the original AnnotatedMethod

paramsback to summary
public List<AnnotatedParameterConfigurator<T>> params()
Returns:List<AnnotatedParameterConfigurator<T>>

an immutable list of AnnotatedParameterConfigurators reflecting the AnnotatedMethod#getParameters()

removeback to summary
public AnnotatedMethodConfigurator<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:AnnotatedMethodConfigurator<T>

self

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

Remove all the annotations.

Returns:AnnotatedMethodConfigurator<T>

self