Package org.openntf.formula

Examples of org.openntf.formula.FormulaContext


      List<Object> v = null;

      FormulaParser parser = Formulas.getParser();
      n = parser.parse(System.in, false);
      n.dump("");
      FormulaContext ctx = Formulas.createContext(null, parser);
      v = n.solve(ctx);

      System.out.println("NTF:\t" + v);

      //StringBuilder sb = new StringBuilder();
View Full Code Here


    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

  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

      }
      if (fce._condContUserName || fce._condContDBPath) {
        if (!insertCurrentContext(fce, contextMap, logRec.getThrown()))
          return contextMap;
      }
      FormulaContext ctx = Formulas.createContext(contextMap,
          LogConfig.L_LogFilterHandler.L_LogFilterConfigEntry._myFormulaParser.get());
      List<Object> result = null;
      try {
        result = fce._parsedCond.solve(ctx);
      } catch (EvaluateException e) {
View Full Code Here

    }
    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.FormulaContext

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.