cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r764036 - in /cxf/branches/2.1.x-fixes: ./ rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
Date Fri, 10 Apr 2009 20:29:17 GMT
Author: dkulp
Date: Fri Apr 10 20:29:17 2009
New Revision: 764036

URL: http://svn.apache.org/viewvc?rev=764036&view=rev
Log:
Merged revisions 761113 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r761113 | bimargulies | 2009-04-01 20:05:22 -0400 (Wed, 01 Apr 2009) | 2 lines
  
  CXF-2139, I hope.
........

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Apr 10 20:29:17 2009
@@ -1 +1 @@
-/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761759,761789,762393
+/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761759,761789,762393

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.1.x-fixes/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java?rev=764036&r1=764035&r2=764036&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
Fri Apr 10 20:29:17 2009
@@ -47,7 +47,6 @@
 import org.apache.ws.commons.schema.XmlSchemaObject;
 import org.apache.ws.commons.schema.XmlSchemaObjectCollection;
 import org.apache.ws.commons.schema.XmlSchemaObjectTable;
-import org.apache.ws.commons.schema.XmlSchemaSequence;
 import org.apache.ws.commons.schema.XmlSchemaSimpleType;
 import org.apache.ws.commons.schema.XmlSchemaType;
 
@@ -389,9 +388,8 @@
      */
     public void domDeserializerFunction(QName name, XmlSchemaComplexType type) {
         utils = new JavascriptUtils(code);
-        XmlSchemaSequence sequence = null;
-
-        sequence = XmlSchemaUtils.getSequence(type);
+        
+        List<XmlSchemaObject> contentElements = XmlSchemaUtils.getContentElements(type,
xmlSchemaCollection);
         String typeObjectName = nameManager.getJavascriptName(name);
         code.append("function " + typeObjectName + "_deserialize (cxfjsutils, element) {\n");
         // create the object we are deserializing into.
@@ -401,18 +399,19 @@
 
         utils.appendLine("var item;");
 
-        for (int i = 0; i < sequence.getItems().getCount(); i++) {
+        int nContentElements = contentElements.size();
+        for (int i = 0; i < contentElements.size(); i++) {
+            XmlSchemaObject contentElement = contentElements.get(i);
             utils.appendLine("cxfjsutils.trace('curElement: ' + cxfjsutils.traceElementName(curElement));");
-            XmlSchemaObject thing = sequence.getItems().getItem(i);
-            ParticleInfo itemInfo = ParticleInfo.forLocalItem(thing,
+            ParticleInfo itemInfo = ParticleInfo.forLocalItem(contentElement,
                                                               schemaInfo.getSchema(),
                                                               xmlSchemaCollection, 
                                                               prefixAccumulator, 
                                                               type.getQName()); 
             if (itemInfo.isAny()) {
                 ParticleInfo nextItem = null;
-                if (i != sequence.getItems().getCount() - 1) {
-                    XmlSchemaObject nextThing = sequence.getItems().getItem(i + 1);
+                if (i != nContentElements - 1) {
+                    XmlSchemaObject nextThing = contentElements.get(i + 1);
                     nextItem = ParticleInfo.forLocalItem(nextThing, 
                                                          schemaInfo.getSchema(), 
                                                          xmlSchemaCollection, 
@@ -426,7 +425,7 @@
                 }
                 deserializeAny(type, itemInfo, nextItem);
             } else {
-                deserializeElement(type, thing);
+                deserializeElement(type, contentElement);
             }
         }
         utils.appendLine("return newobject;");



Mime
View raw message