T
- the class represented by the configured AnnotatedTypepublic interface AnnotatedTypeConfigurator<T>
This API is a helper to configure a new AnnotatedType
instance. The container must provide an implementation of
this interface.
AnnotatedTypeConfigurator is not reusable.
This configurator is not thread safe and shall not be used concurrently.
BeforeBeanDiscovery.addAnnotatedType(Class, String)
,
AfterTypeDiscovery.addAnnotatedType(Class, String)
,
ProcessAnnotatedType.configureAnnotatedType()
Modifier and Type | Method and Description |
---|---|
AnnotatedTypeConfigurator<T> |
add(Annotation annotation)
Add an annotation to the type.
|
Set<AnnotatedConstructorConfigurator<T>> |
constructors() |
Set<AnnotatedFieldConfigurator<? super T>> |
fields() |
default Stream<AnnotatedConstructorConfigurator<T>> |
filterConstructors(Predicate<AnnotatedConstructor<T>> predicate) |
default Stream<AnnotatedFieldConfigurator<? super T>> |
filterFields(Predicate<AnnotatedField<? super T>> predicate) |
default Stream<AnnotatedMethodConfigurator<? super T>> |
filterMethods(Predicate<AnnotatedMethod<? super T>> predicate) |
AnnotatedType<T> |
getAnnotated() |
Set<AnnotatedMethodConfigurator<? super T>> |
methods() |
AnnotatedTypeConfigurator<T> |
remove(Predicate<Annotation> predicate)
Remove annotations that match the specified predicate.
|
default AnnotatedTypeConfigurator<T> |
removeAll()
Remove all the annotations.
|
AnnotatedType<T> getAnnotated()
AnnotatedType
AnnotatedTypeConfigurator<T> add(Annotation annotation)
annotation
- the annotation to addAnnotatedTypeConfigurator<T> remove(Predicate<Annotation> 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)
predicate
- Predicate
used to filter annotations to removedefault AnnotatedTypeConfigurator<T> removeAll()
Set<AnnotatedMethodConfigurator<? super T>> methods()
AnnotatedMethodConfigurator
s reflecting the AnnotatedType.getMethods()
default Stream<AnnotatedMethodConfigurator<? super T>> filterMethods(Predicate<AnnotatedMethod<? super T>> predicate)
predicate
- Testing the original AnnotatedMethod
AnnotatedMethodConfigurator
s matching the given predicateAnnotatedMethodConfigurator.getAnnotated()
Set<AnnotatedFieldConfigurator<? super T>> fields()
AnnotatedFieldConfigurator
s reflecting the AnnotatedType.getFields()
default Stream<AnnotatedFieldConfigurator<? super T>> filterFields(Predicate<AnnotatedField<? super T>> predicate)
predicate
- Testing the original AnnotatedField
AnnotatedFieldConfigurator
s matching the given predicateAnnotatedFieldConfigurator.getAnnotated()
Set<AnnotatedConstructorConfigurator<T>> constructors()
AnnotatedConstructorConfigurator
s reflecting the
AnnotatedType.getConstructors()
default Stream<AnnotatedConstructorConfigurator<T>> filterConstructors(Predicate<AnnotatedConstructor<T>> predicate)
predicate
- Testing the original AnnotatedConstructor
AnnotatedConstructorConfigurator
s matching the given predicateAnnotatedConstructorConfigurator.getAnnotated()
Copyright © 2018,2020 Eclipse Foundation.
Use is subject to license terms.