Here you can find the source of invokeMethod(Method method, Object object, Object... arguments)
Parameter | Description |
---|---|
method | a parameter |
object | a parameter |
arguments | a parameter |
public static Object invokeMethod(Method method, Object object, Object... arguments)
//package com.java2s; //License from project: Open Source License import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class Main { /**/*www . j a v a 2s . c om*/ * Fail-safe call. * @param method * @param object * @param arguments * @return null in case of errors. */ public static Object invokeMethod(Method method, Object object, Object... arguments) { try { return method.invoke(object, arguments); } catch (IllegalAccessException e) { } catch (IllegalArgumentException e) { } catch (InvocationTargetException e) { } return null; } }