RE: Can JEXL expression invoke call my own method (and if so how)?

2020-05-03 Thread Greenberg, Gary
Yes, you can use your own classes and custom method. You do need to specify you class in namespaces declaration, like this: Map< String, Object> ns = new HashMap< >(); ns.put("foo", new Foo()); ns,put("bar", new Bar()); JexlEngine engine = (new JexlBuilder()).namespaces(ns).create(); Now in your

RE: [jexl] How to use math functions with JEXL

2020-04-20 Thread Greenberg, Gary
8 PM To: Commons Users List Subject: Re: [jexl] How to use math functions with JEXL Hi, Did you import the Math library? import java.lang.Math; Joakim søn. 19. apr. 2020, 07:21 skrev Greenberg, Gary : > I am trying to evaluate an expression that beside simple arithmetic > need to calcul

[jexl] How to use math functions with JEXL

2020-04-18 Thread Greenberg, Gary
I am trying to evaluate an expression that beside simple arithmetic need to calculate square root. I tried sqrt(), Math.sqrt() and java.lang.Math.sqrt and nothing works I am always getting something like @1:1 undefined variable java.lang.Math. I did use before expr4j and it has all these functions