Class UelUtil

java.lang.Object
org.apache.ofbiz.base.util.string.UelUtil

public final class UelUtil extends Object
Implements the Unified Expression Language (JSR-245).
  • Method Details

    • getLocalizedMapLocaleKey

      public static String getLocalizedMapLocaleKey()
    • evaluate

      public static Object evaluate(Map<String,? extends Object> context, String expression)
      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 expression
      expectedType - 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 expression
      expectedType - The expected object Class to set
    • removeValue

      public static void removeValue(Map<String,Object> context, String expression)
      Evaluates a Unified Expression Language expression and sets the resulting object to null.
      Parameters:
      context - Evaluation context (variables)
      expression - UEL expression
    • prepareExpression

      public static String prepareExpression(String expression)
      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: