クラス FieldUtils
java.lang.ObjectSE
org.springframework.security.util.FieldUtils
フィールドを直接操作するための静的メソッドを提供します。
方法の概要
修飾子と型メソッド説明static FieldSE
クラスで指定されたフィールドを見つけようとします。static ObjectSE
getFieldValue
(ObjectSE bean, StringSE fieldName) Bean の(ネストされた)フィールドの値を返します。static ObjectSE
getProtectedFieldValue
(StringSE protectedField, ObjectSE object) static void
setProtectedFieldValue
(StringSE protectedField, ObjectSE object, ObjectSE newValue)
メソッドの詳細
getField
クラスで指定されたフィールドを見つけようとします。- パラメーター:
clazz
- フィールドを含むクラス定義fieldName
- 検索するフィールドの名前- 戻り値:
- フィールド (非 null)
- 例外:
IllegalStateExceptionSE
- フィールドが見つからなかった場合
getFieldValue
public static ObjectSE getFieldValue(ObjectSE bean, StringSE fieldName) throws IllegalAccessExceptionSE Bean の(ネストされた)フィールドの値を返します。テストを目的としています。- パラメーター:
bean
- オブジェクトfieldName
- "." を含むフィールド名ネストされたプロパティの分離- 戻り値:
- ネストされたフィールドの値
- 例外:
IllegalAccessExceptionSE
getProtectedFieldValue
setProtectedFieldValue