Java Method Call invoke(String cls_name, String method, Class[] param_cls, Object cls, Object[] params)

Here you can find the source of invoke(String cls_name, String method, Class[] param_cls, Object cls, Object[] params)

Description

invoke

License

Open Source License

Declaration

public static Object invoke(String cls_name, String method,
            Class<?>[] param_cls, Object cls, Object[] params) 

Method Source Code

//package com.java2s;

import java.lang.reflect.Method;

public class Main {
    public static Object invoke(String cls_name, String method,
            Class<?>[] param_cls, Object cls, Object[] params) {
        try {/*from  www  . ja  va 2 s  . c o m*/
            Class<?> c = Class.forName(cls_name);
            Method m = c.getMethod(method, param_cls);
            return m.invoke(cls, params);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. invoke(Object thisObject, Method method)
  2. invoke(ObjectName objectName, Object[] params, String[] signature, String operationName)
  3. invoke(ObjectName objectName, String attribute, Object[] params, String[] signatur)
  4. invoke(Optional method, Class clazz, Object... args)
  5. invoke(String className, String methodName, Class[] paramTypes, Object... params)
  6. invoke(String method)
  7. invoke(String methodName, Object obj)
  8. invoke(String methodName, Object object, Class[] argTypes, Object[] args)
  9. invoke(String methodName, Object target, Class targetClass, Object[] args)