Examples of initStandardObjects()


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

    final String data = new ObjectMapper().writeValueAsString(IOUtils
        .toString(input));

    final Context context = Context.enter();
    try {
      final ScriptableObject scope = (ScriptableObject) context
          .initStandardObjects(this.moduleScope);

      final Object result = context.evaluateString(scope,
          String.format(this.source, data), this.name, 1, null);
View Full Code Here

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

    public void runJsTests(File[] tests) throws IOException {
        ContextFactory factory = ContextFactory.getGlobal();
        Context cx = factory.enterContext();
        try {
            cx.setOptimizationLevel(this.optimizationLevel);
            Scriptable shared = cx.initStandardObjects();
            for (File f : tests) {
                int length = (int) f.length(); // don't worry about very long
                                               // files
                char[] buf = new char[length];
                new FileReader(f).read(buf, 0, length);
View Full Code Here

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

    LegacyDataRowWrapper wrapper = null;
    try
    {
      final ContextFactory contextFactory = new ContextFactory();
      final Context context = contextFactory.enterContext();
      final Scriptable scope = context.initStandardObjects();
      wrapper = initializeScope(scope);

      final Object o = context.evaluateString(scope, expression, getName(), 1, null);
      if (o instanceof NativeJavaObject)
      {
View Full Code Here

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

      "/html/lib/treeTTL.js",
      "/html/lib/emitter.js");
           
    try {
      Context cx = ContextFactory.getGlobal().enterContext();
      Scriptable scope = cx.initStandardObjects();
      Object wrappedOut = Context.javaToJS(System.out, scope);
      ScriptableObject.putProperty(scope, "out", wrappedOut);

      Object result = null;
     
View Full Code Here

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

      "/html/lib/treeTTL.js",
      "/html/lib/emitter.js");
           
    try {
      Context cx = ContextFactory.getGlobal().enterContext();
      Scriptable scope = cx.initStandardObjects();
      Object wrappedOut = Context.javaToJS(System.out, scope);
      ScriptableObject.putProperty(scope, "out", wrappedOut);

      Object result = null;
     
View Full Code Here

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

        "/html/lib/treeTTL.js",
        "/html/lib/emitter.js");
             
      try {
        Context cx = ContextFactory.getGlobal().enterContext();
        Scriptable scope = cx.initStandardObjects();
        Object wrappedOut = Context.javaToJS(System.out, scope);
        ScriptableObject.putProperty(scope, "out", wrappedOut);

        Object result = null;
       
View Full Code Here

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

        "/html/lib/treeTTL.js",
        "/html/lib/emitter.js");
             
      try {
        Context cx = ContextFactory.getGlobal().enterContext();
        Scriptable scope = cx.initStandardObjects();
        Object wrappedOut = Context.javaToJS(System.out, scope);
        ScriptableObject.putProperty(scope, "out", wrappedOut);

        Object result = null;
       
View Full Code Here

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

    }

    private static final Logger LOGGER = Logging.getLogger("org.geoserver.web.scriptlet");
    public RhinoConsolePage() {
        Context cx = Context.enter();
        scope = cx.initStandardObjects();
        Object wrappedCatalog = Context.javaToJS(getCatalog(), scope);
        ScriptableObject.putProperty(scope, "catalog", wrappedCatalog);
        Context.exit();

        final WebMarkupContainer container = new WebMarkupContainer("results-wrapper");
View Full Code Here

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

     */
    public JavaScriptProcess(File algorithm) {
        myScript = algorithm;
        Context cx = Context.enter();
        try {
            scope = cx.initStandardObjects();
            FileReader reader = new FileReader(myScript);
            cx.evaluateReader(scope, reader, myScript.getName(), 1, null);
        } catch (IOException e) {
            throw new RuntimeException("I/O error while loading process script...");
        } finally {
View Full Code Here

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

                );
            }

            Context cx = Context.enter();
            try {
                Scriptable scope = cx.initStandardObjects();
                FileReader reader = new FileReader(script);

                Object wrappedRequest = Context.javaToJS(request, scope);
                Object wrappedResponse = Context.javaToJS(response, scope);
                Object wrappedCatalog = Context.javaToJS(catalog, scope);
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.