Class UelUtil


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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object evaluate​(java.util.Map<java.lang.String,​? extends java.lang.Object> context, java.lang.String expression)
      Evaluates a Unified Expression Language expression and returns the result.
      static java.lang.Object evaluate​(java.util.Map<java.lang.String,​? extends java.lang.Object> context, java.lang.String expression, java.lang.Class<?> expectedType)
      Evaluates a Unified Expression Language expression and returns the result.
      static java.lang.String getLocalizedMapLocaleKey()  
      static java.lang.String prepareExpression​(java.lang.String expression)
      Prepares an expression for evaluation by UEL.
      static void removeValue​(java.util.Map<java.lang.String,​java.lang.Object> context, java.lang.String expression)
      Evaluates a Unified Expression Language expression and sets the resulting object to null.
      static void setValue​(java.util.Map<java.lang.String,​java.lang.Object> context, java.lang.String expression, java.lang.Class<?> expectedType, java.lang.Object value)
      Evaluates a Unified Expression Language expression and sets the resulting object to the specified value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getLocalizedMapLocaleKey

        public static java.lang.String getLocalizedMapLocaleKey()
      • evaluate

        public static java.lang.Object evaluate​(java.util.Map<java.lang.String,​? extends java.lang.Object> context,
                                                java.lang.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 java.lang.Object evaluate​(java.util.Map<java.lang.String,​? extends java.lang.Object> context,
                                                java.lang.String expression,
                                                java.lang.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​(java.util.Map<java.lang.String,​java.lang.Object> context,
                                    java.lang.String expression,
                                    java.lang.Class<?> expectedType,
                                    java.lang.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​(java.util.Map<java.lang.String,​java.lang.Object> context,
                                       java.lang.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 java.lang.String prepareExpression​(java.lang.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:
        StringUtil.convertOperatorSubstitutions(java.lang.String)