Package org.springframework.expression.spel

Examples of org.springframework.expression.spel.SpelParseException


        case 0:
          // hit sentinel at end of value
          pos++; // will take us to the end
          break;
        case '\\':
          throw new InternalParseException(new SpelParseException(expressionString,pos,SpelMessage.UNEXPECTED_ESCAPE_CHAR));
        default:
          throw new IllegalStateException("Cannot handle ("+Integer.valueOf(ch)+") '"+ch+"'");
        }
      }
    }
View Full Code Here


        } else {
          terminated = true;
        }
      }
      if (ch==0) {
        throw new InternalParseException(new SpelParseException(expressionString,start,SpelMessage.NON_TERMINATING_QUOTED_STRING));
      }
    }
    pos++;
    tokens.add(new Token(TokenKind.LITERAL_STRING, subarray(start,pos), start, pos));
  }
View Full Code Here

        } else {
          terminated = true;
        }
      }
      if (ch==0) {
        throw new InternalParseException(new SpelParseException(expressionString,start,SpelMessage.NON_TERMINATING_DOUBLE_QUOTED_STRING));
      }
    }
    pos++;
    tokens.add(new Token(TokenKind.LITERAL_STRING, subarray(start,pos), start, pos));
  }
View Full Code Here

    // Now there may or may not be an exponent
   
    // is it a long ?
    if (isChar('L','l')) {
      if (isReal) { // 3.4L - not allowed
        throw new InternalParseException(new SpelParseException(expressionString,start,SpelMessage.REAL_CANNOT_BE_LONG));
      }
      pushIntToken(subarray(start, endOfNumber), true, start, endOfNumber);
      pos++;
    } else if (isExponentChar(toProcess[pos])) {
      isReal = true; // if it wasn't before, it is now
View Full Code Here

  }

  private void pushHexIntToken(char[] data,boolean isLong, int start, int end) {
    if (data.length==0) {
      if (isLong) {       
        throw new InternalParseException(new SpelParseException(expressionString,start,SpelMessage.NOT_A_LONG,expressionString.substring(start,end+1)));
      } else {
        throw new InternalParseException(new SpelParseException(expressionString,start,SpelMessage.NOT_AN_INTEGER,expressionString.substring(start,end)));
      }
    }
    if (isLong) {
      tokens.add(new Token(TokenKind.LITERAL_HEXLONG, data, start, end));
    } else {
View Full Code Here

      tokenStreamLength = tokenStream.size();
      tokenStreamPointer = 0;
      constructedNodes.clear();
      SpelNodeImpl ast = eatExpression();
      if (moreTokens()) {
        throw new SpelParseException(peekToken().startpos,SpelMessage.MORE_INPUT,toString(nextToken()));
      }
      Assert.isTrue(constructedNodes.isEmpty());
      return new SpelExpression(expressionString, ast, configuration);
    }
    catch (InternalParseException ipe) {
View Full Code Here

    return args.toArray(new SpelNodeImpl[args.size()]);
  }

  private void eatConstructorArgs(List<SpelNodeImpl> accumulatedArguments) {
    if (!peekToken(TokenKind.LPAREN)) {
      throw new InternalParseException(new SpelParseException(expressionString,positionOf(peekToken()),SpelMessage.MISSING_CONSTRUCTOR_ARGS));
    }
    consumeArguments(accumulatedArguments);
    eatToken(TokenKind.RPAREN);
  }
View Full Code Here

    }
    return tokenStream.get(tokenStreamPointer);
  }

  private void raiseInternalException(int pos, SpelMessage message,Object... inserts) {
    throw new InternalParseException(new SpelParseException(expressionString,pos,message,inserts));
  }
View Full Code Here

      tokenStreamLength = tokenStream.size();
      tokenStreamPointer = 0;
      constructedNodes.clear();
      SpelNodeImpl ast = eatExpression();
      if (moreTokens()) {
        throw new SpelParseException(peekToken().startpos,SpelMessage.MORE_INPUT,toString(nextToken()));
      }
      Assert.isTrue(constructedNodes.isEmpty());
      return new SpelExpression(expressionString, ast, configuration)
    }
    catch (InternalParseException ipe) {
View Full Code Here

    return args.toArray(new SpelNodeImpl[args.size()]);
  }
 
  private void eatConstructorArgs(List<SpelNodeImpl> accumulatedArguments) {
    if (!peekToken(TokenKind.LPAREN)) {
      throw new InternalParseException(new SpelParseException(expressionString,positionOf(peekToken()),SpelMessage.MISSING_CONSTRUCTOR_ARGS));
    }
    consumeArguments(accumulatedArguments);
    eatToken(TokenKind.RPAREN);
  }
View Full Code Here

TOP

Related Classes of org.springframework.expression.spel.SpelParseException

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.