当前位置: 代码迷 >> J2EE >> enum被当做关键字,该怎么处理
  详细解决方案

enum被当做关键字,该怎么处理

热度:297   发布时间:2016-04-22 02:36:18.0
enum被当做关键字
现在做一个二次开发的项目
以前的JDK是1.4 现在的JDK是1.5 ,
Java code
 org.apache.axis.description.OperationDesc oper;        oper = new org.apache.axis.description.OperationDesc();        oper.setName("dexptReceiveMsg");        oper.setStyle(org.apache.axis.enum.Style.WRAPPED);        oper.setUse(org.apache.axis.enum.Use.LITERAL);


现在
oper.setStyle(org.apache.axis.enum.Style.WRAPPED);
oper.setUse(org.apache.axis.enum.Use.LITERAL);
这两行中的enum 被当做枚举的类型
我想让它作为枚举类型的关键字,有没有办法解决
用的是Eclipse3.2.2, jdk1.5


------解决方案--------------------
哎。。。年轻人,难道真的要别人帮你搜索么?给点辛苦分吧
解决办法:1、将代码“oper.setStyle(org.apache.axis.enum.Style.RPC);”修改为”oper.setStyle(Style.getStyle("rpc"));“;2、将代码“oper.setUse(org.apache.axis.enum.Use.ENCODED);”修改为“oper.setUse(Use.getUse("encoded")); ”;3、添加代码”import org.apache.axis.constants.Style;
import org.apache.axis.constants.Use;“
  相关解决方案