Java Reflection Method Get from Object getMethod(Object obj, String methodName, Class paramClass)

Here you can find the source of getMethod(Object obj, String methodName, Class paramClass)

Description

get Method

License

Open Source License

Declaration

private static Method getMethod(Object obj, String methodName, Class paramClass) throws NoSuchMethodException 

Method Source Code

//package com.java2s;
/*/*from   w w  w. ja  va  2  s .com*/
 * Copyright 2001-2008 Aqris Software AS. All rights reserved.
 * 
 * This program is dual-licensed under both the Common Development
 * and Distribution License ("CDDL") and the GNU General Public
 * License ("GPL"). You may elect to use one or the other of these
 * licenses.
 */

import java.lang.reflect.Method;

public class Main {
    private static Method getMethod(Object obj, String methodName, Class paramClass) throws NoSuchMethodException {
        return getMethod(obj, methodName, new Class[] { paramClass });
    }

    private static Method getMethod(final Object obj, final String methodName, Class[] paramClasses)
            throws NoSuchMethodException {
        Class aClass = obj instanceof Class ? (Class) obj : obj.getClass();
        return aClass.getMethod(methodName, paramClasses);
    }
}

Related

  1. getMethod(Object o, String methodName, Class[] args)
  2. getMethod(Object o, String methodName, Class[] paramTypes)
  3. getMethod(Object obj, Class[] paramTypes, String methodName)
  4. getMethod(Object obj, String fieldName)
  5. getMethod(Object obj, String methodName)
  6. getMethod(Object obj, String methodName, Class... parameterTypes)
  7. getMethod(Object obj, String name, Class... types)
  8. getMethod(Object object, String methodName, Class... arguments)
  9. getMethod(Object object, String name, Object... params)