Package org.openntf.formula

Examples of org.openntf.formula.ASTNode


  }

  protected List<Object> doc() throws NotesException, FormulaParseException, EvaluateException {
    Document ntfDoc = db.createDocument();
    fillDemoDoc(ntfDoc);
    ASTNode ast = null;

    ast = Formulas.getParser().parse(formula);
    FormulaContext ctx1 = Formulas.createContext(ntfDoc, Formulas.getParser());
    return ast.solve(ctx1);
  }
View Full Code Here


  }

  //@Test(expected = org.openntf.domino.formula.EvaluateException.class)
  public void testDocFail() throws NotesException, FormulaParseException, EvaluateException {
    Document ntfDoc = db.createDocument();
    ASTNode ast = null;

    ast = Formulas.getParser().parse(formula);
    FormulaContext ctx1 = Formulas.createContext(ntfDoc, Formulas.getParser());
    ast.solve(ctx1);

  }
View Full Code Here

  }

  protected List<Object> map() throws FormulaParseException, EvaluateException {
    Map<String, Object> ntfMap = new HashMap<String, Object>();
    fillDemoDoc(ntfMap);
    ASTNode ast = null;
    ast = Formulas.getParser().parse(formula);
    FormulaContext ctx1 = Formulas.createContext(ntfMap, Formulas.getParser());
    return ast.solve(ctx1);
  }
View Full Code Here

  }

  //@Test(expected = org.openntf.domino.formula.EvaluateException.class)
  public void testMapFail() throws FormulaParseException, EvaluateException {
    Map<String, Object> ntfMap = new HashMap<String, Object>();
    ASTNode ast = null;
    ast = Formulas.getParser().parse(formula);
    FormulaContext ctx1 = Formulas.createContext(ntfMap, Formulas.getParser());
    ast.solve(ctx1);
  }
View Full Code Here

   * @throws FormulaParseException
   *             if the formula was invalid
   */
  protected ASTNode getASTNode() throws FormulaParseException {
    if (astNodeCache != null) {
      ASTNode node = astNodeCache.get();
      if (node != null)
        return node;
    }

    ASTNode node = Formulas.getParser().parse(formulaStr);
    astNodeCache = new SoftReference<ASTNode>(node);
    return node;

  }
View Full Code Here

   * @throws FormulaParseException
   *             if the formula was invalid
   */
  protected ASTNode getASTNode() throws FormulaParseException {
    if (astNodeCache != null) {
      ASTNode node = astNodeCache.get();
      if (node != null)
        return node;
    }

    ASTNode node = Formulas.getParser().parse(formulaStr);
    astNodeCache = new SoftReference<ASTNode>(node);
    return node;

  }
View Full Code Here

      if (map != null)
        numParams--;
    }
    try {
      FormulaParser parser = Formulas.getParser();
      ASTNode ast = parser.parse(msgString, true);
      Formatter formatter = Formulas.getFormatter(loc);
      FormulaContext ctx = Formulas.createContext(map, formatter, parser);
      // ctx.useBooleans(false);
      for (int i = 0; i < numParams; i++)
        ctx.setParam(Integer.toString(i + 1), args[i]);
      List<?> resultList = ast.solve(ctx);
      if (resultList != null && !resultList.isEmpty()) {
        Object o = resultList.get(0);
        if (o instanceof String)
          return (String) o;
      }
View Full Code Here

TOP

Related Classes of org.openntf.formula.ASTNode

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.