public static < T , A extends Annotation > String getClassAnnotationValue ( Class < T > classType , Class < A > annotationType , String attributeName ) { String value = null ; Annotation annotation = classType . getAnnotation ( annotationType ) ; if ( annotation != null ) { try { value = ( String ) annotation . annotationType ( ) . getMethod ( attributeName ) . invoke ( annotation ) ; } catch ( Exception ex ) { } } return value ; }
Get the value of a Annotation in a class declaration .