From 9a6dba8db7e5760bea479d64dfb127cfcc585083 Mon Sep 17 00:00:00 2001 From: n9Mtq4 Date: Wed, 24 Jun 2015 22:34:57 -0400 Subject: [PATCH] new lower level method invoking with static --- .../n9mtq4/reflection/ReflectionHelper.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/com/n9mtq4/reflection/ReflectionHelper.java b/src/com/n9mtq4/reflection/ReflectionHelper.java index d033780..91e8836 100644 --- a/src/com/n9mtq4/reflection/ReflectionHelper.java +++ b/src/com/n9mtq4/reflection/ReflectionHelper.java @@ -1548,6 +1548,18 @@ public static E callObjectMethod(String methodName, Object obj, Object... pa return callObjectMethod(methodName, obj, getClassParams(params), params); } + /** + * Call static object method. + * + * @param the type parameter + * @param method the method + * @param params the params + * @return the e + */ + public static E callStaticObjectMethod(Method method, Object... params) { + return callObjectMethod(method, null, params); + } + /** * Call static object method. * @@ -1559,7 +1571,12 @@ public static E callObjectMethod(String methodName, Object obj, Object... pa * @return the object */ public static E callStaticObjectMethod(String methodName, Class clazz, Class[] classParams, Object[] params) { - return callObjectMethod(methodName, null, clazz, classParams, params); + try { + return callStaticObjectMethod(getAllDeclaredMethod(methodName, classParams, clazz)); + }catch (NoSuchMethodException e) { + e.printStackTrace(); + } + return null; } /**