JavaSpring中枚举类的bean id是什么?

JavaSpring中枚举类的bean id是什么?,java,spring,Java,Spring,下面是我的方法,我正在为case语句将字符串转换为enum public int AnalyseRow(String UserName, String SymbolName, Date TransDate, double OpenPrice, double HighPrice, double LowPriceee, double ClosePrice, int Volume, String Splits) { System.out.println("

下面是我的方法,我正在为case语句将字符串转换为enum

   public int AnalyseRow(String UserName, String SymbolName, Date TransDate, double OpenPrice, double HighPrice, double LowPriceee, double ClosePrice, int Volume, String Splits)
        {
            System.out.println("analyse row detected ........................... X");

            String SLPoint = ""; 
            String SLType = ""; 
            String TLDPoint  = "";
            String TLUPoint = "";
            double STPoint; 
            double LTPoint;
            double MAPoint;

            boolean bTLUIsHorizontal  = false;
            double dPointDef;
            double dHorizontalPoints; 
            boolean TLDHorizontalIsSet  = false;
            boolean TLUHorizontalIsSet  = false;

            double dEntryPrice = 0; 
            double dStopLossPrice = 0;

            List objOpenLTOrders = null; 

            int intOpenLTOrdersCount = 0 ;

            List objLiveLTOrders = null; 

            int intLiveLTOrdersCount=0;

            List objOpenSTOrders=null;

            int intOpenSTOrdersCount=0;

            List objLiveSTOrders=null;
            int intLiveSTOrdersCount=0;
            List objContractSettings=null; 


            double dVolume = 0;
            double dGrossProfit=0;
            double dNetProfit=0;
            double dBrokerageCharge=0;
            double dSpreadCharge=0;

                        for(int i=0; i<count;i++)
                        {
    //                      'MsgBox(objSettingsServiceDataRow.SettingName & " - " & objSettingsServiceDataRow.SettingValue)
                            String caseOf = (settingsBusinessService.readRow(1).getSETTINGNAME());
    //                      Select Case objSettingsServiceDataRow.SettingName
                            EnumRule enum1 = EnumRule.valueOf("caseOf");


                            switch(enum1)
                            {
                                case caseOf:
                                {
                                    if( (settingsBusinessService.GetAllSettings(UserName, settings)).size() != 0)
                                    {
                                        //if (TransDate > tradingBusinessService.GetMaxStockDataTransDate(UserName, SymbolName).AddDays(Double.valueOf((objSettingsServiceDataRow.SettingValue))))
                                        {
                                            SaveLog(UserName, "WARNING DateTime Difference : Difference exceeded specified amount on trans " + SymbolName + " " + TransDate, Now(), 2);
                                            return 1;
                                            //break;
                                        }


                                    }
                                }


 }
这个类的bean id是什么? 我正在尝试属性类型,但它面临的错误是,我需要一个构造函数,因为我从未使用过它? enum类是否有任何特定的bean id类型?

已编辑:根据,您只需使用enum值:

<bean name="yourBean" class="your.pakage">
   <property name="type" value="EUR" />
</bean>

为什么您需要一个用于枚举的SpringBean?一个方法与SpringDependencyInjection有什么关系?如果没有bean,我会出错!!您的包com.ib.client.mts.backend.BusinessService应该是com.ib.client.mts.backend.BusinessService,以遵循标准命名约定。@Aritra请公布您收到的错误。
<bean name="yourBean" class="your.pakage">
   <property name="type" value="EUR" />
</bean>
<bean id="yourBean" class="com.ib.client.mts.backend.BusinessService.EnumRule" factory-method="valueOf">
    <constructor-arg>
        <value>EUR</value>
    </constructor-arg>
</bean>