jeudi 15 février 2018

Java: how to scan classes without knowing package names?

I'm programming an API that provides functionalities based on annotations on classes. The API would be imported, so it has no knowledge of client's packages. So the question is: how to scan classes without knowing package names?

I found these methods:

Package.getPackages()

but it only returns a subset of packages.

ClassPathScanningCandidateComponentProvider.findCandidateComponents(basePackageName)

but is doesn't accept wildcards, such as * or ..





Aucun commentaire:

Enregistrer un commentaire