Here you can find the source of getAnnotationAttribute(Annotation a, String attrName)
attrName
attribute name.
public static Object getAnnotationAttribute(Annotation a, String attrName)
//package com.java2s; //License from project: Open Source License import java.lang.annotation.Annotation; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class Main { /**/* w ww . j av a 2s .c o m*/ * Returns attribute value of given annotation with <code>attrName</code> attribute name. */ public static Object getAnnotationAttribute(Annotation a, String attrName) { try { Method method = a.annotationType().getMethod(attrName); return method.invoke(a); } catch (NoSuchMethodException e) { throw new AssertionError(e); } catch (SecurityException e) { throw new AssertionError(e); } catch (IllegalAccessException e) { throw new AssertionError(e); } catch (IllegalArgumentException e) { throw new AssertionError(e); } catch (InvocationTargetException e) { throw new AssertionError(e); } } }