ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r391612 - in /webservices/axis2/trunk/java/modules: adb/src/org/apache/axis2/databinding/utils/Constants.java codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
Date Wed, 05 Apr 2006 13:41:23 GMT
Author: ajith
Date: Wed Apr  5 06:41:11 2006
New Revision: 391612

URL: http://svn.apache.org/viewcvs?rev=391612&view=rev
Log:
1.Fixed null handling for complex arrays in the ADBBeanTemplate.xsl
2.Did a minor optimization in imports for the Constants.java

Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/Constants.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/Constants.java?rev=391612&r1=391611&r2=391612&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/Constants.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/Constants.java
Wed Apr  5 06:41:11 2006
@@ -3,7 +3,6 @@
 import org.apache.axis2.databinding.utils.reader.OMAttribKey;
 import org.apache.axis2.databinding.utils.reader.OMElementKey;
 
-import javax.xml.namespace.QName;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl?rev=391612&r1=391611&r2=391612&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
Wed Apr  5 06:41:11 2006
@@ -748,6 +748,7 @@
                    <xsl:variable name="basePropertyType"><xsl:value-of select="@arrayBaseType"/></xsl:variable>
                    <xsl:variable name="namespace"><xsl:value-of select="@nsuri"/></xsl:variable>
                    <xsl:variable name="min"><xsl:value-of select="@minOccurs"/></xsl:variable>
+                   <xsl:variable name="nillable"><xsl:value-of select="@nillable"/></xsl:variable>
 
 
                    <xsl:choose>
@@ -774,11 +775,15 @@
                                             }else if (javax.xml.stream.XMLStreamConstants.END_ELEMENT
== event
                                                  &amp;&amp;  !<xsl:value-of select="$startQname"/>.equals(reader.getName())){
                                                //we've found an end element that does not
belong to this type
-                                               //since this can occur zero times, this may
well be empty.So return
-                                               //the empty object
-                                               return object;
+                                               //since this can occur zero times, this may
well be empty.
 
-                                          </xsl:if>
+                                               object.set<xsl:value-of select="$javaName"/>(
+                                                        (<xsl:value-of select="$propertyType"/>)
+                                                        org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(
+                                                        <xsl:value-of select="$basePropertyType"/>.class,<xsl:value-of
select="$listName"/>));
+                                                break;
+
+                                            </xsl:if>
                                            }else{
                                                reader.next();
                                            }
@@ -791,7 +796,16 @@
                                            event = reader.getEventType();
                                            if (javax.xml.stream.XMLStreamConstants.START_ELEMENT
== event
                                                    &amp;&amp; <xsl:value-of select="$startQname"/>.equals(reader.getName())){
-                                              <xsl:value-of select="$listName"/>.add(<xsl:value-of
select="$basePropertyType"/>.Factory.parse(reader));
+                                            if (org.apache.axis2.databinding.utils.Constants.TRUE.equals(
+                                     reader.getAttributeValue(
+                                           org.apache.axis2.databinding.utils.Constants.XSI_NAMESPACE,
+                                          org.apache.axis2.databinding.utils.Constants.NIL))){
+                                            <xsl:value-of select="$listName"/>.add(null);
+                                        }else{
+                                             <xsl:value-of select="$listName"/>.add(<xsl:value-of
select="$basePropertyType"/>.Factory.parse(reader));
+                                        }
+
+
                                            }else if (javax.xml.stream.XMLStreamConstants.START_ELEMENT
== event
                                                    &amp;&amp; !<xsl:value-of select="$startQname"/>.equals(reader.getName())){
                                               <xsl:value-of select="$loopBoolName"/>
= true;



Mime
View raw message