|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectjp.veritrans.tercerog.mdk.util.ReflectUtil
public class ReflectUtil
リフレクション関連共通メソッド
コンストラクタの概要 | |
---|---|
ReflectUtil()
|
メソッドの概要 | |
---|---|
static Object |
executeGetter(Method method,
Object object)
getter実行 |
static void |
executeSetter(Method method,
Object object,
Object value)
setter実行 |
static List |
getDeclaredMethodsList(Object object,
String regex)
objectに定義されているメソッドの中から、正規表現regexに該当するメソッドを取得する |
static List |
getMethodsList(Object object,
String regex)
objectに定義されているメソッドの中から、正規表現regexに該当するメソッドを取得する |
static boolean |
isCorrectGetter(Method method)
methodがpublic String getter()であることをチェックする getterメソッドの対象を抽出した上で、このメソッドを呼ぶこと |
static boolean |
isCorrectSetter(Method method)
methodがpublic void setter(String)であることをチェックする setterメソッドの対象を抽出した上で、このメソッドを呼ぶこと |
static boolean |
matchedMethod(String methodName,
String regex)
指定のメソッド名が正規表現パターンにマッチするかをチェックする。 |
クラス java.lang.Object から継承されたメソッド |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
コンストラクタの詳細 |
---|
public ReflectUtil()
メソッドの詳細 |
---|
public static List getMethodsList(Object object, String regex)
object
- メソッド取得対象となるオブジェクトregex
- メソッドを抽出するための正規表現文字列
List
オブジェクトpublic static List getDeclaredMethodsList(Object object, String regex)
object
- メソッド取得対象となるオブジェクトregex
- メソッドを抽出するための正規表現文字列
List
オブジェクトpublic static boolean matchedMethod(String methodName, String regex)
methodName
- メソッド名文字列regex
- メソッドを抽出するための正規表現文字列
public static boolean isCorrectGetter(Method method)
method
- チェック対象となるメソッドString
かString配列、Dtoクラスpublic static boolean isCorrectSetter(Method method)
method
- チェック対象となるメソッド
String
、String配列、Dtoクラス、Dtoクラス配列public static Object executeGetter(Method method, Object object) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
method
- 実行対象となるgetterのMethod
object
- getterを保有するObject
Object
InvocationTargetException
IllegalAccessException
IllegalArgumentException
public static void executeSetter(Method method, Object object, Object value) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
method
- 実行対象となるsetterのMethod
object
- setterを保有するObject
value
- 設定する値Object
IllegalArgumentException
IllegalAccessException
InvocationTargetException
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |