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
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
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