Package org.mozilla.javascript

Examples of org.mozilla.javascript.JavaScriptException


     */
    public void jsFunction_releaseComponent( Object component ) throws Exception {
        try {
            this.componentManager.release( (Component) unwrap(component) );
        } catch( ClassCastException cce ) {
            throw new JavaScriptException( "Only components can be released!" );
        }
    }
View Full Code Here


        }

        public void jsFunction_addCookie(Object cookie)
            throws JavaScriptException {
            if (!(cookie instanceof FOM_Cookie)) {
                throw new JavaScriptException("expected a Cookie instead of " + cookie);
            }
            FOM_Cookie fom_cookie = (FOM_Cookie)cookie;
            response.addCookie(fom_cookie.cookie);
        }
View Full Code Here

    public void jsFunction_processPipelineTo(String uri,
                                             Object map,
                                             Object outputStream)
        throws Exception {
        if (!(unwrap(outputStream) instanceof OutputStream)) {
            throw new JavaScriptException("expected a java.io.OutputStream instead of " + outputStream);
        }
        interpreter.process(getParentScope(), this, uri, map,
                            (OutputStream)unwrap(outputStream),
                            environment);
    }
View Full Code Here

     */
    public void jsFunction_releaseComponent( Object component ) throws Exception {
        try {
            this.componentManager.release( (Component) unwrap(component) );
        } catch( ClassCastException cce ) {
            throw new JavaScriptException( "Only components can be released!" );
        }
    }
View Full Code Here

        }

        public void jsFunction_addCookie(Object cookie)
            throws JavaScriptException {
            if (!(cookie instanceof FOM_Cookie)) {
                throw new JavaScriptException("expected a Cookie instead of " + cookie);
            }
            FOM_Cookie fom_cookie = (FOM_Cookie)cookie;
            response.addCookie(fom_cookie.cookie);
        }
View Full Code Here

    public void jsFunction_processPipelineTo(String uri,
                                             Object map,
                                             Object outputStream)
        throws Exception {
        if (!(unwrap(outputStream) instanceof OutputStream)) {
            throw new JavaScriptException("expected a java.io.OutputStream instead of " + outputStream);
        }
        interpreter.process(getParentScope(), this, uri, map,
                            (OutputStream)unwrap(outputStream),
                            environment);
    }
View Full Code Here

     */
    public void jsFunction_releaseComponent( Object component ) throws Exception {
        try {
            this.componentManager.release( (Component) unwrap(component) );
        } catch( ClassCastException cce ) {
            throw new JavaScriptException( "Only components can be released!" );
        }
    }
View Full Code Here

        }

        public void jsFunction_addCookie(Object cookie)
            throws JavaScriptException {
            if (!(cookie instanceof FOM_Cookie)) {
                throw new JavaScriptException("expected a Cookie instead of " + cookie);
            }
            FOM_Cookie fom_cookie = (FOM_Cookie)cookie;
            response.addCookie(fom_cookie.cookie);
        }
View Full Code Here

        }
    }

    private void throwError(String errorName) {
        LOG.info("Javascript throw: " + errorName);
        throw new JavaScriptException(Context.javaToJS(errorName, getParentScope()), "XMLHttpRequest", 0);
    }
View Full Code Here

        Function function = (Function)fObj;
        try {
            return function.call(rhinoContext, rhinoScope, rhinoScope, args);
        } catch (RhinoException angryRhino) {
            if (expectingException != null && angryRhino instanceof JavaScriptException) {
                JavaScriptException jse = (JavaScriptException)angryRhino;
                Assert.assertEquals(jse.getValue(), expectingException);
                return null;
            }
            String trace = angryRhino.getScriptStackTrace();
            Assert.fail("JavaScript error: " + angryRhino.toString() + " " + trace);
        } catch (JavaScriptAssertionFailed assertion) {
View Full Code Here

TOP

Related Classes of org.mozilla.javascript.JavaScriptException

Copyright © 2018 www.massapicom. 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.