commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Gilde <hgilde-comm...@earthlink.net>
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
expression?

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 [mailto:nestor.boscan@tcs.com.ve] 
Sent: Wednesday, December 08, 2004 1:54 PM
To: commons-user@jakarta.apache.org
Subject: JEXL Questions

Hi

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.

Regards,

Nestor Boscan
-- 
NeoMail - http://neomail.sourceforge.net

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


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


Mime
View raw message