Prem Lall | 8 Aug 23:01
Picon
Favicon

Using dotted notation in expressions

Hi,

I am try to use JEL to help me evaluate expressions like
"myObject.getField1() ==true"..

I have managed to get things like "\"abc\".length()" to work, but run into
problems when I try to use an actual object.
//cant seem to get the following to work
      String testStr = "abc";
      String expr = testStr .length()";

Any insights you could offer would be most appreciated...
Thanks a lot.
Prem Lall
BMF E-File Project Team
800 North Frederick Road
Gaithersburg,  MD  20879
premlall <at> us.ibm.com
"The needs of the business outweigh the needs of the few"
"Pressure turns coal into diamonds"
Picon

Re: Using dotted notation in expressions

Hello !

> I am try to use JEL to help me evaluate expressions like
> "myObject.getField1() ==true"..
Yes, JEL is very suitable for evaluating such dynamic Boolean constraints.

> I have managed to get things like "\"abc\".length()" to work, but run into
> problems when I try to use an actual object.
> //cant seem to get the following to work
>       String testStr = "abc";
>       String expr = testStr .length()";
I have tested it a minute ago, and the dot operators on String objects
from the "dynamic" library work. It looks like the problem in your case is
not the dot operator but the library initialization, so that the "testStr"
field/method is not accessible.

It will be very helpful if you tell me how particularly your expression
fails, whether any exception is thrown at compilation or execution stages.  
Also, it can be useful to run your program against "jel_g.jar" (from JEL
distribution), which will report JEL interfacing errors in more detail.

If the previous suggestions do not help, please send me a code snippet 
(which compile and fail), so that I can trace the problem myself.

Thank you for your interest in JEL !

With the best regards,
                       Konstantin.

Gmane