Invokes the specified method. @param method method to run @param object object (null for static methods) @param args arguments @return result of method call or null
(final Method method, final Object object, final Object... args)
| 194 | * @return result of method call or {@code null} |
| 195 | */ |
| 196 | public static Object invoke(final Method method, final Object object, final Object... args) { |
| 197 | try { |
| 198 | return method != null ? method.invoke(object, args) : null; |
| 199 | } catch(final Throwable ex) { |
| 200 | Util.debug(ex); |
| 201 | return null; |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | /** |
| 206 | * Returns the value of a field. |