Mega Code Archive

 
Categories / Java Book / 008 Reflection
 

0412 Get annotations

boolean desiredAssertionStatus() Returns the assertion status that would be assigned to this class if it were to be initialized at the time this method is invoked. <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.