Skip to content

Commit

Permalink
new lower level method invoking with static
Browse files Browse the repository at this point in the history
  • Loading branch information
n9Mtq4 committed Jun 25, 2015
1 parent 7225d96 commit 9a6dba8
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/com/n9mtq4/reflection/ReflectionHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -1548,6 +1548,18 @@ public static <E> E callObjectMethod(String methodName, Object obj, Object... pa
return callObjectMethod(methodName, obj, getClassParams(params), params);
}

/**
* Call static object method.
*
* @param <E> the type parameter
* @param method the method
* @param params the params
* @return the e
*/
public static <E> E callStaticObjectMethod(Method method, Object... params) {
return callObjectMethod(method, null, params);
}

/**
* Call static object method.
*
Expand All @@ -1559,7 +1571,12 @@ public static <E> E callObjectMethod(String methodName, Object obj, Object... pa
* @return the object
*/
public static <E> 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;
}

/**
Expand Down

0 comments on commit 9a6dba8

Please sign in to comment.