インターフェース BeanConfigurator<T>
- 型パラメーター:
T- Bean インスタンスのクラス
public interface BeanConfigurator<T>この API は、新しいBeanインスタンスを構成するためのヘルパーです。CDI コンテナーは、このインターフェースの実装を提供する必要があります。このビルダーはスレッドセーフではなく、同時に使用できません。CDI Lite の実装は、Portable Extensions のサポートを提供する必要はありません。
- 導入:
- 2.0
- 作成者:
- Martin Kouba, Antoine Sabot-Durand
- 関連事項:
AfterBeanDiscovery.addBean()
方法の概要
すべてのメソッド インスタンスメソッド 抽象メソッド 修飾子と型 メソッド 説明 BeanConfigurator<T>addInjectionPoint(InjectionPoint injectionPoint)構成済みの Bean に InjectionPoint を追加するBeanConfigurator<T>addInjectionPoints(InjectionPoint... injectionPoints)構成済みの Bean に InjectionPoints を追加するBeanConfigurator<T>addInjectionPoints(SetSE<InjectionPoint> injectionPoints)構成済みの Bean に InjectionPoints を追加するBeanConfigurator<T>addQualifier(AnnotationSE qualifier)構成済みの Bean に修飾子を追加しますBeanConfigurator<T>addQualifiers(AnnotationSE... qualifiers)Bean に修飾子を追加します。BeanConfigurator<T>addQualifiers(SetSE<AnnotationSE> qualifiers)Bean に修飾子を追加します。BeanConfigurator<T>addStereotype(ClassSE<? extends AnnotationSE> stereotype)構成済みの Bean にステレオタイプを追加するBeanConfigurator<T>addStereotypes(SetSE<ClassSE<? extends AnnotationSE>> stereotypes)構成済みの Bean にステレオタイプを追加するBeanConfigurator<T>addTransitiveTypeClosure(TypeSE type)マネージド Bean の Bean クラスを表すかのように、指定された型の無制限の Bean 型のセットを追加します。BeanConfigurator<T>addType(TypeLiteral<?> typeLiteral)Bean 型に型を追加するBeanConfigurator<T>addType(TypeSE type)Bean 型に型を追加するBeanConfigurator<T>addTypes(TypeSE... types)Bean 型に型を追加するBeanConfigurator<T>addTypes(SetSE<TypeSE> types)Bean 型に型を追加するBeanConfigurator<T>alternative(boolean value)設定された Bean の代替ステータスを変更します。BeanConfigurator<T>beanClass(ClassSE<?> beanClass)構成済みの Bean のクラスを設定します。<U extends T>
BeanConfigurator<U>createWith(FunctionSE<CreationalContext<U>,U> callback)Bean インスタンスを作成するためのコールバックを設定します。BeanConfigurator<T>destroyWith(BiConsumerSE<T,CreationalContext<T>> callback)Bean インスタンスを破棄するコールバックを設定します。BeanConfigurator<T>disposeWith(BiConsumerSE<T,Instance<ObjectSE>> callback)Bean インスタンスを破棄するコールバックを設定します。BeanConfigurator<T>id(StringSE id)構成済みの Bean にPassivationCapableとそのパッシベーション用の ID を実装させます。BeanConfigurator<T>injectionPoints(InjectionPoint... injectionPoints)構成済みの Bean の InjectionPoints を置き換えますBeanConfigurator<T>injectionPoints(SetSE<InjectionPoint> injectionPoints)構成済みの Bean の InjectionPoints を置き換えますBeanConfigurator<T>name(StringSE name)構成された Bean の名前を設定しますBeanConfigurator<T>priority(int priority)構成された Bean の優先度を設定します。<U extends T>
BeanConfigurator<U>produceWith(FunctionSE<Instance<ObjectSE>,U> callback)Bean インスタンスを作成するためのコールバックを設定します。BeanConfigurator<T>qualifiers(AnnotationSE... qualifiers)すべての修飾子を置き換えます。BeanConfigurator<T>qualifiers(SetSE<AnnotationSE> qualifiers)すべての修飾子を置き換えます。<U extends T>
BeanConfigurator<U>read(AnnotatedType<U> type)指定されたアノテーション付きの型から情報を読み取ります。BeanConfigurator<T>read(BeanAttributes<?> beanAttributes)指定された Bean 属性から情報を読み取ります。BeanConfigurator<T>scope(ClassSE<? extends AnnotationSE> scope)Bean スコープを置き換えるBeanConfigurator<T>stereotypes(SetSE<ClassSE<? extends AnnotationSE>> stereotypes)構成済みの Bean のステレオタイプを置き換えるBeanConfigurator<T>types(TypeSE... types)Bean 型を置き換えるBeanConfigurator<T>types(SetSE<TypeSE> types)Bean 型を置き換える
メソッドの詳細
beanClass
BeanConfigurator<T> beanClass(ClassSE<?> beanClass)
構成済みの Bean のクラスを設定します。設定しない場合、拡張クラスが使用されます。- パラメーター:
beanClass- 構成された Bean のクラス- 戻り値:
- 自己
addInjectionPoint
BeanConfigurator<T> addInjectionPoint(InjectionPoint injectionPoint)
構成済みの Bean に InjectionPoint を追加する- パラメーター:
injectionPoint- 追加する injectionPoint- 戻り値:
- 自己
addInjectionPoints
BeanConfigurator<T> addInjectionPoints(InjectionPoint... injectionPoints)
構成済みの Bean に InjectionPoints を追加する- パラメーター:
injectionPoints- 追加する injectionPoints- 戻り値:
- 自己
addInjectionPoints
BeanConfigurator<T> addInjectionPoints(SetSE<InjectionPoint> injectionPoints)
構成済みの Bean に InjectionPoints を追加する- パラメーター:
injectionPoints- 追加する injectionPoints- 戻り値:
- 自己
injectionPoints
BeanConfigurator<T> injectionPoints(InjectionPoint... injectionPoints)
構成済みの Bean の InjectionPoints を置き換えます- パラメーター:
injectionPoints- 構成された Bean の injectionPoints- 戻り値:
- 自己
injectionPoints
BeanConfigurator<T> injectionPoints(SetSE<InjectionPoint> injectionPoints)
構成済みの Bean の InjectionPoints を置き換えます- パラメーター:
injectionPoints- 構成された Bean の injectionPoints- 戻り値:
- 自己
id
BeanConfigurator<T> id(StringSE id)
構成済みの Bean にPassivationCapableとそのパッシベーション用の ID を実装させます。- パラメーター:
id- for- 戻り値:
- 自己
- 関連事項:
PassivationCapable.getId()
createWith
<U extends T> BeanConfigurator<U> createWith(FunctionSE<CreationalContext<U>,U> callback)
Bean インスタンスを作成するためのコールバックを設定します。- 型パラメーター:
U- インスタンスタイプ- パラメーター:
callback- インスタンスを作成するためのコールバック- 戻り値:
- 自己
- 関連事項:
Contextual.create(CreationalContext)
produceWith
<U extends T> BeanConfigurator<U> produceWith(FunctionSE<Instance<ObjectSE>,U> callback)
Bean インスタンスを作成するためのコールバックを設定します。Instance引数は、プロデューサーメソッドのパラメーターインジェクションをシミュレートするために使用できます。ただし、コールバックの実行中にInstanceから取得された依存スコープ Bean インスタンスは、生成された Bean インスタンスが破棄されるまで管理されたままです。アプリケーションでは、Instanceから取得した不要な依存スコープ Bean インスタンスを常に破棄することをお勧めします。- 型パラメーター:
U- インスタンスタイプ- パラメーター:
callback- インスタンスを作成するためのコールバック- 戻り値:
- 自己
destroyWith
BeanConfigurator<T> destroyWith(BiConsumerSE<T,CreationalContext<T>> callback)
Bean インスタンスを破棄するコールバックを設定します。destroy コールバックが指定されていない場合、NOOP コールバックが自動的に設定されます。
- パラメーター:
callback- インスタンスを破棄するためのコールバック- 戻り値:
- 自己
disposeWith
BeanConfigurator<T> disposeWith(BiConsumerSE<T,Instance<ObjectSE>> callback)
Bean インスタンスを破棄するコールバックを設定します。破棄コールバックが指定されていない場合、NOOP コールバックが自動的に設定されます。
Instance引数は、ディスポーザメソッドのパラメーターインジェクションをシミュレートするために使用できます。コールバックの実行中にInstanceから取得されたすべての依存スコープの Bean インスタンスは、実行が完了すると破棄されます。- パラメーター:
callback- インスタンスを破棄するためのコールバック- 戻り値:
- 自己
read
<U extends T> BeanConfigurator<U> read(AnnotatedType<U> type)
指定されたアノテーション付きの型から情報を読み取ります。すべての関連情報が上書きされます。- 型パラメーター:
U- インスタンスタイプ- パラメーター:
type- 情報を読み取るクラス- 戻り値:
- 自己
read
BeanConfigurator<T> read(BeanAttributes<?> beanAttributes)
指定された Bean 属性から情報を読み取ります。すべての関連情報が上書きされます。- パラメーター:
beanAttributes- beanAttributes から情報を読み取る- 戻り値:
- 自己
addType
BeanConfigurator<T> addType(TypeSE type)
Bean 型に型を追加する- パラメーター:
type- 追加する型- 戻り値:
- 自己
addType
BeanConfigurator<T> addType(TypeLiteral<?> typeLiteral)
Bean 型に型を追加する- パラメーター:
typeLiteral- 追加する型- 戻り値:
- 自己
addTypes
BeanConfigurator<T> addTypes(TypeSE... types)
Bean 型に型を追加する- パラメーター:
types- 追加する型- 戻り値:
- 自己
addTypes
BeanConfigurator<T> addTypes(SetSE<TypeSE> types)
Bean 型に型を追加する- パラメーター:
types- 追加する型- 戻り値:
- 自己
addTransitiveTypeClosure
BeanConfigurator<T> addTransitiveTypeClosure(TypeSE type)
マネージド Bean の Bean クラスを表すかのように、指定された型の無制限の Bean 型のセットを追加します。不正な Bean 型は省略されます。- パラメーター:
type- からクロージャーを構築する- 戻り値:
- 自己
types
BeanConfigurator<T> types(TypeSE... types)
Bean 型を置き換える- パラメーター:
types- 構成された Bean の型- 戻り値:
- 自己
types
BeanConfigurator<T> types(SetSE<TypeSE> types)
Bean 型を置き換える- パラメーター:
types- 構成された Bean の型- 戻り値:
- 自己
scope
BeanConfigurator<T> scope(ClassSE<? extends AnnotationSE> scope)
Bean スコープを置き換える- パラメーター:
scope- 構成された Bean の新しいスコープ- 戻り値:
- 自己
addQualifier
BeanConfigurator<T> addQualifier(AnnotationSE qualifier)
構成済みの Bean に修飾子を追加します- パラメーター:
qualifier- 追加する修飾子- 戻り値:
- 自己
addQualifiers
BeanConfigurator<T> addQualifiers(AnnotationSE... qualifiers)
Bean に修飾子を追加します。- パラメーター:
qualifiers- 追加する修飾子- 戻り値:
- 自己
addQualifiers
BeanConfigurator<T> addQualifiers(SetSE<AnnotationSE> qualifiers)
Bean に修飾子を追加します。- パラメーター:
qualifiers- 追加する修飾子- 戻り値:
- 自己
qualifiers
BeanConfigurator<T> qualifiers(AnnotationSE... qualifiers)
すべての修飾子を置き換えます。- パラメーター:
qualifiers- ビルド Bean の修飾子- 戻り値:
- 自己
qualifiers
BeanConfigurator<T> qualifiers(SetSE<AnnotationSE> qualifiers)
すべての修飾子を置き換えます。- パラメーター:
qualifiers- 構成済み Bean の場合- 戻り値:
- 自己
addStereotype
BeanConfigurator<T> addStereotype(ClassSE<? extends AnnotationSE> stereotype)
構成済みの Bean にステレオタイプを追加する- パラメーター:
stereotype- 追加するステレオタイプ- 戻り値:
- 自己
addStereotypes
BeanConfigurator<T> addStereotypes(SetSE<ClassSE<? extends AnnotationSE>> stereotypes)
構成済みの Bean にステレオタイプを追加する- パラメーター:
stereotypes- 追加するステレオタイプ- 戻り値:
- 自己
stereotypes
BeanConfigurator<T> stereotypes(SetSE<ClassSE<? extends AnnotationSE>> stereotypes)
構成済みの Bean のステレオタイプを置き換える- パラメーター:
stereotypes- 構成済み Bean の場合- 戻り値:
- 自己
name
BeanConfigurator<T> name(StringSE name)
構成された Bean の名前を設定します- パラメーター:
name- 構成された Bean の名前- 戻り値:
- 自己
alternative
BeanConfigurator<T> alternative(boolean value)
設定された Bean の代替ステータスを変更します。デフォルトでは、構成された Bean は代替手段ではありません。- パラメーター:
value- 代替プロパティの値- 戻り値:
- 自己
priority
BeanConfigurator<T> priority(int priority)
構成された Bean の優先順位を設定します。デフォルトでは、設定された Bean には優先順位がありません。これは、
Priorityアノテーションを実際の Bean クラスに配置すること、またはカスタムBeanクラスにPrioritizedを実装させることと同じです。構成された Bean が代替でない場合、このメソッドは効果がありません。
- パラメーター:
priority- 優先度の値- 戻り値:
- 自己