Inject bean into enum
问题 I have the DataPrepareService that prepare data for reports and I have an Enum with report types, and I need to inject ReportService into Enum or have access to ReportService from enum. my service: @Service public class DataPrepareService { // my service } my enum: public enum ReportType { REPORT_1("name", "filename"), REPORT_2("name", "filename"), REPORT_3("name", "filename") public abstract Map<String, Object> getSpecificParams(); public Map<String, Object> getCommonParams(){ // some code