Here you can find the source of getAnnotationDefault(Class extends Annotation> annotationClass, String element)
@SuppressWarnings("unchecked") public static <T> T getAnnotationDefault(Class<? extends Annotation> annotationClass, String element)
//package com.java2s; //License from project: Apache License import java.lang.annotation.Annotation; import java.lang.reflect.Method; public class Main { @SuppressWarnings("unchecked") public static <T> T getAnnotationDefault(Class<? extends Annotation> annotationClass, String element) { Method method = null;//from w w w. j a va 2 s. c om try { method = annotationClass.getMethod(element, (Class[]) null); } catch (NoSuchMethodException e) { return null; } return ((T) method.getDefaultValue()); } }