开发者

Can you define functions in a JEXL Script?

开发者 https://www.devze.com 2023-03-15 05:26 出处:网络
A JEXL Script is not the same as a JEXL Expression. I see references to functions in the source code, but I see no documentation about it. Has it maybe not been im开发者_如何学JAVAplemented yet?

A JEXL Script is not the same as a JEXL Expression.

I see references to functions in the source code, but I see no documentation about it. Has it maybe not been im开发者_如何学JAVAplemented yet?

There is a JSR-223 interface for it.


If you need to defined functions, then you should use the JexlEngine#setFunctions(Map namespace2FunctorMap). See the Javadoc (currently down ;-( )

If you need methods, then you should add to your JexlContext the objects having the methods you want to call. See "calling methods" in this page.

Under the hood, Jexl uses reflection to call methods if I can properly remember.

0

精彩评论

暂无评论...
验证码 换一张
取 消