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

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


        if (toBeFormatted instanceof NativeJavaObject) {
            toBeFormatted = ((NativeJavaObject) toBeFormatted).unwrap();
        }
        else if (toBeFormatted instanceof Scriptable && toBeFormatted.getClass().getName().equals("de.innovationgate.ext.org.mozilla.javascript.NativeDate")) {
            Scriptable jsDate = (Scriptable) toBeFormatted;
            Double javaTime = (Double) ScriptableObject.callMethod(jsDate, "getTime", null);
            toBeFormatted = new Date(javaTime.longValue());
        }
        else if (toBeFormatted instanceof Scriptable) {
            toBeFormatted = ((Scriptable) toBeFormatted).getDefaultValue(null);
View Full Code Here


        else {
            func = loadObjectDefinition(cx, thisObj, args, funObj);
        }

        // Construct the object
        Scriptable obj = func.construct(cx, thisObj, new Object[] {});
        Scriptable topLevelScope = ScriptableObject.getTopLevelScope(thisObj);

        // Put the action definition to the object, so it "knows" where it's
        // definition came from
        TMLAction action = (TMLAction) func.get(RhinoExpressionEngine.PARAM_ACTIONDEFINITION, func);
        if (action != null) {
View Full Code Here

        if (error instanceof Throwable) {
            throwable = (Throwable) error;
        }
        else if (error instanceof Scriptable) {
            Scriptable nativeError = (Scriptable) error;
            if (nativeError.has("rhinoException", nativeError)) {
                throwable = (RhinoException) ((NativeJavaObject) nativeError.get("rhinoException", nativeError)).unwrap();
            }
            else if (nativeError.has("javaException", nativeError)) {
                throwable = (Throwable) ((NativeJavaObject) nativeError.get("javaException", nativeError)).unwrap();
            }
            else if (nativeError.has("message", nativeError)) {
                additionalMsg = (String) nativeError.get("message", nativeError);
            }
            else {
                additionalMsg = "(scriptable error object without further information: " + nativeError.getClass().getName() + ")";
            }

            if (nativeError.has("lineNumber", nativeError) && !(throwable instanceof RhinoException)) {
                additionalMsg += ". Line number: " + (Integer) nativeError.get("lineNumber", nativeError);
            }
        }
        else {
            additionalMsg = "(error object of invalid type: " + error.getClass().getName() + ")";
        }
View Full Code Here

     */
    public int determineTMLScriptType(Object obj) {
       
        if (obj instanceof Scriptable) {
           
            Scriptable scr = (Scriptable) obj;
           
            if (scr.getClassName().equals("XMLList")) {
                return RhinoExpressionEngine.TYPE_XMLLIST;
            }
            else if (scr instanceof XMLObject) {
                return RhinoExpressionEngine.TYPE_XMLOBJECT;
            }
View Full Code Here

       
        if (determineTMLScriptType(obj) != RhinoExpressionEngine.TYPE_XMLLIST) {
            return list;
        }
       
        Scriptable scr = (Scriptable) obj;
        for (int idx=0; scr.has(idx, scr); idx++) {
            list.add(scr.get(idx, scr));
        }
       
        return list;
    }
View Full Code Here

        else {
            func = loadObjectDefinition(cx, design, args, funObj);
        }

        // Construct the object
        Scriptable obj = func.construct(cx, thisObj, new Object[] {});
        Scriptable topLevelScope = ScriptableObject.getTopLevelScope(thisObj);

        // Put the action definition to the object, so it "knows" where it's
        // definition came from
        TMLAction action = (TMLAction) func.get(RhinoExpressionEngine.PARAM_ACTIONDEFINITION, func);
        if (action != null) {
View Full Code Here

TOP

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

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.