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.