Class UelUtil
java.lang.Object
org.apache.ofbiz.base.util.string.UelUtil
Implements the Unified Expression Language (JSR-245).
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
Evaluates a Unified Expression Language expression and returns the result.static Object
Evaluates a Unified Expression Language expression and returns the result.static String
static String
prepareExpression
(String expression) Prepares an expression for evaluation by UEL.static void
removeValue
(Map<String, Object> context, String expression) Evaluates a Unified Expression Language expression and sets the resulting object to null.static void
Evaluates a Unified Expression Language expression and sets the resulting object to the specified value.
-
Method Details
-
getLocalizedMapLocaleKey
-
evaluate
Evaluates a Unified Expression Language expression and returns the result.- Parameters:
context
- Evaluation context (variables)expression
- UEL expression- Returns:
- Result object
-
evaluate
public static Object evaluate(Map<String, ? extends Object> context, String expression, Class<?> expectedType) Evaluates a Unified Expression Language expression and returns the result.- Parameters:
context
- Evaluation context (variables)expression
- UEL expressionexpectedType
- The expected object Class to return- Returns:
- Result object
-
setValue
public static void setValue(Map<String, Object> context, String expression, Class<?> expectedType, Object value) Evaluates a Unified Expression Language expression and sets the resulting object to the specified value.- Parameters:
context
- Evaluation context (variables)expression
- UEL expressionexpectedType
- The expected object Class to set
-
removeValue
Evaluates a Unified Expression Language expression and sets the resulting object to null.- Parameters:
context
- Evaluation context (variables)expression
- UEL expression
-
prepareExpression
Prepares an expression for evaluation by UEL.The OFBiz syntax is converted to UEL-compatible syntax and the resulting expression is returned.
- Parameters:
expression
- Expression to be converted- Returns:
- Converted expression
- See Also:
-