axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r415928 - /webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
Date Wed, 21 Jun 2006 06:58:43 GMT
Author: ajith
Date: Tue Jun 20 23:58:42 2006
New Revision: 415928

URL: http://svn.apache.org/viewvc?rev=415928&view=rev
Log:
1. Fixing a wrongful handling of OMElement in OMElements inside the new ADB getOMElement method

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

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl?rev=415928&r1=415927&r2=415928&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
Tue Jun 20 23:58:42 2006
@@ -341,18 +341,58 @@
                                     }
                                 </xsl:otherwise>
                             </xsl:choose>
+
                             for (int i = 0;i &lt; <xsl:value-of select="$varName"/>.length;i++){
                              <xsl:value-of select="$varName"/>[i].getOMElement(
                                        new javax.xml.namespace.QName("<xsl:value-of select="$namespace"/>","<xsl:value-of
select="$propertyName"/>"),
                                        factory).serialize(xmlWriter);
+
                             }
                             <!--we've opened a bracket for the nulls - fix it here-->
                             <xsl:if test="@nillable">}</xsl:if>
                         </xsl:when>
 
-                        <xsl:when test="@default">
+                         <xsl:when test="@default and @array">
+                            <!-- Note - Assumed to be OMElement-->
+                            <xsl:choose>
+                               <xsl:when test="@nillable">
+                                    // this property is nillable
+                                    if (<xsl:value-of select="$varName"/>!=null){
+                                    <!--this bracket needs to be closed!-->
+                                </xsl:when>
+                                <xsl:otherwise>
+                                    if (<xsl:value-of select="$varName"/>==null){
+                                         throw new RuntimeException("<xsl:value-of select="$propertyName"/>
cannot be null!!");
+                                    }
+                                </xsl:otherwise>
+                            </xsl:choose>
+
+                              for (int i = 0;i &lt; <xsl:value-of select="$varName"/>.length;i++){
+                                  <xsl:value-of select="$varName"/>[i].serialize(xmlWriter);
+                              }
+
+                            }
+                            <!--we've opened a bracket for the nulls - fix it here-->
+                            <xsl:if test="@nillable">}</xsl:if>
+
+                        </xsl:when>
+
+                        <xsl:when test="@default and not(@array)">
                             <!-- Note - Assumed to be OMElement-->
-                            <xsl:value-of select="$varName"/>.serialize(xmlWriter);
+                            <xsl:choose>
+                             <xsl:when test="@nillable">
+                                    // this property is nillable
+                                    if (<xsl:value-of select="$varName"/>!=null){
+                                    <!--this bracket needs to be closed!-->
+                                </xsl:when>
+                                <xsl:otherwise>
+                                    if (<xsl:value-of select="$varName"/>==null){
+                                         throw new RuntimeException("<xsl:value-of select="$propertyName"/>
cannot be null!!");
+                                    }
+                                </xsl:otherwise>
+                             </xsl:choose>
+                             <xsl:value-of select="$varName"/>.serialize(xmlWriter);
+                             <xsl:if test="@nillable">}</xsl:if>
                         </xsl:when>
                         <!-- handle non ADB arrays - Not any however -->
                         <xsl:when test="@array and not(@any)">



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message