You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by am...@apache.org on 2008/08/10 07:52:39 UTC

svn commit: r684409 - /webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java

Author: amilas
Date: Sat Aug  9 22:52:38 2008
New Revision: 684409

URL: http://svn.apache.org/viewvc?rev=684409&view=rev
Log:
serializing multidimensional arrays

Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java?rev=684409&r1=684408&r2=684409&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java Sat Aug  9 22:52:38 2008
@@ -34,10 +34,7 @@
 import javax.xml.stream.Location;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
+import java.util.*;
 
 /**
  * This is the new implementation of the ADBpullaparser. The approach here is simple When the pull
@@ -946,21 +943,19 @@
                                                   (String)propertyValue);
             childReader.addNamespaceContext(this.namespaceContext);
             childReader.init();
-        } else if (propertyValue instanceof String[]) {
-            //string[] are handled by the  NameValueArrayStreamReader
-            //if the array is empty - skip it
-            if (((String[])propertyValue).length == 0) {
-                //advance the index
-                currentPropertyIndex = currentPropertyIndex + 2;
-                return processProperties();
-            } else {
-                childReader =
-                        new NameValueArrayStreamReader(propertyQName,
-                                                       (String[])propertyValue);
-                childReader.addNamespaceContext(this.namespaceContext);
-                childReader.init();
+        } else if (propertyValue.getClass().isArray()) {
+            // this is an arrary object and we need to get the pull parser for that
+            List objects = new ArrayList();
+            Object[] objectArray = (Object[]) propertyValue;
+            for (int i = 0; i < objectArray.length; i++) {
+                objects.add(propertyQName);
+                objects.add(objectArray[i]);
             }
 
+            ADBXMLStreamReader reader = new ADBXMLStreamReaderImpl(propertyQName,
+                    objects.toArray(), new ArrayList().toArray(), typeTable, qualified);
+            childReader = new WrappingXMLStreamReader(reader);
+
         } else if (propertyValue instanceof ADBBean) {
             //ADBbean has it's own method to get a reader
             XMLStreamReader reader = ((ADBBean)propertyValue).