Package org.springframework.data.mongodb.core.spel

Examples of org.springframework.data.mongodb.core.spel.ExpressionNode


    Assert.notNull(context, "AggregationOperationContext must not be null!");
    Assert.notNull(params, "Parameters must not be null!");

    SpelExpression spelExpression = (SpelExpression) PARSER.parseExpression(expression);
    ExpressionState state = new ExpressionState(new StandardEvaluationContext(params), CONFIG);
    ExpressionNode node = ExpressionNode.from(spelExpression.getAST(), state);

    return transform(new AggregationExpressionTransformationContext<ExpressionNode>(node, null, null, context));
  }
View Full Code Here


     * @see org.springframework.data.mongodb.core.aggregation.SpelExpressionTransformer.SpelNodeWrapper#convertSpelNodeToMongoObjectExpression(org.springframework.data.mongodb.core.aggregation.SpelExpressionTransformer.ExpressionConversionContext)
     */
    @Override
    protected Object convert(AggregationExpressionTransformationContext<ExpressionNode> context) {

      ExpressionNode currentNode = context.getCurrentNode();

      if (!currentNode.hasChildren()) {
        return null;
      }

      // just take the first item
      return transform(currentNode.getChild(0), currentNode, null, context);
    }
View Full Code Here

     * @see org.springframework.data.mongodb.core.aggregation.SpelExpressionTransformer.SpelNodeWrapper#convertSpelNodeToMongoObjectExpression(org.springframework.data.mongodb.core.aggregation.SpelExpressionTransformer.ExpressionConversionContext)
     */
    @Override
    protected Object convert(AggregationExpressionTransformationContext<ExpressionNode> context) {

      ExpressionNode currentNode = context.getCurrentNode();

      if (currentNode.hasfirstChildNotOfType(Indexer.class)) {
        // we have a property path expression like: foo.bar -> render as reference
        return context.addToPreviousOrReturn(context.getFieldReference().toString());
      }

      return context.addToPreviousOrReturn(currentNode.getValue());
    }
View Full Code Here

TOP

Related Classes of org.springframework.data.mongodb.core.spel.ExpressionNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.