X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjs%2FXMLRPC.java;h=a3dc3314a81dc501d82804cb242b96eb1b24fab6;hb=7113d47d1ef227732b610026bee8c22b9ada3525;hp=6f50328c181412f56f0e627f3ebfb0800c609b54;hpb=44ba228826e0d6a6c4ad3ed0072b90e05622ee21;p=org.ibex.js.git diff --git a/src/org/ibex/js/XMLRPC.java b/src/org/ibex/js/XMLRPC.java index 6f50328..a3dc331 100644 --- a/src/org/ibex/js/XMLRPC.java +++ b/src/org/ibex/js/XMLRPC.java @@ -1,4 +1,7 @@ -// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL] +// Copyright 2000-2005 the Contributors, as shown in the revision logs. +// Licensed under the Apache Public Source License 2.0 ("the License"). +// You may not use this file except in compliance with the License. + package org.ibex.js; import java.io.*; @@ -38,8 +41,8 @@ public class XMLRPC extends JS { } public XMLRPC(String url, String method, XMLRPC httpSource) { this.http = httpSource.http; this.url = url; this.method = method; } - public Object get(Object name) { - return new XMLRPC(url, (method.equals("") ? "" : method + ".") + name.toString(), this); } + public JS get(JS name) throws JSExn { + return new XMLRPC(url, (method.equals("") ? "" : method + ".") + Script.toString(name), this); } /** this holds character content as we read it in -- since there is only one per instance, we don't support mixed content */ @@ -84,7 +87,7 @@ public class XMLRPC extends JS { content.reset(); //#switch(c.getLocalName()) case "fault": fault = true; - case "struct": objects.setElementAt(new JS(), objects.size() - 1); + case "struct": objects.setElementAt(new JS.O(), objects.size() - 1); case "array": objects.setElementAt(null, objects.size() - 1); case "value": objects.addElement(""); //#end @@ -129,8 +132,8 @@ public class XMLRPC extends JS { "the server sent a tag which was malformed: " + s); } case "member": - Object memberValue = objects.elementAt(objects.size() - 1); - String memberName = (String)objects.elementAt(objects.size() - 2); + JS memberValue = (JS)objects.elementAt(objects.size() - 1); + JS memberName = (JS)objects.elementAt(objects.size() - 2); JS struct = (JS)objects.elementAt(objects.size() - 3); try { struct.put(memberName, memberValue); @@ -143,7 +146,7 @@ public class XMLRPC extends JS { for(i=objects.size() - 1; objects.elementAt(i) != null; i--); JSArray arr = new JSArray(); try { - for(int j = i + 1; j\n"); JSArray a = (JSArray)o; for(int i=0; i\n"); Enumeration e = j.keys(); while(e.hasMoreElements()) { Object key = e.nextElement(); sb.append(" " + key + "\n"); - appendObject(j.get(key), sb); + appendObject(j.get((JS)key), sb); sb.append(" \n"); } sb.append(" \n"); @@ -302,7 +305,7 @@ public class XMLRPC extends JS { // Call Sequence ////////////////////////////////////////////////////////////////////////// /* FIXME this has been disabled to make XMLRPC usable without Scheduler - public final Object call(Object a0, Object a1, Object a2, Object[] rest, int nargs) throws JSExn { + public final Object call(JS a0, JS a1, JS a2, JS[] rest, int nargs) throws JSExn { JSArray args = new JSArray(); for(int i=0; i