public Object run(Context cx) { ScriptableObject.callMethod (scriptable, HANDLE_EVENT, array); return null; } };
public Object run(Context cx) { ScriptableObject.callMethod (scriptable, HANDLE_EVENT, array); return null; } };
/** * Call a method of an object. * @param obj the JavaScript object * @param methodName the name of the function property * @param args the arguments for the call * * @see Context#getCurrentContext() */ public static Object callMethod(Scriptable obj, String methodName, Object[] args) { return callMethod(null, obj, methodName, args); }
/** * Call a method of an object. * @param obj the JavaScript object * @param methodName the name of the function property * @param args the arguments for the call * * @see Context#getCurrentContext() */ public static Object callMethod(Scriptable obj, String methodName, Object[] args) { return callMethod(null, obj, methodName, args); }
/** * Call a method of an object. * @param obj the JavaScript object * @param methodName the name of the function property * @param args the arguments for the call * * @see Context#getCurrentContext() */ public static Object callMethod(Scriptable obj, String methodName, Object[] args) { return callMethod(null, obj, methodName, args); }
public OMElement toOMElement(Object scriptXML) throws ScriptException { if (scriptXML == null) { return null; } if (!(scriptXML instanceof XMLObject)) { return null; } Object o = ScriptableObject.callMethod( (Scriptable) scriptXML, "getXmlObject", new Object[0]); return (OMElement) o; // return (OMElement) ScriptableObject.callMethod( (Scriptable) scriptXML, "getXmlObject", new Object[0]); }
/** * Call a method of an object. * @param obj the JavaScript object * @param methodName the name of the function property * @param args the arguments for the call * * @see Context#getCurrentContext() */ public static Object callMethod(Scriptable obj, String methodName, Object[] args) { return callMethod(null, obj, methodName, args); }
/** * Call a method of an object. * @param obj the JavaScript object * @param methodName the name of the function property * @param args the arguments for the call * * @see Context#getCurrentContext() */ public static Object callMethod(Scriptable obj, String methodName, Object[] args) { return callMethod(null, obj, methodName, args); }
public static Object callMethod(Scriptable obj, String methodName, Object[] args) { return ScriptableObject.callMethod(obj, methodName, args); }
public Object run(Context cx) { ScriptableObject.callMethod (scriptable, HANDLE_EVENT, array); return null; } };
/** * Call a method of an object. * @param obj the JavaScript object * @param methodName the name of the function property * @param args the arguments for the call * * @see Context#getCurrentContext() */ public static Object callMethod(Scriptable obj, String methodName, Object[] args) { return callMethod(null, obj, methodName, args); }
public static Object callMethod(Context cx, Scriptable obj, String methodName, Object[] args) { return ScriptableObject.callMethod(cx, obj, methodName, args); }
private void callMethodOnJsObject(Scriptable o, String mName, Object... arg) { ScriptableObject.callMethod(o, mName, arg); }
public Object run(Context cx) { ScriptableObject.callMethod (obj, methodName, ab.buildArguments()); return null; } });
private void addImportedClasses(Context cx, Scriptable scope, Class<?>[] classes) { if (classes != null && classes.length > 0) { NativeJavaClass[] np = new NativeJavaClass[classes.length]; for (int i = 0; i < classes.length; i++) { np[i] = new NativeJavaClass(scope, classes[i]); } ScriptableObject.callMethod(cx, scope, "importClass", np); } }
public Object run(Context cx) { ScriptableObject.callMethod (obj, methodName, ab.buildArguments()); return null; } });
private void addImportedPackages(Context cx, Scriptable scope, String[] packages) { if (packages != null && packages.length > 0) { NativeJavaPackage[] np = new NativeJavaPackage[packages.length]; for (int i = 0; i < packages.length; i++) { np[i] = new NativeJavaPackage(packages[i]); } ScriptableObject.callMethod(cx, scope, "importPackage", np); } }
public Object run(Context cx) { ScriptableObject.callMethod (obj, methodName, ab.buildArguments()); return null; } });
/** * This method will convert the message payload in to xml * * @param scriptXML from java script Scriptable * @return XML content as OMElement wrapped in Scriptable object * @throws ScriptException when error */ public OMElement toOMElement(Object scriptXML) throws ScriptException { if (scriptXML == null) { return null; } if (!(scriptXML instanceof XMLObject)) { return null; } // TODO: E4X Bug? Shouldn't need this copy, but without it the outer element gets lost??? Scriptable jsXML = (Scriptable) ScriptableObject.callMethod((Scriptable) scriptXML, "copy", new Object[0]); OMElement omElement; try { omElement = AXIOMUtil.stringToOM((String) ScriptableObject.callMethod(jsXML, "toXMLString", new Object[0])); } catch (XMLStreamException e) { throw new ScriptException(e); } return omElement; }
public OMElement toOMElement(Object scriptXML) throws ScriptException { if (scriptXML == null) { return null; } if (!(scriptXML instanceof XMLObject)) { return null; } // TODO: E4X Bug? Shouldn't need this copy, but without it the outer element gets lost??? Scriptable jsXML = (Scriptable) ScriptableObject.callMethod((Scriptable) scriptXML, "copy", new Object[0]); Wrapper wrapper = (Wrapper) ScriptableObject.callMethod(jsXML, "getXmlObject", new Object[0]); XmlObject xmlObject = (XmlObject) wrapper.unwrap(); try { StAXOMBuilder builder = new StAXOMBuilder(xmlObject.newInputStream()); return builder.getDocumentElement(); } catch (XMLStreamException e) { throw new ScriptException(e); } }