Package

Source Code of Groovy2

import groovy.lang.Binding;
import groovy.util.GroovyScriptEngine;
import groovy.util.ResourceException;

public class Groovy2 {

  /**
   * @param args
   * @throws Exception
   * @throws ResourceException
   */
  public static void main(final String[] args) throws Exception {
    GroovyScriptEngine gse = new GroovyScriptEngine("src/main/java");
    long start = System.currentTimeMillis();
    for (int i = 0; i < 1; i++) {
      Binding binding = new Binding();
      binding.setVariable("foo", new Integer(123));
      gse.run("test.groovy", binding);
      // System.out.println(binding.getVariable("output"));
    }
    long end = System.currentTimeMillis() - start;
    System.out.println("Engine " + end);
  }

}
TOP

Related Classes of Groovy2

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.