Top Description Methods
jakarta.enterprise.inject.build.compatible.spi

public Interface SyntheticComponents

Imports
jakarta.enterprise.lang.model.types.Type

Allows registering synthetic beans and observers.
Since
4.0

Method Summary

Modifier and TypeMethod and Description
public <
the bean class of the new synthetic bean
T
>
SyntheticBeanBuilder<T>

Returns:

a new SyntheticBeanBuilder, never null
addBean
(Class<T>
the bean class of the new synthetic bean, must not be null
beanClass
)

Creates a SyntheticBeanBuilder that allows configuring a new synthetic bean of given beanClass.

public <
the observed event type of the new synthetic observer
T
>
SyntheticObserverBuilder<T>

Returns:

a new SyntheticObserverBuilder, never null
addObserver
(Class<T>
the observed event type of the new synthetic observer, must not be null
eventType
)

Creates a SyntheticObserverBuilder that allows configuring a new synthetic observer for given eventType.

public <
the observed event type of the new synthetic observer
T
>
SyntheticObserverBuilder<T>

Returns:

a new SyntheticObserverBuilder, never null
addObserver
(Type
the observed event type of the new synthetic observer, must not be null
eventType
)

Creates a SyntheticObserverBuilder that allows configuring a new synthetic observer for given eventType.

Method Detail

addBeanback to summary
public <T> SyntheticBeanBuilder<T> addBean(Class<T> beanClass)

Creates a SyntheticBeanBuilder that allows configuring a new synthetic bean of given beanClass. The synthetic bean will be registered at the end of the @Synthesis method.

Parameters
<T>
the bean class of the new synthetic bean
beanClass:Class<T>

the bean class of the new synthetic bean, must not be null

Returns:SyntheticBeanBuilder<T>

a new SyntheticBeanBuilder, never null

addObserverback to summary
public <T> SyntheticObserverBuilder<T> addObserver(Class<T> eventType)

Creates a SyntheticObserverBuilder that allows configuring a new synthetic observer for given eventType. The synthetic observer will be registered at the end of the @Synthesis method.

Parameters
<T>
the observed event type of the new synthetic observer
eventType:Class<T>

the observed event type of the new synthetic observer, must not be null

Returns:SyntheticObserverBuilder<T>

a new SyntheticObserverBuilder, never null

addObserverback to summary
public <T> SyntheticObserverBuilder<T> addObserver(Type eventType)

Creates a SyntheticObserverBuilder that allows configuring a new synthetic observer for given eventType. 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))
    ...
Parameters
<T>
the observed event type of the new synthetic observer
eventType:Type

the observed event type of the new synthetic observer, must not be null

Returns:SyntheticObserverBuilder<T>

a new SyntheticObserverBuilder, never null