1
、工具介绍
String exp = “v>=10&&v<=2000&&v%10==0”;
在
js
中,能够直接运行
eval
得到结果,
java
中也可以!
在
java
中运行执行这种字符串格式数学表达式的方法:
1、
自己写按照
2、
使用第三方的工具。
1.jakarta commons JEXL.
:
Apache
出品,必属精品。
2.Beanshell
:动态语言,能够很好与
spring
集成。
3.Java Math Expression Parser jep
4.parse combinator jparsec
5.JFormula:http://www.japisoft.com/formula/
6.jeval:http://www.javagg.com/diary/67916522
7.jdk 6.0
的
script
:
java
中比较著名的
js
引擎
-mozilla
开源的
rhino
,通过动态语言的
eval
实现。
8.IK Expression
&#x