インターフェース 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
方法の概要
すべてのメソッド インスタンスメソッド 抽象メソッド デフォルトメソッド 修飾子と型 メソッド 説明 default AnnotatedTypeConfigurator<T>configure()InjectionTarget<T>createInjectionTarget(Bean<T> bean)Bean の新しい注入ターゲットを作成します。
メソッドの詳細
createInjectionTarget
InjectionTarget<T> createInjectionTarget(Bean<T> bean)
Bean の新しい注入ターゲットを作成します。- パラメーター:
bean- インジェクションターゲットを作成する Bean。非コンテキストオブジェクトを作成する場合は null- 戻り値:
- 注入ターゲット
configure
default AnnotatedTypeConfigurator<T> configure()
InjectionTargetの作成に使用されるAnnotatedTypeを構成するために、AnnotatedTypeConfiguratorを返します。各呼び出しは同じ AnnotatedTypeConfigurator を返します。- 戻り値:
- インジェクションポイントを構成する
AnnotatedTypeConfigurator - 例外:
IllegalStateExceptionSE-createInjectionTarget(Bean)呼び出し後に使用した場合- 導入:
- 2.0