Package org.mozilla.javascript

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


                FOM_JavaScriptFlowHelper.setFOM_FlowScope(cocoon.getObjectModel(), kScope);

                if (enableDebugger) {
                    getDebugger().setVisible(true);
                }
                Scriptable parameters = context.newObject(kScope);
                int size = params != null ? params.size() : 0;
                for (int i = 0; i < size; i++) {
                    Interpreter.Argument arg = (Interpreter.Argument)params.get(i);
                    parameters.put(arg.name, parameters, arg.value);
                }
View Full Code Here


            // Put in the thread scope the Cocoon object, which gives access
            // to the interpreter object, and some Cocoon objects. See
            // FOM_Cocoon for more details.
            final Object[] args = {};
            FOM_Cocoon cocoon = (FOM_Cocoon) context.newObject(this,
                                                               "FOM_Cocoon",
                                                               args);
            cocoon.setParentScope(this);
            super.put("cocoon", this, cocoon);
View Full Code Here

            Scriptable parentScope = getParentScope(objectModel);

            // Create a new local scope
            Scriptable scope;
            try {
                scope = ctx.newObject(parentScope);
            } catch (Exception e) {
                // Should normally not happen
                throw new CascadingRuntimeException("Cannont create script scope", e);
            }
            scope.setParentScope(parentScope);
View Full Code Here

                Object viewData = FlowHelper.getContextObject(objectModel);
                if (viewData != null) {
                    // Create a new local scope to hold the view data
                    Scriptable newScope;
                    try {
                        newScope = ctx.newObject(scope);
                    } catch (Exception e) {
                        // Should normally not happen
                        throw new CascadingRuntimeException("Cannont create function scope", e);
                    }
                    newScope.setParentScope(scope);
View Full Code Here

    public DOMSource invoke(DOMSource request) {
        DOMSource response = new DOMSource();
        Context cx = ContextFactory.getGlobal().enterContext();
        try {
            Scriptable scope = cx.newObject(scriptScope);
            scope.setPrototype(scriptScope);
            scope.setParentScope(null);
            Node node = request.getNode();
            Object inDoc = null;
            if (isE4X) {
View Full Code Here

            Object inDoc = null;
            if (isE4X) {
                try {
                    inDoc = Context.toObject(node, scope);
                    Object[] args = {inDoc};
                    inDoc = cx.newObject(scope, "XML", args);
                } catch (Exception ex) {
                    ex.printStackTrace();
                }
            } else {
                inDoc = Context.toObject(node, scope);
View Full Code Here

            throw new RuntimeException(e);
        }

        Context context = ContextFactory.getGlobal().enterContext();
        try {
            JsSimpleDomNode domNode = (JsSimpleDomNode)context.newObject(getParentScope(), "Node");
            domNode.initialize(document, null);
            return domNode;
        } finally {
            Context.exit();
        }
View Full Code Here

    public DOMSource invoke(DOMSource request) {
        DOMSource response = new DOMSource();
        Context cx = ContextFactory.getGlobal().enterContext();
        try {
            Scriptable scope = cx.newObject(scriptScope);
            scope.setPrototype(scriptScope);
            scope.setParentScope(null);
            Node node = request.getNode();
            Object inDoc = null;
            if (isE4X) {
View Full Code Here

            Object inDoc = null;
            if (isE4X) {
                try {
                    inDoc = Context.toObject(node, scope);
                    Object[] args = {inDoc};
                    inDoc = cx.newObject(scope, "XML", args);
                } catch (Exception ex) {
                    ex.printStackTrace();
                }
            } else {
                inDoc = Context.toObject(node, scope);
View Full Code Here

            return null;
        }

        Context cx = ContextFactory.getGlobal().enterContext();
        try {
            JsSimpleDomNode newObject = (JsSimpleDomNode)cx.newObject(scope, "Node");
            newObject.initialize(node, null);
            return newObject;
        } 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.