Examples of evaluateString()


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

           ? myProcess.jsScope() : exceptionScope());
    Scriptable scope = cx.newObject (proto);       
    scope.setPrototype (proto);
    scope.setParentScope (null);
   
    Object res = cx.evaluateString (scope, trans.condition(),
            "<condition>", 1, null);
    if (!(res instanceof Boolean)) {
        logger.error
      ("Evaluating transition condition \""+trans.condition()
       + "\" does not yield a boolean result.");
View Full Code Here

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

            cx.putThreadLocal(MashupConstants.AXIS2_SERVICE, service);
            Scriptable scope = cx.initStandardObjects();
            ScriptableObject.defineClass(scope, ResourceHostObject.class);
            ScriptableObject.defineClass(scope, CollectionHostObject.class);
            ScriptableObject.defineClass(scope, RegistryHostObject.class);
            Object result = cx.evaluateString(scope, script, "<cmd>", 1, null);
            if (result != null && log.isInfoEnabled()) {
                log.info("JavaScript Result: " + Context.toString(result));
            }
        } catch (IllegalAccessException e) {
            log.error("Unable to defining registry host objects.", e);
View Full Code Here

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

            cx.putThreadLocal(MashupConstants.AXIS2_SERVICE, service);
            Scriptable scope = cx.initStandardObjects();
            ScriptableObject.defineClass(scope, ResourceHostObject.class);
            ScriptableObject.defineClass(scope, CollectionHostObject.class);
            ScriptableObject.defineClass(scope, RegistryHostObject.class);
            Object result = cx.evaluateString(scope, script, "<cmd>", 1, null);
            if (result != null && log.isInfoEnabled()) {
                log.debug("JavaScript Result: " + Context.toString(result));
            }
        } catch (IllegalAccessException e) {
            log.error("Unable to defining registry host objects.", e);
View Full Code Here

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

            cx.putThreadLocal(MashupConstants.AXIS2_SERVICE, service);
            Scriptable scope = cx.initStandardObjects();
            ScriptableObject.defineClass(scope, ResourceHostObject.class);
            ScriptableObject.defineClass(scope, CollectionHostObject.class);
            ScriptableObject.defineClass(scope, RegistryHostObject.class);
            Object result = cx.evaluateString(scope, script, "<cmd>", 1, null);
            if (result != null && log.isInfoEnabled()) {
                log.info("JavaScript Result: " + Context.toString(result));
            }
        } catch (IllegalAccessException e) {
            log.error("Unable to defining registry host objects.", e);
View Full Code Here

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

       
    try {
      Scriptable scope = new TopLevelFunctions(context, ctx, context.getDUDir());
      String source = element.getTextContent();
      VariableDelegator delegator = new VariableDelegator(scope, context, ctx);
      ctx.evaluateString(delegator, source, context.getActivityName(), 1, null);
      delegator.writeVariables();
    } catch (WrappedException e) {
      __logger.warn("Error during JS execution.", e);
      if (e.getWrappedException() instanceof FaultException) {
        throw (FaultException)e.getWrappedException();
View Full Code Here

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

           
            Object wrappedOut = Context.javaToJS(System.out, scope);
          ScriptableObject.putProperty(scope, "out", wrappedOut);

            // Now evaluate the string we've collected. We'll ignore the result.
            cx.evaluateString(scope, script, "<cmd>", 1, null);

           
            // Call function "f('my arg')" and print its result.
            Object fObj = scope.get(methodName, scope);
            if (!(fObj instanceof Function)) {
View Full Code Here

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

           
            Object wrappedSystem = Context.javaToJS(systemWrapper, scope);
            ScriptableObject.putProperty(scope, "system", wrappedSystem);

            // Now evaluate the string we've collected. We'll ignore the result.
            cx.evaluateString(scope, script, "<cmd>", 1, null);

           
            // Call function "f('my arg')" and print its result.
            Object fObj = scope.get(methodName, scope);
            if (!(fObj instanceof Function)) {
View Full Code Here

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

              XmlCursor cur = xo.newCursor();
              while (!cur.isStart()) {
                  if (cur.isEnddoc()) {
                            try {
                                Context cx = Context.enter();
                                return cx.evaluateString
                                    (scope, "<></>", "<script>", 1, null);
                            } finally {
                                Context.exit ();
                            }
                  }
View Full Code Here

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

      Scriptable proto = jsScope();
      Scriptable scope = cx.newObject (proto);
      scope.setPrototype (proto);
      scope.setParentScope (null);
   
      Object res = cx.evaluateString (scope, script, "<script>", 1, null);
      if (res instanceof Wrapper) {
    res = ((Wrapper)res).unwrap ();
            } else if (res instanceof XMLObject) {
                SAXEventBufferImpl seb = new SAXEventBufferImpl();
                if (((XMLObject)res).getClassName().equals("XMLList")) {
View Full Code Here

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

         
          this.current = (JSEncogCollection)cx.newObject(scope,"EncogCollection");
          this.current.setCollection(this.currentCollection);
          ScriptableObject.putProperty(scope, "current",this.current);
 
          cx.evaluateString(scope, script.getSource(), script.getName(), 1, null);
 
        } catch(EvaluatorException e) {
          throw new EncogScriptRuntimeError(e);
        } catch(EcmaError e) {
          throw new EncogScriptRuntimeError(e);
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.