Here you can find the source of getMethodByParametersWithAnnotation(final Class> source, final Class>[] params, final Class extends Annotation> annotation)
public static Method getMethodByParametersWithAnnotation(final Class<?> source, final Class<?>[] params, final Class<? extends Annotation> annotation)
//package com.java2s; //License from project: Open Source License import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.util.Arrays; public class Main { public static Method getMethodByParametersWithAnnotation(final Class<?> source, final Class<?>[] params, final Class<? extends Annotation> annotation) { for (final Method e : source.getDeclaredMethods()) { if (Arrays.deepEquals(e.getParameterTypes(), params)) { if (e.isAnnotationPresent(annotation)) { return e; }/* www . j a v a2s. c o m*/ } } return null; } }