woolpack.action
クラス ActionInvoker

java.lang.Object
  上位を拡張 woolpack.action.ActionInvoker

public class ActionInvoker
extends java.lang.Object

アクションを実行するインボーカ。

作成者:
nakamura

コンストラクタの概要
ActionInvoker(Switchable<java.lang.String,ActionDef> switchable, ForwardDef... array)
          コンストラクタ。
ActionInvoker(Switchable<java.lang.String,ActionDef> switchable, java.lang.Iterable<ForwardDef> iterable)
          コンストラクタ。
 
メソッドの概要
static ActionResult findId(java.lang.Iterable<ForwardDef> iterable, java.lang.Object aReturnedObject)
          遷移先定義を検索して実行結果を返す。
protected  void handleRuntimeException(java.lang.RuntimeException exception)
          setValuesTo(Object, Map, ActionInvoker)が失敗した際に呼び出される(called)。
 ActionResult invoke(java.lang.Object root, java.lang.String id, java.util.Map inputMap)
          アクションを実行する。
static void setValuesTo(java.lang.Object root, java.util.Map inputMap, ActionInvoker invoker)
          inputMap の値を root に設定する。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

ActionInvoker

public ActionInvoker(Switchable<java.lang.String,ActionDef> switchable,
                     java.lang.Iterable<ForwardDef> iterable)
コンストラクタ。

パラメータ:
switchable - アクション id とアクション定義のSwitchable
iterable - 遷移先定義の一覧。本クラスはこの引数の状態を変化させない。ステートレスであるべき。
例外:
java.lang.NullPointerException - 引数のいずれかが null の場合。

ActionInvoker

public ActionInvoker(Switchable<java.lang.String,ActionDef> switchable,
                     ForwardDef... array)
コンストラクタ。

パラメータ:
switchable - アクション id とアクション定義のSwitchable
array - 遷移先定義の一覧。本クラスはこの引数の状態を変化させない。ステートレスであるべき。
例外:
java.lang.NullPointerException - 引数のいずれかが null の場合。
メソッドの詳細

invoke

public ActionResult invoke(java.lang.Object root,
                           java.lang.String id,
                           java.util.Map inputMap)
アクションを実行する。 このメソッドは、 アクションidに対するアクション定義を検索し、 root からActionDef.getComponentEL()でコンポーネントを取得し、 inputMap の値をコンポーネントに設定し、 root のメソッドActionDef.getMethodEL()を実行し、 実行結果にマッチする遷移先定義をActionDef.getForwardDefIterable()から検索する。 アクション定義に遷移先定義が見つからない場合、コンストラクタ引数のForwardDefの一覧から遷移先定義を検索する。

パラメータ:
root - コンポーネント・メソッド検索の基点。
id - アクション id。
inputMap - 入力値のMap。ServletRequest.getParameterMap() またはそれを ValidatorConstants.convert(Map) で変換した結果が渡されることを想定している。
戻り値:
実行結果。
例外:
ForwardDefNotFoundRuntimeException - 該当する遷移先定義が見つからない場合。
java.lang.NullPointerException - 引数のいずれかが null の場合。

setValuesTo

public static void setValuesTo(java.lang.Object root,
                               java.util.Map inputMap,
                               ActionInvoker invoker)
inputMap の値を root に設定する。

パラメータ:
root - 基点。null なら設定しない。
inputMap - 設定する値のMap
例外:
java.lang.NullPointerException - inputMap が null の場合。

handleRuntimeException

protected void handleRuntimeException(java.lang.RuntimeException exception)
setValuesTo(Object, Map, ActionInvoker)が失敗した際に呼び出される(called)。 デフォルトは何もしない。

パラメータ:
exception - setValuesTo(Object, Map, ActionInvoker) が失敗した際のエラーオブジェクト。

findId

public static ActionResult findId(java.lang.Iterable<ForwardDef> iterable,
                                  java.lang.Object aReturnedObject)
遷移先定義を検索して実行結果を返す。

パラメータ:
iterable - 遷移先定義の一覧。
aReturnedObject - メソッドが返却したオブジェクト。
戻り値:
実行結果。
例外:
ForwardDefNotFoundRuntimeException - 該当する遷移先定義が見つからない場合。


Copyright (C) 2006 Takahiro Nakamura. All rights reserved.