commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Gilde <>
Subject RE: JEXL Questions
Date Thu, 09 Dec 2004 02:12:28 GMT
For (1), it sounds to me like you want to put the result of TRIANGLEAREA in
a variable in the JexlContext and pass that context into a second JEXL

For (2), you can't (well, you can, but not easily) find the variables in the
expression programmatically. However, if you know the variables a priori,
you can write a function that takes those variables and puts them into the
context. If you don't know them, you can just pass a Map of variables into
the context.

-----Original Message-----
From: Your Name [] 
Sent: Wednesday, December 08, 2004 1:54 PM
Subject: JEXL Questions


I've been checking out JEXL and is very easy to use. I was wondering if 
I can do the following things:

1.- Define an expression and then reuse that expression as a function. 
I want to be able to let users configure their own expressions and then 
reuse them in another expression. Something like this:

Function TRIANGLEAREA: (a * b) / 2.
Reuse the function: a + TRIANGLEAREA (a, b) + b. 

2.- For a particular expression know what variables depend on the 
expression. I want to be able to expose the expression as a function 
with parameters.


Nestor Boscan
NeoMail -

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message