org.seasar.cubby.util
クラス CubbyUtils

java.lang.Object
  上位を拡張 org.seasar.cubby.util.CubbyUtils

public class CubbyUtils
extends Object

Cubby内部で使用するユーティリティクラスです。

導入されたバージョン:
1.0.0
作成者:
baba

コンストラクタの概要
CubbyUtils()
           
 
メソッドの概要
static String escapeHtml(Object str)
          指定された文字列をHTMLとしてエスケープします。
static RequestMethod[] getAcceptableRequestMethods(Class<?> actionClass, Method method)
          指定されたアクションメソッドが受付可能なリクエストメソッドを取得します。
static String getActionDirectory(Class<?> actionClass)
          指定されたアクションクラスに対応するディレクトリを取得します。
static String getActionPath(Class<?> actionClass, Method method)
          指定されたアクションメソッドのパスを取得します。
static String getInternalForwardPath(Class<? extends Action> actionClass, String methodName)
          アクションクラスとメソッド名から内部フォワードのパスへ変換します。
static int getObjectSize(Object value)
          指定されたオブジェクトのサイズを取得します。
static String getPath(HttpServletRequest request)
          リクエストのURIからコンテキストパスを除いたパスを返します。
static boolean isActionClass(Class<?> clazz)
          指定されたクラスがアクションメソッドかを示します。
static boolean isActionMethod(Method method)
          指定されたメソッドがアクションメソッドかを示します。
static String replaceFirst(String text, String replace, String with)
          指定された文字列のなかで、最初に出現した置換対象を置換文字列で置き換えます。
static String[] split2(String text, char delim)
          指定された文字列を区切り文字で区切った文字列の配列に変換します。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

CubbyUtils

public CubbyUtils()
メソッドの詳細

getActionDirectory

public static String getActionDirectory(Class<?> actionClass)
指定されたアクションクラスに対応するディレクトリを取得します。

パラメータ:
actionClass - アクションクラス
戻り値:
アクションクラスに対応するディレクトリ

getActionPath

public static String getActionPath(Class<?> actionClass,
                                   Method method)
指定されたアクションメソッドのパスを取得します。

パラメータ:
actionClass - アクションクラス
method - アクションメソッド
戻り値:
アクションメソッドのパス

getAcceptableRequestMethods

public static RequestMethod[] getAcceptableRequestMethods(Class<?> actionClass,
                                                          Method method)
指定されたアクションメソッドが受付可能なリクエストメソッドを取得します。

パラメータ:
actionClass - アクションクラス
method - アクションメソッド
戻り値:
受付可能なリクエストメソッド

getObjectSize

public static int getObjectSize(Object value)
指定されたオブジェクトのサイズを取得します。

パラメータ:
value - オブジェクト
戻り値:
オブジェクトのサイズ

getPath

public static String getPath(HttpServletRequest request)
リクエストのURIからコンテキストパスを除いたパスを返します。

パラメータ:
request - リクエスト
戻り値:
コンテキストパスを除いたパス

getInternalForwardPath

public static String getInternalForwardPath(Class<? extends Action> actionClass,
                                            String methodName)
アクションクラスとメソッド名から内部フォワードのパスへ変換します。

パラメータ:
actionClass - アクションクラス
methodName - メソッド名
戻り値:
内部フォワードパス

isActionClass

public static boolean isActionClass(Class<?> clazz)
指定されたクラスがアクションメソッドかを示します。

パラメータ:
clazz - クラス
戻り値:
指定されたクラスがアクションクラスの場合は true、そうでない場合は false

isActionMethod

public static boolean isActionMethod(Method method)
指定されたメソッドがアクションメソッドかを示します。

パラメータ:
method - メソッド
戻り値:
指定されたメソッドがアクションメソッドの場合は true、そうでない場合は false

replaceFirst

public static String replaceFirst(String text,
                                  String replace,
                                  String with)
指定された文字列のなかで、最初に出現した置換対象を置換文字列で置き換えます。

パラメータ:
text - 対象の文字列
replace - 置換対象
with - 置換文字列
戻り値:
最初に出現した置換対象を置換文字列で置き換えた文字列

split2

public static String[] split2(String text,
                              char delim)
指定された文字列を区切り文字で区切った文字列の配列に変換します。

パラメータ:
text - 対象の文字列
delim - 区切り文字
戻り値:
指定された文字列を区切り文字で区切った文字列の配列

escapeHtml

public static String escapeHtml(Object str)
指定された文字列をHTMLとしてエスケープします。

変換前 変換後
& &amp;
< &lt;
> &gt;
" &quot;
' &#39

パラメータ:
str -
戻り値:
エスケープされた文字列


Copyright ツゥ 2006-2008 The Seasar Foundation. All Rights Reserved.