Package org.springframework.expression.spel.ast

Examples of org.springframework.expression.spel.ast.SpelNodeImpl


    }
  }
 
  // node : ((DOT dottedNode) | (SAFE_NAVI dottedNode) | nonDottedNode)+;
  private boolean maybeEatNode() {
    SpelNodeImpl expr = null;
    if (peekToken(TokenKind.DOT,TokenKind.SAFE_NAVI)) {
      expr = eatDottedNode();
    } else {
      expr = maybeEatNonDottedNode();
    }
View Full Code Here


      if (!typeName.stringValue().equals("T")) {
        return false;
      }
      nextToken();
      eatToken(TokenKind.LPAREN);
      SpelNodeImpl node = eatPossiblyQualifiedId();
      // dotted qualified id
      eatToken(TokenKind.RPAREN);
      constructedNodes.push(new TypeReference(toPos(typeName),node));
      return true;
    }
View Full Code Here

  private boolean maybeEatProjection(boolean nullSafeNavigation) {
    Token t = peekToken();
    if (!peekToken(TokenKind.PROJECT,true)) {
      return false;
    }
    SpelNodeImpl expr = eatExpression();
    eatToken(TokenKind.RSQUARE);
    constructedNodes.push(new Projection(nullSafeNavigation, toPos(t), expr));
    return true;
  }
View Full Code Here

  private boolean maybeEatInlineList() {
    Token t = peekToken();
    if (!peekToken(TokenKind.LCURLY,true)) {
      return false;
    }
    SpelNodeImpl expr = null;
    Token closingCurly = peekToken();
    if (peekToken(TokenKind.RCURLY,true)) {
      // empty list '[]'
      expr = new InlineList(toPos(t.startpos,closingCurly.endpos));
    } else {
View Full Code Here

  private boolean maybeEatIndexer() {
    Token t = peekToken();
    if (!peekToken(TokenKind.LSQUARE,true)) {
      return false;
    }
    SpelNodeImpl expr = eatExpression();
    eatToken(TokenKind.RSQUARE);
    constructedNodes.push(new Indexer(toPos(t),expr));
    return true;
  }
View Full Code Here

    Token t = peekToken();
    if (!peekSelectToken()) {
      return false;
    }
    nextToken();
    SpelNodeImpl expr = eatExpression();
    eatToken(TokenKind.RSQUARE);
    if (t.kind==TokenKind.SELECT_FIRST) {     
      constructedNodes.push(new Selection(nullSafeNavigation,Selection.FIRST,toPos(t),expr));
    } else if (t.kind==TokenKind.SELECT_LAST) {
      constructedNodes.push(new Selection(nullSafeNavigation,Selection.LAST,toPos(t),expr));
View Full Code Here

  //constructor 
    //:  ('new' qualifiedId LPAREN) => 'new' qualifiedId ctorArgs -> ^(CONSTRUCTOR qualifiedId ctorArgs)
  private boolean maybeEatConstructorReference() {
    if (peekIdentifierToken("new")) {
      Token newToken = nextToken();
      SpelNodeImpl possiblyQualifiedConstructorName = eatPossiblyQualifiedId();
      List<SpelNodeImpl> nodes = new ArrayList<SpelNodeImpl>();
      nodes.add(possiblyQualifiedConstructorName);
      if (peekToken(TokenKind.LSQUARE)) {
        // array initializer
        List<SpelNodeImpl> dimensions = new ArrayList<SpelNodeImpl>();
View Full Code Here

  //parenExpr : LPAREN! expression RPAREN!;
  private boolean maybeEatParenExpression() {
    if (peekToken(TokenKind.LPAREN)) {
      nextToken();
      SpelNodeImpl expr = eatExpression();
      eatToken(TokenKind.RPAREN);
      push(expr);
      return true;
    } else {
      return false;
View Full Code Here

    return expr;
  }

  // logicalAndExpression : relationalExpression (AND^ relationalExpression)*;
  private SpelNodeImpl eatLogicalAndExpression() {
    SpelNodeImpl expr = eatRelationalExpression();
    while (peekIdentifierToken("and")) {
      Token t = nextToken();// consume 'AND'
      SpelNodeImpl rhExpr = eatRelationalExpression();
      checkRightOperand(t,rhExpr);
      expr = new OpAnd(toPos(t),expr,rhExpr);
    }
    return expr;
  }
View Full Code Here

    return expr;
  }
 
  // relationalExpression : sumExpression (relationalOperator^ sumExpression)?;
  private SpelNodeImpl eatRelationalExpression() {
    SpelNodeImpl expr = eatSumExpression();
    Token relationalOperatorToken = maybeEatRelationalOperator();
    if (relationalOperatorToken != null) {
      Token t = nextToken(); //consume relational operator token
      SpelNodeImpl rhExpr = eatSumExpression();
      checkRightOperand(t,rhExpr);
      TokenKind tk = relationalOperatorToken.kind;
      if (relationalOperatorToken.isNumericRelationalOperator()) {
        int pos = toPos(t);
        if (tk==TokenKind.GT) {
View Full Code Here

TOP

Related Classes of org.springframework.expression.spel.ast.SpelNodeImpl

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.