Class ExpressionUtils

  • public class ExpressionUtils
    extends Object
    • Field Detail

      • s_binders

        protected static final Set<Binder> s_binders
    • Constructor Detail

      • ExpressionUtils

        public ExpressionUtils()
    • Method Detail

      • registerBinder

        public static void registerBinder​(Binder binder)
      • createBindings

        public static Properties createBindings()
      • bind

        public static void bind​(Properties bindings,
                                ColumnModel columnModel,
                                Row row,
                                long rowIndex,
                                Record record,
                                String columnName,
                                Cell cell,
                                Map<String,​OverlayModel> overlayModels,
                                long projectId)
        Prepares the context for the evaluation of an expression by storing certain context objects within the supplied bindings.
        bindings - the dictionary representing the variables available in the expression's context
        columnModel - the list of column metadata for the project being currently evaluated
        row - the row on which the expression is evaluated
        rowIndex - the index of the row on which the expression is evaluated
        record - the enclosing record, if available (only in records mode)
        columnName - the name of the base column for the expression
        cell - the cell at the intersection of the base column and current row
        overlayModels - the overlay models stored in the grid on which the expression is evaluated
        projectId - the id of the project this expression is evaluated on
      • dependsOnPendingValues

        public static boolean dependsOnPendingValues​(Evaluable evaluable,
                                                     String baseColumnName,
                                                     ColumnModel columnModel,
                                                     Row row,
                                                     Record record)
        Checks if the given expression relies on any pending cells in the given evaluation context. If so, the result of its evaluation should be considered pending as well. This is meant to be an over-approximation: this method might return true even if the expression can actually be evaluated without relying on any pending cells. This happens for instance if the evaluable does not expose column dependencies and the evaluation context contains any pending cell.
        evaluable - the evaluable to evaluate
      • isError

        public static boolean isError​(Object o)
      • isNonBlankData

        public static boolean isNonBlankData​(Object o)
      • isTrue

        public static boolean isTrue​(Object o)
      • sameValue

        public static boolean sameValue​(Object v1,
                                        Object v2)
      • isStorable

        public static boolean isStorable​(Object v)
      • isArray

        public static boolean isArray​(Object v)
      • isArrayOrCollection

        public static boolean isArrayOrCollection​(Object v)
      • isArrayOrList

        public static boolean isArrayOrList​(Object v)