Java 在mvel中将字符串强制转换为整数

Java 在mvel中将字符串强制转换为整数,java,casting,mvel,Java,Casting,Mvel,如何在MVEL中将字符串强制转换为整数 Props['MyInteger']=java.lang.Integer.ParseInt('//xpath to some string') 其他java类型在我的代码中工作。比如说 Props['MyArrayList']=new java.util.ArrayList()已解决: “Props['MyInteger']=(int)('//xpath to some string')”问题是什么?问题是什么?问题是Props['MyInteger']=

如何在MVEL中将字符串强制转换为整数

Props['MyInteger']=java.lang.Integer.ParseInt('//xpath to some string')

其他java类型在我的代码中工作。比如说

Props['MyArrayList']=new java.util.ArrayList()

已解决:
“Props['MyInteger']=(int)('//xpath to some string')”

问题是什么?问题是什么?问题是
Props['MyInteger']=java.lang.Integer.ParseInt('//xpath to some string')
抛出错误。在mvelSolved中强制转换的正确方法是什么:
Props['MyInteger']=(int)('//xpath to some string')
看这里:在赋值部分,似乎根本不需要强制转换。这行吗
'Props['MyInteger']='//xpath到某个字符串'