org.guiceex
クラス InjectorFactory
java.lang.Object
org.guiceex.InjectorFactory
public class InjectorFactory
- extends Object
GuiceexInjectorインスタンスのファクトリクラスです。
作成したGuiceexInjectorインスタンスの管理をアプリケーションで行う場合は
createInjector(Object[])を使用し、InjectorFactoryによって管理する場合は
getInjector(Object[])を使用します。後者のメソッドは、GuiceexInjectorインスタンス
をInjectorFactoryのstaticフィールドに配置して管理するシングルトン
ファクトリメソッドです。
- 作成者:
- matu◆AliceLAklI
| クラス java.lang.Object から継承されたメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
createInjector
public static GuiceexInjector createInjector(Object... configs)
throws ConfigurationException,
BindException
Guice.createInjector(Module[])を使用してインスタンスを作成します。
引数configsは、Moduleインスタンス及び(又は)guceex-cfg.xml
ファイルへのクラスパスを表す文字列である必要があります。
- パラメータ:
configs - Moduleインスタンス及び(又は)guceex-cfg.xml
ファイルへのクラスパスを表す文字列。もしくはそれらを含むObject型の配列。
- 戻り値:
GuiceexInjectorインスタンス
- 例外:
ConfigurationException - guceex-cfg.xmlの読み込みエラー時にスローされる。
BindException - バインディングエラー時にスローされる。
getInjector
public static GuiceexInjector getInjector(Object... configs)
throws ConfigurationException,
BindException
createInjector(Object...)で作成したGuiceexInjectorインスタンスを、
staticフィールドに配置して管理するシングルトンファクトリメソッドです。
- 例外:
ConfigurationException
BindException- 関連項目:
createInjector(Object...)
Copyright © 2007. All Rights Reserved.