Interface AnnotatedConstructorConfigurator<T>
-
- Type Parameters:
T
- the class declaring the constructor
public interface AnnotatedConstructorConfigurator<T>
This interface is part of theAnnotatedTypeConfigurator
SPI and helps defining anAnnotatedConstructor
CDI Lite implementations are not required to provide support for Portable Extensions.
- Since:
- 2.0
- Author:
- Martin Kouba, Antoine Sabot-Durand
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description AnnotatedConstructorConfigurator<T>
add(Annotation annotation)
Add an annotation to the constructor.default Stream<AnnotatedParameterConfigurator<T>>
filterParams(Predicate<AnnotatedParameter<T>> predicate)
AnnotatedConstructor<T>
getAnnotated()
List<AnnotatedParameterConfigurator<T>>
params()
AnnotatedConstructorConfigurator<T>
remove(Predicate<Annotation> predicate)
Remove annotations that match the specified predicate.default AnnotatedConstructorConfigurator<T>
removeAll()
Remove all the annotations.
-
-
-
Method Detail
-
getAnnotated
AnnotatedConstructor<T> getAnnotated()
- Returns:
- the original
AnnotatedConstructor
-
add
AnnotatedConstructorConfigurator<T> add(Annotation annotation)
Add an annotation to the constructor.- Parameters:
annotation
- the annotation to add- Returns:
- self
-
remove
AnnotatedConstructorConfigurator<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
used to filter annotations to remove- Returns:
- self
-
removeAll
default AnnotatedConstructorConfigurator<T> removeAll()
Remove all the annotations.- Returns:
- self
-
params
List<AnnotatedParameterConfigurator<T>> params()
- Returns:
- an immutable list of
AnnotatedParameterConfigurator
s reflecting theAnnotatedCallable.getParameters()
-
filterParams
default Stream<AnnotatedParameterConfigurator<T>> filterParams(Predicate<AnnotatedParameter<T>> predicate)
- Parameters:
predicate
- Testing the originalAnnotatedParameter
- Returns:
- a sequence of
AnnotatedParameterConfigurator
s matching the given predicate - See Also:
AnnotatedParameterConfigurator.getAnnotated()
-
-