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 ve...@apache.org on 2009/07/05 16:51:37 UTC
svn commit: r791256 - in
/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template:
ADBBeanTemplate-bean.xsl ADBBeanTemplate-helpermode.xsl
Author: veithen
Date: Sun Jul 5 14:51:37 2009
New Revision: 791256
URL: http://svn.apache.org/viewvc?rev=791256&view=rev
Log:
AXIS2-4411: Fixed exception messages in ADB template.
Modified:
webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl
webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-helpermode.xsl
Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl?rev=791256&r1=791255&r2=791256&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl Sun Jul 5 14:51:37 2009
@@ -1329,6 +1329,7 @@
<xsl:variable name="nillable" select="property/@nillable"></xsl:variable>
<xsl:variable name="primitive" select="property/@primitive"></xsl:variable>
<xsl:variable name="propertyType"><xsl:value-of select="property/@type"/></xsl:variable>
+ <xsl:variable name="propertyName"><xsl:value-of select="property/@name"/></xsl:variable>
<xsl:choose>
<!-- This better be only one!!-->
@@ -1337,7 +1338,7 @@
<xsl:when test="$nillable">
if (<xsl:value-of select="$varName"/>==null){
java.lang.String namespace = "<xsl:value-of select="property/@nsuri"/>";
- writeStartElement(null, namespace, "<xsl:value-of select="property/@name"/>", xmlWriter);
+ writeStartElement(null, namespace, "<xsl:value-of select="$propertyName"/>", xmlWriter);
// write the nil attribute
writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","nil","1",xmlWriter);
@@ -1348,7 +1349,7 @@
</xsl:when>
<xsl:otherwise>
if (<xsl:value-of select="$varName"/>==null){
- throw new org.apache.axis2.databinding.ADBException("Property cannot be null!");
+ throw new org.apache.axis2.databinding.ADBException("<xsl:value-of select="$propertyName"/> cannot be null!");
}
<xsl:value-of select="$varName"/>.serialize(MY_QNAME,xmlWriter);
</xsl:otherwise>
@@ -1358,7 +1359,7 @@
<xsl:otherwise>
<xsl:if test="not(property/@simple)">
java.lang.String namespace = "<xsl:value-of select="property/@nsuri"/>";
- java.lang.String localName = "<xsl:value-of select="property/@name"/>";
+ java.lang.String localName = "<xsl:value-of select="$propertyName"/>";
</xsl:if>
<xsl:if test="property/@simple">
java.lang.String namespace = parentQName.getNamespaceURI();
@@ -1387,7 +1388,7 @@
writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","nil","1",xmlWriter);
</xsl:when>
<xsl:otherwise>
- throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!");
+ throw new org.apache.axis2.databinding.ADBException("<xsl:value-of select="$propertyName"/> cannot be null !!");
</xsl:otherwise>
</xsl:choose>
}else{
Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-helpermode.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-helpermode.xsl?rev=791256&r1=791255&r2=791256&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-helpermode.xsl (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-helpermode.xsl Sun Jul 5 14:51:37 2009
@@ -974,6 +974,7 @@
<xsl:variable name="nillable" select="property/@nillable"></xsl:variable>
<xsl:variable name="primitive" select="property/@primitive"></xsl:variable>
<xsl:variable name="propertyType"><xsl:value-of select="property/@type"/></xsl:variable>
+ <xsl:variable name="propertyName"><xsl:value-of select="property/@name"/></xsl:variable>
<xsl:choose>
<!-- This better be only one!!-->
@@ -982,7 +983,7 @@
<xsl:when test="$nillable">
if (<xsl:value-of select="$varName"/>==null){
java.lang.String namespace = "<xsl:value-of select="property/@nsuri"/>";
- writeStartElement(null, namespace, "<xsl:value-of select="property/@name"/>", xmlWriter);
+ writeStartElement(null, namespace, "<xsl:value-of select="$propertyName"/>", xmlWriter);
// write the nil attribute
writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","nil","1",xmlWriter);
@@ -995,7 +996,7 @@
</xsl:when>
<xsl:otherwise>
if (<xsl:value-of select="$varName"/>==null){
- throw new org.apache.axis2.databinding.ADBException("Property cannot be null!");
+ throw new org.apache.axis2.databinding.ADBException("<xsl:value-of select="$propertyName"/> cannot be null!");
}
<xsl:value-of select="property/@type"/>Helper.INSTANCE.serialize(<xsl:value-of select="$varName"/>,
<xsl:value-of select="$fullyQualifiedName"/>.MY_QNAME,
@@ -1007,7 +1008,7 @@
<xsl:otherwise>
<xsl:if test="not(property/@simple)">
java.lang.String namespace = "<xsl:value-of select="property/@nsuri"/>";
- java.lang.String localName = "<xsl:value-of select="property/@name"/>";
+ java.lang.String localName = "<xsl:value-of select="$propertyName"/>";
</xsl:if>
<xsl:if test="property/@simple">
java.lang.String namespace = parentQName.getNamespaceURI();
@@ -1023,7 +1024,7 @@
writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","nil","1",xmlWriter);
</xsl:when>
<xsl:otherwise>
- throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!");
+ throw new org.apache.axis2.databinding.ADBException("<xsl:value-of select="$propertyName"/> cannot be null !!");
</xsl:otherwise>
</xsl:choose>
}else{