Interface SyntheticComponents
public interface SyntheticComponents
Allows registering synthetic beans and observers.
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescription<T> SyntheticBeanBuilder
<T> Creates aSyntheticBeanBuilder
that allows configuring a new synthetic bean of givenimplementationClass
.<T> SyntheticObserverBuilder
<T> addObserver
(Type eventType) Creates aSyntheticObserverBuilder
that allows configuring a new synthetic observer for giveneventType
.<T> SyntheticObserverBuilder
<T> addObserver
(Class<T> eventType) Creates aSyntheticObserverBuilder
that allows configuring a new synthetic observer for giveneventType
.
-
Method Details
-
addBean
Creates aSyntheticBeanBuilder
that allows configuring a new synthetic bean of givenimplementationClass
. The synthetic bean will be registered at the end of the@Synthesis
method.- Type Parameters:
T
- the implementation class of the new synthetic bean- Parameters:
implementationClass
- the implementation class of the new synthetic bean, must not benull
- Returns:
- a new
SyntheticBeanBuilder
, nevernull
-
addObserver
Creates aSyntheticObserverBuilder
that allows configuring a new synthetic observer for giveneventType
. The synthetic observer will be registered at the end of the@Synthesis
method.- 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
Creates aSyntheticObserverBuilder
that allows configuring a new synthetic observer for giveneventType
. The synthetic observer will be registered at the end of the@Synthesis
method.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
-