Get target method

@param target         target object
@param methodName     method name
@param parameterTypes method parameter types
@return return value
19768
public static Method getMethod(Object target, String methodName, Class... parameterTypes) {
        try {
            return target.getClass().getMethod(methodName, parameterTypes);
        } catch (NoSuchMethodException e) {
            throw handleException(methodName, e);
        }
    }
459151
public static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) {
        if (clazz == null || methodName == null || methodName.length() == 0) {
            return null;
        }

        for (Class<?> itr = clazz; hasSuperClass(itr); ) {
            Method[] methods = itr.getDeclaredMethods();

            for (Method method : methods) {
                if (method.getName().equals(methodName) && Arrays.equals(method.getParameterTypes(), parameterTypes)) {
                    return method;
                }
            }

            itr = itr.getSuperclass();
        }
        return null;
    }
314210
private Object invokeTarget(Object target, Method method, Object[] args) throws Throwable {
        Object returnValue;
        try {
            returnValue = method.invoke(target, args);
        } catch(InvocationTargetException ite) {
            throw ite.getTargetException();
        }
        return returnValue;
    }
301125
public static <C, T> MethodInvoker getMethodInvokerForSingleArgument(Object target) {
		final AtomicReference<Method> methodHolder = new AtomicReference<Method>();
		ReflectionUtils.doWithMethods(target.getClass(),
				new ReflectionUtils.MethodCallback() {
					public void doWith(Method method)
							throws IllegalArgumentException, IllegalAccessException {
						if ((method.getModifiers() & Modifier.PUBLIC) == 0
								|| method.isBridge()) {
							return;
						}
						if (method.getParameterTypes() == null
								|| method.getParameterTypes().length != 1) {
							return;
						}
						if (method.getReturnType().equals(Void.TYPE)
								|| ReflectionUtils.isEqualsMethod(method)) {
							return;
						}
						Assert.state(methodHolder.get() == null,
								"More than one non-void public method detected with single argument.");
						methodHolder.set(method);
					}
				});
		Method method = methodHolder.get();
		return new SimpleMethodInvoker(target, method);
	}
303685
@Override
    public BufferByteOutput<T> target(final T target) {
        return (BufferByteOutput<T>) super.target(target);
    }
920521
public static Object invokeStaticMethod(final Class<?> clazz, final String methodName, final Class<?>[] parameterTypes, final Object[] parameterValues) {
		Method method = getStaticMethod(clazz, methodName, parameterTypes);
		if (method == null) {
			throw new IllegalArgumentException("Could not find method [" + methodName + "] on target [" + clazz + "]");
		}
		try {
			return method.invoke(clazz, parameterValues);
		} catch (Exception e) {
			throw convertReflectionExceptionToUnchecked(e);
		}
	}
1184616
public static Method getSetter(Object target, String property, Class<?> parameterType) {
        String setterMethodName = SETTER_PREFIX + property.substring(0, 1).toUpperCase() + property.substring(1);
        return getMethod(target, setterMethodName, parameterType);
    }
1000149
@Override
  public Method getMethod(String methodName, int parameterCount) {
    for (Method method : methods) {
      if (method.getName().equals(methodName) && method.getParameters().size() == parameterCount) {
        return method;
      }
    }
    if (extending != null) {
      return extending.getMethod(methodName, parameterCount);
    }
    return null;
  }
815981
public List<Method> getMethods( String name )
    {
        List<Method> methods = new ArrayList<Method>();
        
        for (Method method : target.getMethods())
        {
            if (compare( method.getName(), name )) methods.add(method);
        }
        return methods;
    }
1132629
public static Object invokeMethod(Object object, String methodName, Class<?>[] parameterTypes,
                                      Object[] parameters) throws NoSuchMethodException, InvocationTargetException,
            IllegalAccessException {
        if (Checker.isEmpty(parameters)) {
            return object.getClass().getMethod(methodName).invoke(object);
        } else {
            return object.getClass().getMethod(methodName, parameterTypes).invoke(object, parameters);
        }
    }
163287
public Method getTargetMethod(Exchange exchange) {

        Object o = exchange.getBindingOperationInfo().getOperationInfo().getProperty(Method.class.getName());

        if (o != null && o instanceof Method) {
            return (Method)o;
        }
        else {
            throw new RuntimeException("Target method not found on OperationInfo");
        }

    }
1302792
public MethodNode getMethod(String name, Parameter[] parameters) {
        for (MethodNode method : getMethods(name)) {
            if (parametersEqual(method.getParameters(), parameters)) {
                return method;
            }
        }
        return null;
    }
1374643
public static <T> T invokeMethod(final Object obj, final String methodName, final Object[] args,
			final Class<?>[] parameterTypes) {
		Method method = getMethod(obj.getClass(), methodName, parameterTypes);
		if (method == null) {
			throw new IllegalArgumentException("Could not find method [" + methodName + "] with parameter types:"
					+ ObjectUtil.toPrettyString(parameterTypes) + " on class [" + obj.getClass() + ']');
		}
		return invokeMethod(obj, method, args);
	}
348376
static Class<?> resolveParameterName(String parameterName, Class<?> target) {
    Map<Type, Type> typeVariableMap = getTypeVariableMap(target);
    Set<Entry<Type, Type>> set = typeVariableMap.entrySet();
    Type type = Object.class;

    for (Entry<Type, Type> entry : set) {
      if (entry.getKey().toString().equals(parameterName)) {
        type = entry.getKey();
        break;
      }
    }
    return resolveType(type, typeVariableMap);
  }
523375
public Object invoke(Object target, String... args) throws Exception
    {
        if (getter)
        {
            return field.get(target);
        }
        else
        {
            field.set(target, TypeConversion.parse(args[0], field.getType()));
            return null;
        }
    }
193488
public Method getMethod(MethodIdentifier methodIdentifier) {
        final Map<ParamNameList, Map<String, Method>> nameMap = methodsByTypeName.get(methodIdentifier.getName());
        if (nameMap == null) {
            return null;
        }
        final Map<String, Method> paramsMap = nameMap.get(createParamNameList(methodIdentifier.getParameterTypes()));
        if (paramsMap == null) {
            return null;
        }
        return paramsMap.get(methodIdentifier.getReturnType());
    }
1315509
public static <R> Function<Object,Set<R>> setOf(final Type<R> resultType, final String methodName, final Object... optionalParameters) {
        return methodForSetOf(resultType, methodName, optionalParameters);
    }