Here you can find the source of getAnnotationAttributes(Annotation annotation)
public static Map getAnnotationAttributes(Annotation annotation)
//package com.java2s; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; public class Main { public static Map getAnnotationAttributes(Annotation annotation) { Map attrs = new HashMap(); Method methods[] = annotation.annotationType().getDeclaredMethods(); for (int j = 0; j < methods.length; j++) { Method method = methods[j]; if (method.getParameterTypes().length != 0 || method.getReturnType() == Void.TYPE) continue; try { attrs.put(method.getName(), method.invoke(annotation, new Object[0])); } catch (Exception ex) { throw new IllegalStateException("Could not obtain annotation attribute values", ex); }//w ww . ja va 2 s . c o m } return attrs; } }