Java Reflection Method Name getMethod(String className)

Here you can find the source of getMethod(String className)

Description

get Method

License

Open Source License

Declaration

public static String[] getMethod(String className) throws ClassNotFoundException 

Method Source Code

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

import java.lang.reflect.Method;

import java.util.HashSet;

import java.util.Set;

public class Main {

    public static String[] getMethod(String className) throws ClassNotFoundException {
        Class<?> classz = Class.forName(className);
        Method[] methods = classz.getMethods();
        Set<String> set = new HashSet<>();
        for (Method f : methods) {
            set.add(f.getName());/*from ww w.j  a  va2  s.c  om*/
        }
        return set.toArray(new String[set.size()]);
    }
}

Related

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