Module jakarta.cdi
Interface SyntheticComponents
- 
public interface SyntheticComponentsAllows registering synthetic beans and observers.- Since:
 - 4.0
 
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> SyntheticBeanBuilder<T>addBean(java.lang.Class<T> beanClass)Creates aSyntheticBeanBuilderthat allows configuring a new synthetic bean of givenbeanClass.<T> SyntheticObserverBuilder<T>addObserver(Type eventType)Creates aSyntheticObserverBuilderthat allows configuring a new synthetic observer for giveneventType.<T> SyntheticObserverBuilder<T>addObserver(java.lang.Class<T> eventType)Creates aSyntheticObserverBuilderthat allows configuring a new synthetic observer for giveneventType. 
 - 
 
- 
- 
Method Detail
- 
addBean
<T> SyntheticBeanBuilder<T> addBean(java.lang.Class<T> beanClass)
Creates aSyntheticBeanBuilderthat allows configuring a new synthetic bean of givenbeanClass. The synthetic bean will be registered at the end of the@Synthesismethod.- Type Parameters:
 T- the bean class of the new synthetic bean- Parameters:
 beanClass- the bean class of the new synthetic bean, must not benull- Returns:
 - a new 
SyntheticBeanBuilder, nevernull 
 
- 
addObserver
<T> SyntheticObserverBuilder<T> addObserver(java.lang.Class<T> eventType)
Creates aSyntheticObserverBuilderthat allows configuring a new synthetic observer for giveneventType. The synthetic observer will be registered at the end of the@Synthesismethod.- Type Parameters:
 T- the observed event type of the new synthetic observer- Parameters:
 eventType- the observed event type of the new synthetic observer, must not benull- Returns:
 - a new 
SyntheticObserverBuilder, nevernull 
 
- 
addObserver
<T> SyntheticObserverBuilder<T> addObserver(Type eventType)
Creates aSyntheticObserverBuilderthat allows configuring a new synthetic observer for giveneventType. The synthetic observer will be registered at the end of the@Synthesismethod.This method is supposed to be called with explicitly provided type arguments. For example, to define a synthetic observer of event type
List<String>, one would call:// types is of type Types // syntheticComponents is of type SyntheticComponents syntheticComponents.<List<String>>addObserver(types.parameterized(List.class, String.class)) ...- Type Parameters:
 T- the observed event type of the new synthetic observer- Parameters:
 eventType- the observed event type of the new synthetic observer, must not benull- Returns:
 - a new 
SyntheticObserverBuilder, nevernull 
 
 - 
 
 -