インターフェース InjectionTargetFactory<T>

型パラメーター:
T - この InjectionTarget が動作する型

public interface InjectionTargetFactory<T>

InjectionTargetFactory は、特定の Bean の InjectionTarget を作成できます。

BeanManager.getInjectionTargetFactory(AnnotatedType) から取得した InjectionTargetFactory は、コンテナーで作成された注入ターゲットを提供できます。このファクトリをラップして、コンテナーが作成した注入ターゲットに動作を追加できます。

例:

 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));
     }
 });
 

InjectionTargetFactory のサポートを提供するために、CDI Lite の実装は必要ありません。

導入:
1.1
作成者:
Pete Muir, Antoine Sabot-Durand