Here you can find the source of getMethods(Annotation anno)
public static Method[] getMethods(Annotation anno)
//package com.java2s; //License from project: Open Source License import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.ArrayList; public class Main { public static Method[] getMethods(Annotation anno) { ArrayList<Method> methods = new ArrayList<Method>(); Class<? extends Annotation> cls = anno.annotationType(); for (Method method : cls.getDeclaredMethods()) { if (Modifier.isPublic(method.getModifiers()) && method.getDeclaringClass() == cls) { methods.add(method);/* w w w . ja va2 s . c o m*/ } } return methods.toArray(new Method[methods.size()]); } }