For example:
@SubAnnotation
public class Test {
public static void main(String args[]){
Annotation[] annotations = Test.class.getAnnotations();
for(Annotation annot: annotations){
System.out.println(annot);
}
}
}
@Retention(RetentionPolicy.RUNTIME)
@SuperAnnotation
public @interface SubAnnotation {
}
How to obtain SuperAnnotation on Test.class?
Aucun commentaire:
Enregistrer un commentaire