Here you can find the source of getMethodName(final Class extends Annotation> annoType, final Class> klazType)
public static String getMethodName(final Class<? extends Annotation> annoType, final Class<?> klazType)
//package com.java2s; /**/*from w ww . j a v a 2 s . c o m*/ * Copyright (C) 2010-2012 Andrei Pozolotin <Andrei.Pozolotin@gmail.com> * * All rights reserved. Licensed under the OSI BSD License. * * http://www.opensource.org/licenses/bsd-license.php */ import java.lang.annotation.Annotation; import java.lang.reflect.Method; public class Main { public static String getMethodName(final Class<? extends Annotation> annoType, final Class<?> klazType) { final Method[] methodArray = klazType.getDeclaredMethods(); for (final Method method : methodArray) { final Annotation anno = method.getAnnotation(annoType); if (anno != null) { return method.getName(); } } return null; } }