Here you can find the source of invoke(Method method, Object target, Object... arguments)
Parameter | Description |
---|---|
method | a parameter |
target | a parameter |
arguments | a parameter |
Parameter | Description |
---|---|
RuntimeException | an exception |
public static Object invoke(Method method, Object target, Object... arguments) throws RuntimeException
//package com.java2s; //License from project: Apache License import java.lang.reflect.Method; public class Main { /**/* w ww . j a va2 s . co m*/ * Invoke a method of the provided target with the provided arguments. Wraps any exception in a {@link RuntimeException} * @param method * @param target * @param arguments * @return * @throws RuntimeException */ public static Object invoke(Method method, Object target, Object... arguments) throws RuntimeException { try { return method.invoke(target, arguments); } catch (Exception e) { throw new RuntimeException(e); } } }