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)); } });
修飾子と型 | メソッドと説明 |
---|---|
default AnnotatedTypeConfigurator<T> | configure() |
InjectionTarget<T> | createInjectionTarget(Bean<T> bean) Bean の新しい注入ターゲットを作成します。 |
InjectionTarget<T> createInjectionTarget(Bean<T> bean)
bean
- インジェクションターゲットを作成する Bean。非コンテキストオブジェクトを作成する場合は nulldefault AnnotatedTypeConfigurator<T> configure()
InjectionTarget
の作成に使用される AnnotatedType
を構成するために、AnnotatedTypeConfigurator
を返します。各呼び出しは同じ AnnotatedTypeConfigurator を返します。AnnotatedTypeConfigurator
IllegalStateExceptionSE
- createInjectionTarget(Bean)
呼び出し後に使用した場合 Copyright © 2018,2020 Eclipse Foundation.
Use is subject to license terms.