Package org.openntf.formula

Examples of org.openntf.formula.EvaluateException


    ValueHolder vh = children[0].evaluate(ctx);
    String key = vh.getString(0);
    Node inc = (Node) ctx.getParser().getInclude(key);

    if (inc == null) {
      return ValueHolder.valueOf(new EvaluateException(codeLine, codeColumn, new IllegalArgumentException("'" + key
          + "' could not be included")));
    }
    return inc.evaluate(ctx);
  }
View Full Code Here


      }
    } catch (RuntimeException cause) {
      if (entry < res.length) {
        // find the entry where the error occured
        SimpleNode child = (SimpleNode) children[entry];
        return ValueHolder.valueOf(new EvaluateException(child.codeLine, child.codeColumn, cause));
      }
      return ValueHolder.valueOf(new EvaluateException(codeLine, codeColumn, cause));
    }
    return vh;
  }
View Full Code Here

      for (int i = 0; i < holders; i++) {
        vhRet.addAll(tmpHolders[i]);
      }
      return vhRet;
    } catch (RuntimeException cause) {
      return ValueHolder.valueOf(new EvaluateException(codeLine, codeColumn, cause));
    }
  }
View Full Code Here

      ValueHolder ret = toSort.newInstance(toSort.size);
      ret.addAll(toSort);
      doSort(ctx, ret, sortAscending, sortCaseSensitive, customSort);
      return ret;
    } catch (RuntimeException ex) {
      return ValueHolder.valueOf(new EvaluateException(codeLine, codeColumn, ex));
    }
  }
View Full Code Here

        vh.addAll(ret[i]);
      }
      return vh;

    } catch (FormulaParseException e) {
      return ValueHolder.valueOf(new EvaluateException(codeLine, codeColumn, e));
    }
  }
View Full Code Here

  @Override
  public ValueHolder evaluate(final FormulaContext ctx) {
    try {
      throw new UnsupportedOperationException("SELECT keyword not yet supported. (What should it do?)");
    } catch (RuntimeException cause) {
      return ValueHolder.valueOf(new EvaluateException(codeLine, codeColumn, cause));
    }
  }
View Full Code Here

    if (vhEval.dataType == DataType.ERROR)
      return vhEval;
    if (vhEval.size != children.length) {
      IllegalArgumentException ia = new IllegalArgumentException("Wrong number of parameters: Expected " + (vhEval.size - 1)
          + ", got " + (children.length - 1));
      return ValueHolder.valueOf(new EvaluateException(codeLine, codeColumn, ia));
    }
    oldVHs = new ValueHolder[vhEval.size - 1];
    for (int i = 1; i < vhEval.size; i++)
      oldVHs[i - 1] = ctx.setVarLC(vhEval.getString(i).toLowerCase(), children[i].evaluate(ctx));
    try {

      Node n = (Node) ctx.getParser().parse(vhEval.getString(0));
      return n.evaluate(ctx);
    } catch (FormulaParseException e) {
      return ValueHolder.valueOf(new EvaluateException(codeLine, codeColumn, e));
    } finally {
      if (oldVHs != null)
        for (int i = 1; i < vhEval.size; i++)
          ctx.setVarLC(vhEval.getString(i).toLowerCase(), oldVHs[i - 1]);
    }
View Full Code Here

    vhI = ValueHolder.createValueHolder(Integer.class, 5);
    vhD = ValueHolder.createValueHolder(Long.class, 5);
    vhErr = ValueHolder.createValueHolder(Long.class, 5);
    vhErr.add(3);
    vhErr.add(5);
    vhErr.addAll(ValueHolder.valueOf(new EvaluateException(1, 2, new RuntimeException("This is a error"))));
  }
View Full Code Here

        if (ret.dataType == DataType.ERROR)
          break;
      }
      return ret;
    } catch (FormulaParseException e) {
      return ValueHolder.valueOf(new EvaluateException(codeLine, codeColumn, e));
    }
  }
View Full Code Here

    try {
      if (ret == null) {
        ret = function.evaluate(ctx, params);
      }
    } catch (RuntimeException e) {
      return ValueHolder.valueOf(new EvaluateException(codeLine, codeColumn, e));
    }
    if (ret.dataType == DataType.ERROR)
      ret = ValueHolder.valueOf(ret.getError().getMessage());
    return ret;
  }
View Full Code Here

TOP

Related Classes of org.openntf.formula.EvaluateException

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.