The only solution I know to get all the classes and examine whether they have a specific annotation.
for (Class clazz : classes){
clazz.isAnnotationPresent(SomeAnnotation.class);
}
I would like to use something like this:
List<Class> classesUsingAnnotation = SomeApi.getAllTargetTypeForAnnotation(SomeAnnotation.class)
Is there any API out there for this?
Aucun commentaire:
Enregistrer un commentaire