Top Description Methods
javax.enterprise.inject.spi

public Interface InjectionTargetFactory<T>

Type Parameters
<T>
type on which this InjectionTarget operates
Imports
javax.enterprise.inject.spi.configurator.AnnotatedTypeConfigurator

An InjectionTargetFactory can create an InjectionTarget for a given bean.

The InjectionTargetFactory obtained from BeanManager#getInjectionTargetFactory(AnnotatedType) is capable of providing container created injection targets. This factory can be wrapped to add behavior to container created injection targets.

For example:

BeanAttributes<MyBean> myBeanAttributes = beanManager.createBeanAttributes(myBeanAnnotatedType);
beanManager.createBean(myBeanAttributes, MyBean.class, new InjectionTargetFactory() {

    public <T> InjectionTarget<T> createInjectionTarget(Bean<T> bean) {
        return new WrappingInjectionTarget<T>(beanManager.getInjectionTargetFactory(myBeanAnnotatedType).createInjectionTarget(
                bean));
    }
});
Authors
Pete Muir, Antoine Sabot-Durand
Since
1.1

Method Summary

Modifier and TypeMethod and Description
public default AnnotatedTypeConfigurator<T>

Returns:

an AnnotatedTypeConfigurator to configure injection points
configure
()

Returns an AnnotatedTypeConfigurator to to configure the AnnotatedType used to create the InjectionTarget.

public InjectionTarget<T>

Returns:

the injection target
createInjectionTarget
(Bean<T>
the bean to create the injection target for, or null if creating a non-contextual object
bean
)

Create a new injection target for a bean.

Method Detail

configureback to summary
public default AnnotatedTypeConfigurator<T> configure()

Returns an AnnotatedTypeConfigurator to to configure the AnnotatedType used to create the InjectionTarget. Each call returns the same AnnotatedTypeConfigurator.

Returns:AnnotatedTypeConfigurator<T>

an AnnotatedTypeConfigurator to configure injection points

Exceptions
IllegalStateException:
if used after createInjectionTarget(Bean) invocation
Since
2.0
createInjectionTargetback to summary
public InjectionTarget<T> createInjectionTarget(Bean<T> bean)

Create a new injection target for a bean.

Parameters
bean:Bean<T>

the bean to create the injection target for, or null if creating a non-contextual object

Returns:InjectionTarget<T>

the injection target