表达式语言引擎 Commons JEXL
<p>Java Expression Language (JEXL) 是一个表达式语言引擎,可以用来在应用或者框架中使用。JEXL 受Velocity 和 JSP 标签库 1.1 (JSTL) 的影响而产生的。需要注意的是, JEXL 并不时 JSTL 中的表达式语言的实现。</p> <p>Java Expression Language (JEXL) is an expression language engine which can be embedded in applications and frameworks. JEXL is inspired by Jakarta Velocity and the Expression Language defined in the JavaServer Pages Standard Tag Library version 1.1 (JSTL) and JavaServer Pages version 2.0 (JSP). While inspired by JSTL EL, it must be noted that JEXL is not a compatible implementation of EL as defined in JSTL 1.1 (JSR-052) or JSP 2.0 (JSR-152). For a compatible implementation of these specifications, see the <a href="/misc/goto?guid=4959498282353560714">Commons EL</a> project.</p> <p>示例代码:</p> <pre class="brush:java; toolbar: true; auto-links: false;">// Create an expression object String jexlExp = "foo.innerFoo.bar()"; Expression e = ExpressionFactory.createExpression( jexlExp ); // Create a context and add data JexlContext jc = JexlHelper.createContext(); jc.getVars().put("foo", new Foo() ); // Now evaluate the expression, getting the result Object o = e.evaluate(jc);</pre> <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1322968156812" target="_blank">http://www.open-open.com/lib/view/home/1322968156812</a></p> <p></p>
本文由用户 openkk 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!