This software features an implementation of the unified expression language, allowing users to easily manipulate and evaluate expressions in a consistent and standardized manner.
The package de.odysseus.el.util provides a variety of useful subclasses, including javax.el.ELContext and javax.el.ELResolver. For example, utilizing this package would allow you to create a simple EL context:
```
de.odysseus.el.util.SimpleContext context = new de.odysseus.el.util.SimpleContext(new de.odysseus.el.util.SimpleResolver());
```
You can also define functions and variables within the context. For instance, to define the function math:max(int, int):
```
context.setFunction("math", "max", Math.class.getMethod("max", new Class[]{int.class, int.class}));
```
To set the variable “foo” with a value of 0:
```
context.setVariable("foo", factory.createValueExpression(0, null));
```
After defining the context, you can create an expression using the ExpressionFactory:
```
javax.el.ValueExpression e = factory.createValueExpression(context, "${math:max(foo,bar)}", null);
```
By setting the value of the top-level property ”bar” to 1, you can then evaluate the expression and return the value using:
```
System.out.println(e.getValue(context)); // --> 1
```
Additionally, JUEL jar may be run from the command line to dump the parse tree of an EL expression:
```
$ java -jar juel-2.1.x.jar "#{unified(expression[language])}"
+- #{...}
|
+- unified(...)
|
+- [...]
|
+- expression
|
+- language.
```
Overall, Java Unified Expression Language is a useful implementation of the unified expression language standard, providing several essential features for software developers seeking efficient expression evaluation.
Version 2.1.2 / 2.2.0 RC2: N/A