Java Method Call invoke(Object thisObject, Method method)

Here you can find the source of invoke(Object thisObject, Method method)

Description

invoke

License

Open Source License

Declaration

public static <T> T invoke(Object thisObject, Method method)
            throws IllegalAccessException, InvocationTargetException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    public static final Class<?>[] NO_PARAM_SIGNATURE = new Class<?>[0];

    public static <T> T invoke(Object thisObject, Method method)
            throws IllegalAccessException, InvocationTargetException {
        return (T) method.invoke(thisObject, NO_PARAM_SIGNATURE);
    }//from  w w  w.  j  a  va2 s  . c o  m

    public static <T> T invoke(Object thisObject, Method method, Object parameter)
            throws IllegalAccessException, InvocationTargetException {
        return (T) method.invoke(thisObject, parameter);
    }
}

Related

  1. invoke(Object target, String methodName, Object... args)
  2. invoke(Object target, String methodName, Object[] args)
  3. invoke(Object target, String name, Class[] params, Object[] args)
  4. invoke(Object targetObject, String method, Class[] paramTypes, Object[] paramValues)
  5. invoke(Object targetObject, String methodName, Object... params)
  6. invoke(ObjectName objectName, Object[] params, String[] signature, String operationName)
  7. invoke(ObjectName objectName, String attribute, Object[] params, String[] signatur)
  8. invoke(Optional method, Class clazz, Object... args)
  9. invoke(String className, String methodName, Class[] paramTypes, Object... params)