微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Commons JEXL 表达式语言引擎

程序名称:Commons JEXL

授权协议: Apache

操作系统: 跨平台

开发语言: Java

Commons JEXL 介绍

Java Expression Language (JEXL) 是一个表达式语言引擎,可以用来在应用或者框架中使用。JEXL 受VeLocity 和 JSP
标签库 1.1 (JSTL) 的影响而产生的。需要注意的是, JEXL 并不时 JSTL 中的表达式语言的实现。

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 Commons
EL
project.

示例代码

// 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);

Commons JEXL 官网

http://commons.apache.org/jexl/

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐