Mega Code Archive

 
Categories / Java Book / 008 Reflection
 

0465 Get the annotations

<A extends Annotation>A getAnnotation(Class<A> annotationClass) Returns this element's annotation for the specified type if such an annotation is present, else null. Annotation[] getAnnotations() Returns all annotations present on this element. Annotation[] getDeclaredAnnotations() Returns all annotations that are directly present on this element.