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