Get the results as a map

@param expression projection
@return new result transformer
769804
public <V> ResultTransformer<Map<K, V>> as(FactoryExpression<V> expression) {
        final FactoryExpression<?> transformation = FactoryExpressionUtils.wrap(expression);
        List<Expression<?>> args = transformation.getArgs();
        return new GroupByMap<K, V>(key, args.toArray(new Expression<?>[args.size()])) {

            @Override
            protected Map<K, V> transform(Map<K, Group> groups) {
                Map<K, V> results = new LinkedHashMap<K, V>((int) Math.ceil(groups.size() / 0.75), 0.75f);
                for (Map.Entry<K, Group> entry : groups.entrySet()) {
                    results.put(entry.getKey(), transform(entry.getValue()));
                }
                return results;
            }

            @SuppressWarnings("unchecked")
            protected V transform(Group group) {
                // XXX Isn't group.toArray() suitable here?
                List<Object> args = new ArrayList<Object>(groupExpressions.size() - 1);
                for (int i = 1; i < groupExpressions.size(); i++) {
                    args.add(group.getGroup(groupExpressions.get(i)));
                }
                return (V) transformation.newInstance(args.toArray());
            }

        };
    }
1038562
public static <E> AbstractGroupExpression<E, Set<E>> set(Expression<E> expression) {
        return GSet.createLinked(expression);
    }
541663
void buildMapEntry(LinkedHashMap<Object, Expr> map) {
		Expr keyExpr = expr();
		Object key;
		if (keyExpr instanceof Id) {
			key = ((Id)keyExpr).getId();
		} else if (keyExpr instanceof Const) {
			key = ((Const)keyExpr).getValue();
		} else {
			throw new ParseException("Expression error: the value of map key must be identifier, String, Boolean, null or Number", location);
		}
		
		match(Sym.COLON);
		Expr value = expr();
		if (value == null) {
			throw new ParseException("Expression error: the value on the right side of map entry can not be blank", location);
		}
		map.put(key, value);
	}
209215
public static <K, V> AbstractGroupExpression<Pair<K, V>,Map<K, V>> map(Expression<K> key,
                                                                           Expression<V> value) {
        return GMap.createLinked(QPair.create(key, value));
    }
985250
public <K, V, E extends SimpleExpression<V>> MapPath<K, V, E> getMap(String property, Class<K> key, Class<V> value, Class<? super E> queryType) {
        validate(property, Map.class);
        return super.createMap(property, key, value, queryType);
    }
1180915
public static SearchExpressionResolver findResolver(final String expression) {
        SearchExpressionResolver resolver = null;

        if (expression.startsWith(SearchExpressionConstants.KEYWORD_PREFIX)) {
            // check if it's an expression with parameter
            int parenthesisPosition = expression.indexOf('(');
            if (parenthesisPosition > 0) {
                String expressionWithoutParam = expression.substring(0, parenthesisPosition);
                resolver = RESOLVER_MAPPING.get(expressionWithoutParam);
            }
            else {
                resolver = RESOLVER_MAPPING.get(expression);
            }
        }
        else {
            // if it's not a keyword, just delegate it to JSF
            resolver = FIND_COMPONENT_EXPRESSION_RESOLVER;
        }

        if (resolver == null) {
            throw new FacesException("No SearchExpressionResolver available for expression \"" + expression + "\"");
        }

        return resolver;
    }
245615
public static Map<String, Object> onNullComparisonExpression(Expression expression, EntityMetadata m,
                                                                 KunderaMetadata kunderaMetadata, KunderaQuery kunderaQuery)
    {
        NullComparisonExpression compExp = (NullComparisonExpression) expression;

        String condition = compExp.getIdentifier();
        Expression sfpExp = compExp.getExpression();
        Map<String, Object> map = KunderaQueryUtils.setFieldClazzAndColumnFamily(sfpExp, m, kunderaMetadata);
        kunderaQuery.addFilterClause(
              (String) map.get(Constants.COL_NAME), condition, null,
              (String) map.get(Constants.FIELD_NAME), (Boolean) map.get(Constants.IGNORE_CASE));
        return map;

    }
1354475
@Override
    public List<AbstractExpression> bindingToIndexedExpression(AbstractExpression expr) {
        if (equals(expr)) {
            return s_reusableImmutableEmptyBinding;
        }
        return null;
    }
1251617
public static <K, V, U> AbstractGroupExpression<Pair<K, V>, Map<K, U>> map(Expression<K> key,
                                                                               GroupExpression<V, U> value) {
        return map(new GOne<K>(key), value);
    }
203239
public static <E> AbstractGroupExpression<E, List<E>> list(Expression<E> expression) {
        return new GList<E>(expression);
    }
114873
public String getProperty(String expression) {
    if (expression == null || expression.length() == 0) { return expression; }
    for (int i = 0; i < expression.length(); i++) {
      char c = expression.charAt(i);
      if (c == Nested) {
        return expression.substring(0, i);
      } else if (c == MappedStart || c == IndexedStart) { return expression.substring(0, i); }
    }
    return expression;
  }
1208683
public static Object execExpr(ExprResolver exprResolver, String expression) {

        try {
            // 返回输出的内容
            return exprResolver.executeExpr(expression);

        } catch (Exception e) {

            // 输出日志
            if (logger.isDebugEnabled()) {
                logger.debug("Can't resolving expression: " + expression, e);
            }
        }

        return null;
    }
764909
protected <T extends Expression> List<T> transformExpressions(List<? extends Expression> expressions,
            ExpressionTransformer transformer, Class<T> transformedType) {
        List<T> list = new ArrayList<T>(expressions.size());
        for (Expression expr : expressions) {
            Expression transformed = transformer.transform(expr);
            if (!transformedType.isInstance(transformed))
                throw new GroovyBugError(String.format("Transformed expression should have type %s but has type %s",
                    transformedType, transformed.getClass()));
            list.add(transformedType.cast(transformed));
        }
        return list;
    }
1178074
public ExpressionParser addMapper(Map<String,String> map)
    {
        mapperList.add((s)->map.get(s));
        return this;
    }
91829
public static Map<String, List<Object>> getListMap(Message message, List<ExpressionMapping> expressionMappings, boolean expand, String undefinedVariable) {
        return getListMap(message, expressionMappings, expand, undefinedVariable, null);
    }
293494
final public ReturnExpressionBuilder<T> returnExp() {
    final int sourceLineNumber = builder.getSourceLineNumber();
    return new ReturnExpressionBuilder<T>(new ExpressionHandler<T>() {
      public T handleExpression(Expression e) {
        return statementHandler().handleStatement(new ReturnStatement(sourceLineNumber, e));
      }
    });
  }
1220114
private List<Object> eval(Iterable<ExpressionContext> expressions) {

    List<Object> results = new ArrayList<Object>();

    for (ExpressionContext expression : expressions) {
      results.add(eval(expression));
    }

    return results;
  }