You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by aj...@apache.org on 2006/04/28 09:30:23 UTC
svn commit: r397791 -
/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
Author: ajith
Date: Fri Apr 28 00:30:21 2006
New Revision: 397791
URL: http://svn.apache.org/viewcvs?rev=397791&view=rev
Log:
Modifying the template allowing the setting of null for minOccurs=0 case. If nillable is false then setting null to a property that has minoccurs=0 has no effect on the tracker. If nillable is true then the tracker will be set even for a null value!
Modified:
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
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=397791&r1=397790&r2=397791&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 Fri Apr 28 00:30:21 2006
@@ -154,8 +154,23 @@
clearAllSettingTrackers();
</xsl:if>
<xsl:if test="$min=0 or $choice">
- //update the setting tracker
- <xsl:value-of select="$settingTracker"/> = true;
+ <!-- the updating of setting tracker for null values should
+ happen if the attribute is marked as nillable. Else
+ the user can set a null value and it is never marked
+ as set
+ -->
+ <xsl:choose>
+ <xsl:when test="not(@nillable) and not(@primitive)">
+ if (param !=null){
+ //update the setting tracker
+ <xsl:value-of select="$settingTracker"/> = true;
+ }
+ </xsl:when>
+ <xsl:otherwise>
+ //update the setting tracker
+ <xsl:value-of select="$settingTracker"/> = true;
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:if>
this.<xsl:value-of select="$varName"/>=param;
}