Package de.innovationgate.ext.org.mozilla.javascript

Examples of de.innovationgate.ext.org.mozilla.javascript.EvaluatorException


   
   
    public static Date parseDate(Context cx, Scriptable thisObj, java.lang.Object[] args, Function funObj) throws WGException, JavaScriptException, ParseException {
       
        if (args.length != 2) {
            throw new EvaluatorException("Method WGA.parseDate() needs two string parameters");
        }
       
        return fetchInitialContext(cx).parsedate(String.valueOf(args[0]), String.valueOf(args[1]));
       
    }
View Full Code Here


    }
   
    public static TMLForm createForm(Context cx, Scriptable thisObj, java.lang.Object[] args, Function funObj) throws WGException {
       
        if (args.length != 1) {
             throw new EvaluatorException("Method WGA.createForm() needs an FormInfo object as parameter");
        }
       
        Object arg = args[0];
        if (arg instanceof Wrapper) {
            arg = ((Wrapper) arg).unwrap();
        }
       
        if (!(arg instanceof FormInfo)) {
            throw new EvaluatorException("Method WGA.createForm() needs an FormInfo object as parameter");
        }
       
        FormInfo formInfo = (FormInfo) arg;
   
        return fetchInitialContext(cx).createform(formInfo);
View Full Code Here

    }
   
    public static FormInfo createFormInfo(Context cx, Scriptable thisObj, java.lang.Object[] args, Function funObj) throws WGException {
       
        if (args.length != 1) {
            throw new EvaluatorException("Method WGA.createFormInfo() needs a string as parameter");
        }
       
        String id = String.valueOf(args[0]);
   
   
View Full Code Here

    }
   
    public static ImageScaler createImageScaler(Context cx, Scriptable thisObj, java.lang.Object[] args, Function funObj) throws WGException, JavaScriptException, ModuleInstantiationException, IOException {
       
        if (args.length != 1) {
            throw new EvaluatorException("Method WGA.createImageScaler() needs either a file or an input stream as parameter");
        }
       
        Object arg = args[0];
        if (arg instanceof Wrapper) {
            arg = ((Wrapper) arg).unwrap();
        }

        if (arg instanceof File) {
            return fetchInitialContext(cx).createimagescaler((File) arg);
        }
        else if (arg instanceof InputStream) {
            return fetchInitialContext(cx).createimagescaler((InputStream) arg);
        }
        else {
            throw new EvaluatorException("Method WGA.createImageScaler() needs either a file or an input stream as parameter");
        }
       
    }
View Full Code Here

                arg = cx.jsToJava(arg, Object[].class);
            }
           
           
            if (!(arg instanceof Object[])) {
                throw new EvaluatorException("Method WGA.createList() needs either no parameters, an array or two string parameters");
            }
            return fetchInitialContext(cx).createlist((Object[]) arg);
        }
        else if (args.length == 2) {
            Object arg1 = args[0];
            Object arg2 = args[1];
            return fetchInitialContext(cx).createlist(String.valueOf(arg1), String.valueOf(arg2));
        }
        else {
            throw new EvaluatorException("Method WGA.createList() needs either no parameters, an array or two string parameters");
        }
       
    }
View Full Code Here

            Object arg2 = args[1];
            Object arg3 = args[2];
            return fetchInitialContext(cx).createmail(String.valueOf(arg1), String.valueOf(arg2), String.valueOf(arg3));
        }
        else {
            throw new EvaluatorException("Method WGA.createMail) needs either no parameters or three string parameters");
        }
       
       
    }
View Full Code Here

    }
   
    public static Number parseNumber(Context cx, Scriptable thisObj, java.lang.Object[] args, Function funObj) throws JavaScriptException, ParseException {
       
        if (args.length != 2) {
            throw new EvaluatorException("Method WGA.parseNumber() needs two string parameters");
        }
       
       
        Number num = fetchInitialContext(cx).getNumberFormat(String.valueOf(args[1])).parse(String.valueOf(args[0]));
        return num;
View Full Code Here

    }
   
    public static WGDatabase db(Context cx, Scriptable thisObj, java.lang.Object[] args, Function funObj) throws JavaScriptException, WGException {
       
        if (args.length != 1) {
            throw new EvaluatorException("Method WGA.db() needs one string parameter");
        }
       
        return fetchInitialContext(cx).db(String.valueOf(args[0]));
       
    }
View Full Code Here

    }
   
    public static WGHierarchicalDatabase hdb(Context cx, Scriptable thisObj, java.lang.Object[] args, Function funObj) throws JavaScriptException, WGException {
       
        if (args.length != 1) {
            throw new EvaluatorException("Method WGA.hdb() needs one string parameter");
        }
       
        return fetchInitialContext(cx).hdb(String.valueOf(args[0]));
       
    }
View Full Code Here

    }
   
    public static String encode(Context cx, Scriptable thisObj, java.lang.Object[] args, Function funObj) throws JavaScriptException, FormattingException {
       
        if (args.length != 2) {
            throw new EvaluatorException("Method WGA.encode() needs a string and an object parameter");
        }
       
        return fetchInitialContext(cx).encode(String.valueOf(args[0]), args[1]);

       
View Full Code Here

TOP

Related Classes of de.innovationgate.ext.org.mozilla.javascript.EvaluatorException

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.