Java Reflection Method Name getMethod(String className, String functionName, Class[] paramTypes)

Here you can find the source of getMethod(String className, String functionName, Class[] paramTypes)

Description

get Method

License

Apache License

Declaration

public static Method getMethod(String className, String functionName, Class[] paramTypes)
            throws ClassNotFoundException, SecurityException, NoSuchMethodException 

Method Source Code

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

import java.lang.reflect.Method;

public class Main {
    public static Method getMethod(String className, String functionName, Class[] paramTypes)
            throws ClassNotFoundException, SecurityException, NoSuchMethodException {
        Method method = null;//from   www . j  a va 2 s.co m
        Class actionClassObj;
        actionClassObj = Class.forName(className);
        method = actionClassObj.getMethod(functionName, paramTypes);
        return method;
    }

    public static Method getMethod(String className, String functionName, Class[] paramTypes,
            ClassLoader customClassLoader) throws ClassNotFoundException, SecurityException, NoSuchMethodException {
        Method method = null;
        Class actionClassObj;
        actionClassObj = Class.forName(className, false, customClassLoader);
        method = actionClassObj.getMethod(functionName, paramTypes);
        return method;
    }
}

Related

  1. getMethod(final String methodName, final Class objClass, final Class[] paramClasses)
  2. getMethod(int requireMod, int bannedMod, Class clazz, String methodName, Class... params)
  3. getMethod(Method[] methods, String name)
  4. getMethod(Method[] methods, String name, Class[] params)
  5. getMethod(String className)
  6. getMethod(String className, String functionName, Class[] paramTypes)
  7. getMethod(String className, String methodName, Class[] params)
  8. getMethod(String methodName, Class clazz)
  9. getMethod(String methodName, Class clazz, Class... args)