我正在寻找一种列出运行时注入到特定Spring bean中的bean的方法。例如,给定这两个类:
@Controller
public class TestController {
@Autowired
private TestComponent testComponent;
private final TestService testService;
public TestController(TestService testService) {
this.testService = testService;
}
}
和
@Service
public class TestService {
}
和
@Component
public class TestComponent {
}
TestController
类的bean列表应返回:
TestService
(通过构造函数注入)TestComponent
(通过@Autowired
注解注入)是否存在现有的Spring帮助程序/实用工具可以为我返回此信息?