Examples of evaluateReader()


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

            global.init(cx);
            scope = cx.initStandardObjects(global);
            cx.evaluateReader(scope, new InputStreamReader(env.openConnection().getInputStream()), env.getFile(), 1, null);
            cx.evaluateString(scope, "lessenv.charset = '" + CHARSET + "';", "charset", 1, null);
            cx.evaluateString(scope, "lessenv.css = " + "true" + ";", "css", 1, null);
            cx.evaluateReader(scope, new InputStreamReader(less.openConnection().getInputStream()), less.getFile(), 1, null);
            cx.evaluateReader(scope, new InputStreamReader(engine.openConnection().getInputStream()), engine.getFile(), 1, null);
            compileString = (Function) scope.get("compileString", scope);
            compileFile = (Function) scope.get("compileFile", scope);
            Context.exit();
        } catch (Exception e) {
View Full Code Here

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

            scope = cx.initStandardObjects(global);
            cx.evaluateReader(scope, new InputStreamReader(env.openConnection().getInputStream()), env.getFile(), 1, null);
            cx.evaluateString(scope, "lessenv.charset = '" + CHARSET + "';", "charset", 1, null);
            cx.evaluateString(scope, "lessenv.css = " + "true" + ";", "css", 1, null);
            cx.evaluateReader(scope, new InputStreamReader(less.openConnection().getInputStream()), less.getFile(), 1, null);
            cx.evaluateReader(scope, new InputStreamReader(engine.openConnection().getInputStream()), engine.getFile(), 1, null);
            compileString = (Function) scope.get("compileString", scope);
            compileFile = (Function) scope.get("compileFile", scope);
            Context.exit();
        } catch (Exception e) {
            logger.error("LESS Engine intialization failed.", e);
View Full Code Here

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

        throws InterpreterException, IOException {

        Object rv = null;
        final Context ctx = enterContext();
        try {
            rv = ctx.evaluateReader(globalObject,
                                    scriptreader,
                                    description,
                                    1, rhinoClassLoader);
        } catch (JavaScriptException e) {
            // exception from JavaScript (possibly wrapping a Java Ex)
View Full Code Here

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

      Context context = Context.enter();
      context.setOptimizationLevel(9);

      globalScope = context.initStandardObjects();
      context.evaluateReader(globalScope, dustJsReader, dustJsFilePath, dustJsStream.available(), null);
      context.evaluateReader(globalScope, dustJsHelperReader, dustJsHelperFilePath,
          dustHelperJsStream.available(), null);
    } catch (Exception e) {
      logger.error("thrown exception when initialize step!", e);
      throw new RuntimeException(e);
View Full Code Here

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

      Context context = Context.enter();
      context.setOptimizationLevel(9);

      globalScope = context.initStandardObjects();
      context.evaluateReader(globalScope, dustJsReader, dustJsFilePath, dustJsStream.available(), null);
      context.evaluateReader(globalScope, dustJsHelperReader, dustJsHelperFilePath,
          dustHelperJsStream.available(), null);
    } catch (Exception e) {
      logger.error("thrown exception when initialize step!", e);
      throw new RuntimeException(e);
    } finally {
View Full Code Here

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

        try {
          Context context = Context.enter();
          context.setOptimizationLevel(-1); // Without this, Rhino hits a 64K bytecode limit and fails
          try {
            globalScope = context.initStandardObjects();
            context.evaluateReader(globalScope, reader, "coffee-script.js", 0, null);
          } finally {
            Context.exit();
          }
        } finally {
          reader.close();
View Full Code Here

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

        try {
          Context context = Context.enter();
          context.setOptimizationLevel(-1); // Without this, Rhino hits a 64K bytecode limit and fails
          try {
            globalScope = context.initStandardObjects();
            context.evaluateReader(globalScope, reader, "coffee-script.js", 0, null);
          } finally {
            Context.exit();
          }
        } finally {
          reader.close();
View Full Code Here

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

    public Object evaluate(Reader scriptreader)
        throws InterpreterException, IOException {
        Object rv = null;
        Context ctx = Context.enter(context);
        try {
            rv = ctx.evaluateReader(globalObject,
                                    scriptreader,
                                    "<SVG>",
                                    1, null);
        } catch (JavaScriptException e) {
            // exception from JavaScript (possibly wrapping a Java Ex)
View Full Code Here

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

    ObjectMapper om = new ObjectMapper();
    StringWriter sw = new StringWriter();
    Context context = Context.enter();
    Scriptable globalScope = context.initStandardObjects();
    Reader underscoreReader = new InputStreamReader(JSConverter.class.getResourceAsStream("underscore.js"));
    context.evaluateReader(globalScope, underscoreReader, "underscore.js", 1, null);
    Reader srReader = new InputStreamReader(JSConverter.class.getResourceAsStream("SaikuRenderer.js"));
    context.evaluateReader(globalScope, srReader, "SaikuRenderer.js", 1, null);
    Reader strReader = new InputStreamReader(JSConverter.class.getResourceAsStream("SaikuTableRenderer.js"));
    context.evaluateReader(globalScope, strReader, "SaikuTableRenderer.js", 1, null);
    String data = om.writeValueAsString(qr);
View Full Code Here

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

    Context context = Context.enter();
    Scriptable globalScope = context.initStandardObjects();
    Reader underscoreReader = new InputStreamReader(JSConverter.class.getResourceAsStream("underscore.js"));
    context.evaluateReader(globalScope, underscoreReader, "underscore.js", 1, null);
    Reader srReader = new InputStreamReader(JSConverter.class.getResourceAsStream("SaikuRenderer.js"));
    context.evaluateReader(globalScope, srReader, "SaikuRenderer.js", 1, null);
    Reader strReader = new InputStreamReader(JSConverter.class.getResourceAsStream("SaikuTableRenderer.js"));
    context.evaluateReader(globalScope, strReader, "SaikuTableRenderer.js", 1, null);
    String data = om.writeValueAsString(qr);
    Object wrappedQr = Context.javaToJS(data, globalScope);
    ScriptableObject.putProperty(globalScope, "data", wrappedQr);
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.