I searched for examples which may answer my question, but can't find any useful or complet ones... Thanks in advance
+1
A:
No, you don't.
The following lines give you all the annotation information for a Class
. Similarly you can use it for Method
and Field
objects
Annotation[] annotations = someObject.getClass().getAnnotations();
YourAnnotation annotation =
someObject.getClass().getAnnotation(YourAnnotation.class);
boolean annotationPresent =
someObject.getClass().isAnnotationPresent(YourAnnotation.class);
Bozho
2010-02-01 06:57:36