samedi 29 juin 2019

Is there a way to get all the location of an Annotation?

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