You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Sarel Botha <sa...@botha.us> on 2011/06/27 03:17:47 UTC

[jexl] Differences between Expression, Script and Unified

Does anyone know the best place where I can go to see the differences 
between the variations of JEXL? I've noted the following so far.

Expression
This only allows for a single command to be executed and the result from 
that is returned. If you try to use multiple commands it ignores 
everything after the first semi-colon and just returns the result from 
the first command.

Script
This allows you to put multiple commands in the expression and you can 
use variable assignments, loops, calculations, etc. The result from the 
last command is returned from the script.

Unified
This is ideal for text. To get a calculation you use the EL-like syntax 
as in ${someVariable}. The expression that goes between the brackets 
behaves like a script, not an expression. You can use semi-colons to 
execute multiple commands and the result from the last command is 
returned from the script.

Thanks,
Sarel


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [jexl] Differences between Expression, Script and Unified

Posted by henrib <he...@apache.org>.
Added your precisions to o.a.c.JEXL package.html in trunk.
Thanks again.

--
View this message in context: http://apache-commons.680414.n4.nabble.com/jexl-Differences-between-Expression-Script-and-Unified-tp3626808p3650547.html
Sent from the Commons - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [jexl] Differences between Expression, Script and Unified

Posted by henrib <he...@apache.org>.
Hi Sarel,
You summed it up perfectly!
There are no other differences that come to mind functionally.
For completeness, UJEXL also allows #{...} aka deferred expressions; this
allows early/late binding or 2-pass evaluation.
Thanks for the summary, I'll add it to the documentation momentarily.
Cheers,
Henrib

--
View this message in context: http://apache-commons.680414.n4.nabble.com/jexl-Differences-between-Expression-Script-and-Unified-tp3626808p3640440.html
Sent from the Commons - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org