|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object org.seasar.cubby.util.CubbyUtils
public class CubbyUtils
Cubby内部で使用するユーティリティクラスです。
フィールドの概要 | |
---|---|
static Accept |
DEFAULT_ACCEPT_ANNOTATION
デフォルトの Accept アノテーション。 |
コンストラクタの概要 | |
---|---|
CubbyUtils()
|
メソッドの概要 | ||
---|---|---|
static String |
escapeHtml(Object str)
指定された文字列をHTMLとしてエスケープします。 |
|
static RequestMethod[] |
getAcceptableRequestMethods(Class<?> actionClass,
Method method)
指定されたアクションメソッドが受付可能なリクエストメソッドを取得します。 |
|
static String |
getActionDirectory(Class<? extends Action> actionClass)
指定されたアクションクラスに対応するディレクトリを取得します。 |
|
static String |
getActionPath(Class<? extends Action> actionClass,
Method method)
指定されたアクションメソッドのパスを取得します。 |
|
static
|
getAttribute(HttpServletRequest request,
String name)
リクエストから属性を取得します。 |
|
static Form |
getForm(Class<?> actionClass,
Method method)
指定されたアクションメソッドを修飾する Form を取得します。 |
|
static Object |
getFormBean(Action action,
Class<?> actionClass,
Method method)
指定されたアクションからアクションメソッドに対応するフォームオブジェクトを取得します。 |
|
static int |
getObjectSize(Object value)
指定されたオブジェクトのサイズを取得します。 |
|
static String |
getOnSubmit(Method method)
指定されたアクションメソッドを使用することを判断するためのパラメータ名を取得します。 |
|
static String |
getPath(HttpServletRequest request)
リクエストの URI からコンテキストパスを除いたパスを返します。 |
|
static int |
getPriority(Method method)
アクションメソッドの Path アノテーションから優先度を取得します。 |
|
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 |
フィールドの詳細 |
---|
public static Accept DEFAULT_ACCEPT_ANNOTATION
Accept
アノテーション。
コンストラクタの詳細 |
---|
public CubbyUtils()
メソッドの詳細 |
---|
public static String getActionDirectory(Class<? extends Action> actionClass)
actionClass
- アクションクラス
public static String getActionPath(Class<? extends Action> actionClass, Method method)
actionClass
- アクションクラスmethod
- アクションメソッド
public static RequestMethod[] getAcceptableRequestMethods(Class<?> actionClass, Method method)
actionClass
- アクションクラスmethod
- アクションメソッド
public static int getObjectSize(Object value)
value
- オブジェクト
public static String getPath(HttpServletRequest request)
request
- リクエスト
public static boolean isActionClass(Class<?> clazz)
アクションクラスは以下の条件を満たす必要があります。
Action
クラスを継承
clazz
- クラス
true
、そうでない場合は
false
public static boolean isActionMethod(Method method)
アクションメソッドは以下の条件を満たす必要があります。
ActionResult
method
- メソッド
true
、そうでない場合は
false
public static String replaceFirst(String text, String replace, String with)
text
- 対象の文字列replace
- 置換対象with
- 置換文字列
public static String[] split2(String text, char delim)
text
- 対象の文字列delim
- 区切り文字
public static String escapeHtml(Object str)
変換前 | 変換後 |
---|---|
& | & |
< | < |
> | > |
" | " |
' | ' |
str
-
public static int getPriority(Method method)
Path
アノテーションから優先度を取得します。
method
- アクションメソッド
Path
アノテーションが設定されていない場合Integer.MAX_VALUE
public static Object getFormBean(Action action, Class<?> actionClass, Method method)
action
- アクションactionClass
- アクションクラスmethod
- アクションメソッド
ActionRuntimeException
- @Formでフォームオブジェクトとなるプロパティを指定しているが、そのプロパティが
null
だった場合public static Form getForm(Class<?> actionClass, Method method)
Form
を取得します。
actionClass
- アクションクラスmethod
- アクションメソッド
Form
、修飾されていない場合はメソッドが定義されたクラスを修飾する Form
、クラスも修飾されていない場合は
null
public static String getOnSubmit(Method method)
パラメータ名によらずに実行する場合は null
を返します。
method
- アクションメソッド
public static <T> T getAttribute(HttpServletRequest request, String name)
T
- 取得する属性の型request
- リクエストname
- 属性名
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |