Possible Solution - Scan Java Runtime Annotations
Use org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
API
A component provider that scans the class path from the base package. This then applies the exceptions and filters on the resulting classes in find candidates.
ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(<DO_YOU_WANT_TO_USE_DEFAULT_FILTER>); scanner.addIncludeFilter(new AnnotationTypeFilter(<TYPE_YOUR_ANNOTATION_HERE>.class)); for (BeanDefinition bd : scanner.findCandidateComponents(<TYPE_YOUR_BASE_PACKAGE_HERE>)) System.out.println(bd.getBeanClassName());
source share