Java Reflection Method Invoke invokeMethod(Object object, Method method, Object... args)

Here you can find the source of invokeMethod(Object object, Method method, Object... args)

Description

invoke Method

License

Apache License

Declaration

public static Object invokeMethod(Object object, Method method, Object... args)
        throws IllegalAccessException, IllegalArgumentException, InvocationTargetException 

Method Source Code

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

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class Main {

    public static Object invokeMethod(Object object, Method method, Object... args)
            throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
        method.setAccessible(true);//www  .ja  v  a  2 s .co m
        return method.invoke(object, args);
    }
}

Related

  1. invokeMethod(Object obj, String methodName, Object... args)
  2. invokeMethod(Object obj, String methodName, Object... args)
  3. invokeMethod(Object obj, String methodname, Object... args)
  4. invokeMethod(Object obj, String methodName, Object... params)
  5. invokeMethod(Object obj, String methodName, Object[] params, Class[] paramTypes)
  6. invokeMethod(Object object, String methodName, Class[] parameterTypes, Object[] parameters)
  7. invokeMethod(Object object, String methodName, Class[] signature, Object[] parameters)
  8. invokeMethod(Object object, String methodName, List argList)
  9. invokeMethod(Object object, String methodName, Object arg, Class argType)