public enum ReportType { REPORT_1("name", "filename"), REPORT_2("name", "filename"); @Component public static class ReportTypeServiceInjector { @Autowired private DataPrepareService dataPrepareService; @PostConstruct public void postConstruct() { for (ReportType rt : EnumSet.allOf(ReportType.class)) rt.setDataPrepareService(dataPrepareService); } }[...]}如果将内部类更改为静态,则weekens的答案有效,因此spring可以看到



