Package org.nutz.el

Examples of org.nutz.el.ElException


      if(obj != null){
        skipSpace();
        return parseItem(obj);
      }
    }
    throw new ElException("无法解析!");
  }
View Full Code Here


      break;
    case 'f':
      sb.append('\f');//这个支持一下又何妨?
      break;
    default:
      throw new ElException("Unexpected char")//1.b.37及之前的版本,会忽略非法的转义字符
    }
  }
View Full Code Here

        case '9':
          sb.append(exp.poll());
          break;
        case '.':
          if(hasPoint){
            throw new ElException("表达式错误,请查看是否有多个'.'!");
          }
          hasPoint = true;
          sb.append(exp.poll());
          break;
        case 'l':
View Full Code Here

      switch(exp.peek()){
      case '=':
        exp.poll();
        return new EQOpt();
      }
      throw new ElException("表达式错误,请检查'='后是否有非法字符!");
    case '!':
      exp.poll();
      switch(exp.peek()){
      case '=':
        exp.poll();
View Full Code Here

      return ((IdentifierObj) obj).fetchVal();
    }
    if(obj instanceof Operator){
      return ((Operator) obj).calculate();
    }
    throw new ElException("未知计算类型!" + obj);
   
  }
View Full Code Here

  }
  public Object calculate() {
    if(left instanceof Operator){
      return ((Operator) left).calculate();
    }
    throw new ElException("三元表达式错误!");
  }
View Full Code Here

  public int fetchPriority() {
    return 13;
  }
  public Object calculate() {
    if(!(left instanceof QuestionOpt)){
      throw new ElException("三元表达式错误!");
    }
    QuestionOpt qo = (QuestionOpt) left;
    Boolean cval = (Boolean) qo.calculate();
    if(cval){
      return qo.getRight();
View Full Code Here

  public Object calculate() {
    Object rval = calculateItem(this.right);
    if(rval instanceof Boolean){
      return !(Boolean) rval;
    }
    throw new ElException("'!'操作符操作失败!");
  }
View Full Code Here

  }
 
  public Object calculate() {
    Object lval = calculateItem(this.left);
    if(!(lval instanceof Boolean)){
      throw new ElException("操作数类型错误!");
    }
    if(!(Boolean)lval){
      return false;
    }
    Object rval = calculateItem(this.right);
    if(!(rval instanceof Boolean)){
      throw new ElException("操作数类型错误!");
    }
    if(!(Boolean)rval){
      return false;
    }
    return true;
View Full Code Here

    return 12;
  }
  public Object calculate() {
    Object lval = calculateItem(left);
    if(!(lval instanceof Boolean)){
      throw new ElException("操作数类型错误!");
    }
    if((Boolean)lval){
      return true;
    }
    Object rval = calculateItem(right);
    if(!(rval instanceof Boolean)){
      throw new ElException("操作数类型错误!");
    }
    if((Boolean)rval){
      return true;
    }
    return false;
View Full Code Here

TOP

Related Classes of org.nutz.el.ElException

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.