ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(true); scanner.addIncludeFilter(new AnnotationTypeFilter(Tenant.class)); Set<BeanDefinition> beanDefinitions = scanner.findCandidateComponents("com.example.spex"); beanDefinitions.forEach(e -> { System.out.println(e.getBeanClassName()); });
package com.example.spex.demos.web; import java.util.List; @Tenant public class UserDTO { private String code; private List<User> content; public String getCode() { return code; } public void setCode(String code) { this.code = code; } public List<User> getContent() { return content; } public void setContent(List<User> content) { this.content = content; } }