点击查看代码
@RequestMapping("test1")
public String getCustImpl(){
List<String> list = new ArrayList<String>();
Map<String, CustImplService> beansOfType = applicationContext.getBeansOfType(CustImplService.class);
for(Map.Entry<String, CustImplService> entry :beansOfType.entrySet()){
CustImplService value = entry.getValue();
System.out.println(entry.getKey());
if(!"custImplService".equals(entry.getKey())){
String str1 = value.getCustImpl();
list.add(str1);
}
}
return list.toString();
}
java 枚举类的应用:
https://blog.csdn.net/m0_71777195/article/details/129613128