mercredi 24 août 2022

org.reflections without specifying a package

I am coding a little "framework" to be used by other people. For that, it is necessary to find a class that has a specific annotation at runtime.

This is a simple task using org.reflections library. However, as far as I know this library needs a package prefix to search the annotation in (cannot leave it blank). But since the framework is supposed to be used by several people, I cannot limit the package prefix.

Instead, I want to search the entire scope for classes with the given annotation.

Is this possible with org.reflections? Note that I cannot rely on any contextual dependencies like spring because the framework should work in every environment





Aucun commentaire:

Enregistrer un commentaire