I'm not aware of a library that does this, but there are open source projects that do this for their own purposes. For example, Spring can iterate over classes in the classpath to find ones that have a certain annotation. You could take a look at how they do it to get some ideas. I'd start with the classes in the org.springframework.context.annotation package such as ClassPathScanningCandidateComponentProvider and CommonAnnotationBeanPostProcessor.