org.seasar.framework.util
クラス FieldUtil

java.lang.Object
  拡張org.seasar.framework.util.FieldUtil

public final class FieldUtil
extends Object

Field用のユーティリティクラスです。

作成者:
higa

フィールドの概要
protected static Method GET_ELEMENT_TYPE_OF_COLLECTION_FROM_FIELD_TYPE_METHOD
          getElementTypeOfCollectionFromFieldType(Field)への定数参照です
protected static Method GET_ELEMENT_TYPE_OF_LIST_FROM_FIELD_TYPE_METHOD
          getElementTypeOfListFromFieldType(Field)への定数参照です
protected static Method GET_ELEMENT_TYPE_OF_SET_FROM_FIELD_TYPE_METHOD
          getElementTypeOfSetFromFieldType(Field)への定数参照です
protected static String REFLECTION_UTIL_CLASS_NAME
          ReflectUtilのクラス名です。
 
メソッドの概要
static Object get(Field field, Object target)
          Fieldの値をオブジェクトとして取得します。
protected static Method getElementTypeFromFieldTypeMethod(String type)
          ReflectionUtil#getElementTypeOfXxxFromFieldType()Methodを返します。
static Class getElementTypeOfCollectionFromFieldType(Field field)
          Java5以上の場合は、指定されたフィールドのパラメタ化されたコレクションの要素型を返します。
static Class getElementTypeOfListFromFieldType(Field field)
          Java5以上の場合は、指定されたフィールドのパラメタ化されたリストの要素型を返します。
static Class getElementTypeOfSetFromFieldType(Field field)
          Java5以上の場合は、指定されたフィールドのパラメタ化されたセットの要素型を返します。
static int getInt(Field field)
          staticな Fieldの値をintとして取得します。
static int getInt(Field field, Object target)
          Fieldの値をintとして取得します。
static String getString(Field field)
          staticな Fieldの値を Stringとして取得します。
static String getString(Field field, Object target)
          Fieldの値を Stringとして取得します。
static boolean isInstanceField(Field field)
          インスタンスフィールドかどうか返します。
static boolean isPublicField(Field field)
          パブリックフィールドかどうか返します。
static void set(Field field, Object target, Object value)
          Fieldに値を設定します。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

REFLECTION_UTIL_CLASS_NAME

protected static final String REFLECTION_UTIL_CLASS_NAME
ReflectUtilのクラス名です。

関連項目:
定数フィールド値

GET_ELEMENT_TYPE_OF_COLLECTION_FROM_FIELD_TYPE_METHOD

protected static final Method GET_ELEMENT_TYPE_OF_COLLECTION_FROM_FIELD_TYPE_METHOD
getElementTypeOfCollectionFromFieldType(Field)への定数参照です


GET_ELEMENT_TYPE_OF_LIST_FROM_FIELD_TYPE_METHOD

protected static final Method GET_ELEMENT_TYPE_OF_LIST_FROM_FIELD_TYPE_METHOD
getElementTypeOfListFromFieldType(Field)への定数参照です


GET_ELEMENT_TYPE_OF_SET_FROM_FIELD_TYPE_METHOD

protected static final Method GET_ELEMENT_TYPE_OF_SET_FROM_FIELD_TYPE_METHOD
getElementTypeOfSetFromFieldType(Field)への定数参照です

メソッドの詳細

get

public static Object get(Field field,
                         Object target)
                  throws IllegalAccessRuntimeException
Fieldの値をオブジェクトとして取得します。

パラメータ:
field -
target -
戻り値:
Object
例外:
IllegalAccessRuntimeException - IllegalAccessExceptionがおきた場合
関連項目:
Field.get(Object)

getInt

public static int getInt(Field field)
                  throws IllegalAccessRuntimeException
staticな Fieldの値をintとして取得します。

パラメータ:
field -
戻り値:
intの値
例外:
IllegalAccessRuntimeException - IllegalAccessExceptionが発生した場合
関連項目:
getInt(Field, Object)

getInt

public static int getInt(Field field,
                         Object target)
                  throws IllegalAccessRuntimeException
Fieldの値をintとして取得します。

パラメータ:
field -
target -
戻り値:
intの値
例外:
IllegalAccessRuntimeException - IllegalAccessExceptionが発生した場合
関連項目:
Field.getInt(Object)

getString

public static String getString(Field field)
                        throws IllegalAccessRuntimeException
staticな Fieldの値を Stringとして取得します。

パラメータ:
field -
戻り値:
Stringの値
例外:
IllegalAccessRuntimeException - IllegalAccessExceptionが発生した場合
関連項目:
getString(Field, Object)

getString

public static String getString(Field field,
                               Object target)
                        throws IllegalAccessRuntimeException
Fieldの値を Stringとして取得します。

パラメータ:
field -
target -
戻り値:
Stringの値
例外:
IllegalAccessRuntimeException - IllegalAccessExceptionが発生した場合
関連項目:
Field.get(Object)

set

public static void set(Field field,
                       Object target,
                       Object value)
                throws IllegalAccessRuntimeException
Fieldに値を設定します。

パラメータ:
field -
target -
value -
例外:
IllegalAccessRuntimeException - IllegalAccessExceptionが発生した場合
関連項目:
Field.set(Object, Object)

isInstanceField

public static boolean isInstanceField(Field field)
インスタンスフィールドかどうか返します。

パラメータ:
field -
戻り値:
インスタンスフィールドかどうか

isPublicField

public static boolean isPublicField(Field field)
パブリックフィールドかどうか返します。

パラメータ:
field -
戻り値:
パブリックフィールドかどうか

getElementTypeOfCollectionFromFieldType

public static Class getElementTypeOfCollectionFromFieldType(Field field)
Java5以上の場合は、指定されたフィールドのパラメタ化されたコレクションの要素型を返します。

パラメータ:
field - フィールド
戻り値:
フィールドのパラメタ化されたコレクションの要素型

getElementTypeOfListFromFieldType

public static Class getElementTypeOfListFromFieldType(Field field)
Java5以上の場合は、指定されたフィールドのパラメタ化されたリストの要素型を返します。

パラメータ:
field - フィールド
戻り値:
フィールドのパラメタ化されたリストの要素型

getElementTypeOfSetFromFieldType

public static Class getElementTypeOfSetFromFieldType(Field field)
Java5以上の場合は、指定されたフィールドのパラメタ化されたセットの要素型を返します。

パラメータ:
field - フィールド
戻り値:
フィールドのパラメタ化されたセットの要素型

getElementTypeFromFieldTypeMethod

protected static Method getElementTypeFromFieldTypeMethod(String type)
ReflectionUtil#getElementTypeOfXxxFromFieldType()Methodを返します。

パラメータ:
type - 取得するメソッドが対象とする型名
戻り値:
ReflectionUtil#getElementTypeOfXxxFromFieldType()Method


Copyright ? 2004-2007 The Seasar Foundation. All Rights Reserved.