Java Reflection Method Invoke invoke(Method method, Object object, Object... arguments)

Here you can find the source of invoke(Method method, Object object, Object... arguments)

Description

invoke

License

Apache License

Declaration

private static Object invoke(Method method, Object object, Object... arguments) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.lang.reflect.Method;
import java.util.Arrays;

public class Main {
    private static Object invoke(Method method, Object object, Object... arguments) {
        Object result = null;//from ww w .j av a2s  . c om
        try {
            if (!method.isAccessible()) {
                method.setAccessible(true);
            }
            result = method.invoke(object, arguments);
        } catch (Exception ignored) {
            System.err.printf("%s method[arguments : %s] can't be invoked in object[%s]!\n", method.getName(),
                    Arrays.asList(arguments), object);
        }

        return result;
    }
}

Related

  1. invoke(Method method, Object it, Object... args)
  2. invoke(Method method, Object javaBean, Object value)
  3. invoke(Method method, Object obj, Object... args)
  4. invoke(Method method, Object obj, Object... args)
  5. invoke(Method method, Object object, Object... args)
  6. invoke(Method method, Object object, Object... arguments)
  7. invoke(Method method, Object object, Object... parameters)
  8. invoke(Method method, Object object, Object[] args, Class exceptionToThrow)
  9. invoke(Method method, Object target, Object... args)