Java Reflection Method Get from Object getMethodsForObject(Object o2, String[] passedMethods)

Here you can find the source of getMethodsForObject(Object o2, String[] passedMethods)

Description

get Methods For Object

License

Apache License

Declaration

public static Method[] getMethodsForObject(Object o2, String[] passedMethods)
        throws SecurityException, NoSuchMethodException 

Method Source Code

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

import java.lang.reflect.Method;

public class Main {
    /***********************************************************************/
    public static Method[] getMethodsForObject(Object o2, String[] passedMethods)
            throws SecurityException, NoSuchMethodException {
        Method methods[] = new Method[passedMethods.length];
        Class clazz = o2.getClass();
        for (int i = 0; i < passedMethods.length; i++) {
            methods[i] = clazz.getMethod(passedMethods[i], (Class[]) null);
        }/*from   ww  w.jav  a 2s  . c  o  m*/
        return methods;
    }
}

Related

  1. getMethods(Object obj, int cmpModifier, String prefix)
  2. getMethodsAnnotatedWith(Class ann, Object o)
  3. getMethodsAnnotatedWith(Object target, Class annotation)
  4. getMethodsAnnotatedWithValue(Class anno, Object o, String name, Object value)
  5. getMethodsByStartsWithName(String name, Object o)
  6. getMethodsIncludingHierarchy(Object comp, Class annotation)
  7. getMethodValue(Method method, Object instance)
  8. getMethodValue(Object base, Method method)
  9. getMethodValue(Object target, String methodName)