org.seasar.uruma.util
クラス S2ContainerUtil

java.lang.Object
  上位を拡張 org.seasar.uruma.util.S2ContainerUtil

public class S2ContainerUtil
extends Object

S2Container を利用するためのユーティリティクラスです。

作成者:
y-komori

コンストラクタの概要
S2ContainerUtil()
           
 
メソッドの概要
static Object getComponent(Class<?> componentClass)
          指定されたクラスに対応するコンポーネントを S2Container から取得して返します。
static ComponentDef getComponentDef(Class<?> componentClass)
          指定されたクラスに対応するコンポーネントを S2Container から取得して返します。
static ComponentDef getComponentDef(String componentName)
          指定された名前に対応するコンポーネントを S2Container から取得して返します。
static Object getComponentNoException(String componentName)
          指定された名前に対応するコンポーネントを S2Container から取得して返します。
static void injectDependency(Object target, S2Container container)
          指定されたオブジェクトに対して S2Container からコンポーネントをインジェクションします。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

S2ContainerUtil

public S2ContainerUtil()
メソッドの詳細

getComponentNoException

public static Object getComponentNoException(String componentName)
指定された名前に対応するコンポーネントを S2Container から取得して返します。

コンポーネントが存在しない場合は例外をスローせず、null を返します。

パラメータ:
componentName - コンポーネント名称
戻り値:
コンポーネントオブジェクト

getComponentDef

public static ComponentDef getComponentDef(String componentName)
指定された名前に対応するコンポーネントを S2Container から取得して返します。

パラメータ:
componentName - コンポーネント名称
戻り値:
コンポーネントオブジェクト

getComponentDef

public static ComponentDef getComponentDef(Class<?> componentClass)
指定されたクラスに対応するコンポーネントを S2Container から取得して返します。

パラメータ:
componentClass - コンポーネントクラス
戻り値:
コンポーネントオブジェクト

getComponent

public static Object getComponent(Class<?> componentClass)
指定されたクラスに対応するコンポーネントを S2Container から取得して返します。

パラメータ:
componentClass - コンポーネントクラス
戻り値:
コンポーネントオブジェクト

injectDependency

public static void injectDependency(Object target,
                                    S2Container container)
指定されたオブジェクトに対して S2Container からコンポーネントをインジェクションします。

target で指定されたオブジェクトに対して、container で指定された S2Container からコンポーネントをインジェクションします。

パラメータ:
target - ターゲットオブジェクト
container - S2Container オブジェクト


Copyright © 2006-2007 The Seasar Foundation. All Rights Reserved.