Package org.soybeanMilk.core.config.parser

Examples of org.soybeanMilk.core.config.parser.ParseException


  private int length;
 
  public InvokeStatementParser(String statement)
  {
    if(statement==null || statement.length()==0)
      throw new ParseException("[statement] must not be empty");
   
    this.statement=statement;
   
    this.cache=new StringBuffer();
    this.currentIdx=0;
View Full Code Here


    String[] argTypes=null;
   
    //方法的左括弧
    int methodLeftBracketIdx=indexOf('(');
    if(methodLeftBracketIdx < 0)
      throw new ParseException("no method left bracket character '(' found in statement \""+this.statement+"\"");
   
    int methodRightBracketIdx=lastIndexOf(')', this.length);
    if(methodRightBracketIdx < 0)
      throw new ParseException("no method right bracket character ')' found in statement \""+this.statement+"\"");
   
    //等号位置
    int equalCharIdx=indexOf('=', methodLeftBracketIdx);
   
    //方法名之前的'.'访问符位置
    int methodLeftDotIdx=lastIndexOf('.', methodLeftBracketIdx);
    if(methodLeftDotIdx < 0)
      throw new ParseException("no method name start character  '.' found in statement \""+this.statement+"\"");
   
    setCurrentIdx(0);
   
    //解析方法的结果关键字
    if(equalCharIdx < 0)
      resultKey=null;
    else
    {
      ignoreFormatChars();
     
      resultKey=parseUtil(KEY_CHAR_EQUAL, true, true, FORMAT_CHARS);
      if(resultKey==null || resultKey.length()==0)
        throw new ParseException("no result key segment found in statement \""+this.statement+"\"");
     
      //移到'='之后
      setCurrentIdx(equalCharIdx+1);
    }
   
    //解析调用目标
    ignoreFormatChars();
    setEndIdx(methodLeftDotIdx);
    resolver=parseUtil(null, true, true, FORMAT_CHARS);
    if(resolver==null || resolver.length()==0)
      throw new ParseException("no resolver segment found in statement \""+this.statement+"\"");
   
    //移到'.'
    setCurrentIdx(methodLeftDotIdx+1);
   
    //解析方法名
    ignoreFormatChars();
    setEndIdx(methodLeftBracketIdx);
    methodName=parseUtil(null, true, true, FORMAT_CHARS);
    if(methodName==null || methodName.length()==0)
      throw new ParseException("no method name segment found in statement \""+this.statement+"\"");
   
    //移到'('之后
    setCurrentIdx(methodLeftBracketIdx+1);
   
    //解析方法参数
View Full Code Here

TOP

Related Classes of org.soybeanMilk.core.config.parser.ParseException

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.