Examples of compileString()


Examples of de.mhus.lib.sql.parser.SqlCompiler.compileString()

 
  public void  testSimple() throws ParseException {
    String sql = "SELECT * FROM hamster where aaa = 'alpha' AND bbb='beta'";
    SqlCompiler compiler = new SqlCompiler();
    CompiledString compiled = compiler.compileString(sql);
    StringBuffer sb = new StringBuffer();
    compiled.dump(sb);
    System.out.println(sb.toString());
   
    HashMap<String, Object> attributes = new HashMap<String, Object>();
View Full Code Here

Examples of de.mhus.lib.sql.parser.SqlCompiler.compileString()

  }
 
  public void testQuotes() throws ParseException {
    String sql = "SELECT 'aloa' FROM hamster where aaa = 'alpha' AND bbb='beta' ccc='wow''aha'";
    SqlCompiler compiler = new SqlCompiler();
    CompiledString compiled = compiler.compileString(sql);
    StringBuffer sb = new StringBuffer();
    compiled.dump(sb);
    System.out.println(sb.toString());
   
    HashMap<String, Object> attributes = new HashMap<String, Object>();
View Full Code Here

Examples of de.mhus.lib.sql.parser.SqlCompiler.compileString()

  }
 
  public void testAttribute() throws ParseException {
    String sql = "SELECT $raw$ FROM $val$ where aaa = '$val$'";
    SqlCompiler compiler = new SqlCompiler();
    CompiledString compiled = compiler.compileString(sql);
    StringBuffer sb = new StringBuffer();
    compiled.dump(sb);
    System.out.println(sb.toString());
   
    HashMap<String, Object> attributes = new HashMap<String, Object>();
View Full Code Here

Examples of de.mhus.lib.sql.parser.SqlCompiler.compileString()

  }
 
  public void testMath() throws ParseException {
    String sql = "SELECT * FROM aaa WHERE a+b=c-7*3/2 AND z != -13";
    SqlCompiler compiler = new SqlCompiler();
    CompiledString compiled = compiler.compileString(sql);
    StringBuffer sb = new StringBuffer();
    compiled.dump(sb);
    System.out.println(sb.toString());
   
    HashMap<String, Object> attributes = new HashMap<String, Object>();
View Full Code Here

Examples of de.mhus.lib.sql.parser.SqlCompiler.compileString()

  }
 
  public void testFunction() throws ParseException {
    String sql = "SELECT * FROM aaa WHERE round(a) = round(b) AND date(a,b) = diff(date(a),'1928-03-21')";
    SqlCompiler compiler = new SqlCompiler();
    CompiledString compiled = compiler.compileString(sql);
    StringBuffer sb = new StringBuffer();
    compiled.dump(sb);
    System.out.println(sb.toString());
   
    HashMap<String, Object> attributes = new HashMap<String, Object>();
View Full Code Here

Examples of net.sourceforge.htmlunit.corejs.javascript.Context.compileString()

     * @param scriptCode some JavaScript code
     * @return the evaluation result
     */
    public Object custom_eval(final String scriptCode) {
        final Context context = Context.getCurrentContext();
        final Script script = context.compileString(scriptCode, "eval body", 0, null);
        return script.exec(context, this);
    }

    /**
     * Returns the text from the status line.
View Full Code Here

Examples of org.mozilla.javascript.Context.compileString()

            JavaScriptEvaluator.createJSExpression(expr);
         
          //compile the default expression to catch syntax errors
          try
          {
            context.compileString(jsExpr.getDefaultExpression(),
                "expression", 0, null);
          }
          catch (EvaluatorException e)
          {
            ++errorCount;
View Full Code Here

Examples of org.mozilla.javascript.Context.compileString()

  private String sm_eval(String filename, String code, boolean handle_retval) {
   
    Context ctx = cf_global.enterContext(vm.cx);
    try {
     
      Script scr = ctx.compileString(code, filename, 1, null);     
      Object result = scr.exec(ctx, vm.global);
     
      if (handle_retval) {
        if (result instanceof String) {
          return (String) result;
View Full Code Here

Examples of org.mozilla.javascript.Context.compileString()

           
            if (cl != null) {
               cx.setApplicationClassLoader(cl);
            }
            this.scriptScope = new ImporterTopLevel( cx, true );
            Script compiledScript = cx.compileString(scriptCode, fileName, 1, null);
            compiledScript.exec(cx, scriptScope);
            addContexts(scriptScope, context);

        } finally {
            Context.exit();
View Full Code Here

Examples of org.mozilla.javascript.Context.compileString()

    @Override public Object compile(String script) {
        Context ctx = Context.enter();
        try {
            ctx.setWrapFactory(wrapFactory);
            ctx.setOptimizationLevel(optimizationLevel);
            return ctx.compileString(script, generateScriptName(), 1, null);
        } finally {
            Context.exit();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.