You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2006/12/31 15:59:31 UTC

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

Author: dims
Date: Sun Dec 31 06:59:30 2006
New Revision: 491427

URL: http://svn.apache.org/viewvc?view=rev&rev=491427
Log:
optimize string array conversion

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?view=diff&rev=491427&r1=491426&r2=491427
==============================================================================
--- 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 Sun Dec 31 06:59:30 2006
@@ -1899,10 +1899,18 @@
                                                 }
                                             }
                                             // call the converter utility  to convert and set the array
+                                            <xsl:choose>
+                                                <xsl:when test="$basePropertyType='java.lang.String'">
+                                                    object.set<xsl:value-of select="$javaName"/>((<xsl:value-of select="$propertyType"/>)
+                                                        <xsl:value-of select="$listName"/>.toArray(new <xsl:value-of select="$basePropertyType"/>[<xsl:value-of select="$listName"/>.size()]));
+                                                </xsl:when>
+                                                <xsl:otherwise>
                                             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"/>));
+                                                </xsl:otherwise>
+                                            </xsl:choose>
                                         </xsl:when>
                                         <!-- End of Array handling of ADB classes -->
 
@@ -1934,9 +1942,17 @@
 
                                              }
 
+                                            <xsl:choose>
+                                                <xsl:when test="$basePropertyType='java.lang.String'">
+                                                    object.set<xsl:value-of select="$javaName"/>((<xsl:value-of select="$propertyType"/>)
+                                                        <xsl:value-of select="$listName"/>.toArray(new <xsl:value-of select="$basePropertyType"/>[<xsl:value-of select="$listName"/>.size()]));
+                                                </xsl:when>
+                                                <xsl:otherwise>
                                              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"/>));
+                                                </xsl:otherwise>
+                                            </xsl:choose>
                                         </xsl:when>
 
                                         <!-- End of Array handling of ADB classes -->
@@ -1981,10 +1997,17 @@
 
                                              }
 
+                                            <xsl:choose>
+                                                <xsl:when test="$basePropertyType='java.lang.String'">
+                                                    object.set<xsl:value-of select="$javaName"/>((<xsl:value-of select="$propertyType"/>)
+                                                        <xsl:value-of select="$listName"/>.toArray(new <xsl:value-of select="$basePropertyType"/>[<xsl:value-of select="$listName"/>.size()]));
+                                                </xsl:when>
+                                                <xsl:otherwise>
                                              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"/>));
-
+                                                </xsl:otherwise>
+                                            </xsl:choose>
                                         </xsl:when>
 
                                         <!-- handling binary case -->
@@ -2082,10 +2105,17 @@
                                                     }
                                                 }
                                                 // call the converter utility  to convert and set the array
+                                            <xsl:choose>
+                                                <xsl:when test="$basePropertyType='java.lang.String'">
+                                                    object.set<xsl:value-of select="$javaName"/>((<xsl:value-of select="$propertyType"/>)
+                                                        <xsl:value-of select="$listName"/>.toArray(new <xsl:value-of select="$basePropertyType"/>[<xsl:value-of select="$listName"/>.size()]));
+                                                </xsl:when>
+                                                <xsl:otherwise>
                                                 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"/>));
+                                                            <xsl:value-of select="$basePropertyType"/>.class,<xsl:value-of select="$listName"/>));
+                                                </xsl:otherwise>
+                                            </xsl:choose>
                                         </xsl:when>
 
                                         <xsl:otherwise>
@@ -2129,9 +2159,17 @@
 
                                              }
 
+                                                 <xsl:choose>
+                                                     <xsl:when test="$basePropertyType='java.lang.String'">
+                                                         object.set<xsl:value-of select="$javaName"/>((<xsl:value-of select="$propertyType"/>)
+                                                             <xsl:value-of select="$listName"/>.toArray(new <xsl:value-of select="$basePropertyType"/>[<xsl:value-of select="$listName"/>.size()]));
+                                                     </xsl:when>
+                                                     <xsl:otherwise>
                                              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"/>));
+                                                     </xsl:otherwise>
+                                                 </xsl:choose>
 
                                         </xsl:when>
                                         <!-- End of Array handling of default class - that is the OMElement -->
@@ -2175,10 +2213,17 @@
                                                 }
                                             }
                                             // call the converter utility  to convert and set the array
+                                            <xsl:choose>
+                                                <xsl:when test="$basePropertyType='java.lang.String'">
+                                                    object.set<xsl:value-of select="$javaName"/>((<xsl:value-of select="$propertyType"/>)
+                                                        <xsl:value-of select="$listName"/>.toArray(new <xsl:value-of select="$basePropertyType"/>[<xsl:value-of select="$listName"/>.size()]));
+                                                </xsl:when>
+                                                <xsl:otherwise>
                                             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"/>));
+                                                            <xsl:value-of select="$basePropertyType"/>.class,<xsl:value-of select="$listName"/>));
+                                                </xsl:otherwise>
+                                            </xsl:choose>
                                         </xsl:otherwise>
                                         </xsl:choose>
                                         </xsl:otherwise>
@@ -3169,10 +3214,18 @@
                                                 }
                                             }
                                             // call the converter utility  to convert and set the array
+                                            <xsl:choose>
+                                                <xsl:when test="$basePropertyType='java.lang.String'">
+                                                    object.set<xsl:value-of select="$javaName"/>(<xsl:value-of select="$listName"/>);
+
+                                                </xsl:when>
+                                                <xsl:otherwise>
                                             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"/>));
+                                                            <xsl:value-of select="$basePropertyType"/>.class,<xsl:value-of select="$listName"/>));
+
+                                                </xsl:otherwise>
+                                            </xsl:choose>
                                         </xsl:when>
 
                                         <!--Let's handle xs:any here-->
@@ -3209,9 +3262,18 @@
 
                                              }
 
+                                            <xsl:choose>
+                                                <xsl:when test="$basePropertyType='java.lang.String'">
+                                                    object.set<xsl:value-of select="$javaName"/>(<xsl:value-of select="$listName"/>);
+
+                                                </xsl:when>
+                                                <xsl:otherwise>
                                              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"/>));
+
+                                                </xsl:otherwise>
+                                            </xsl:choose>
                                         </xsl:when>
 
 
@@ -3258,10 +3320,19 @@
 
                                              }
 
+                                            <xsl:choose>
+                                                <xsl:when test="$basePropertyType='java.lang.String'">
+                                                    object.set<xsl:value-of select="$javaName"/>(<xsl:value-of select="$listName"/>);
+
+                                                </xsl:when>
+                                                <xsl:otherwise>
                                              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"/>));
 
+                                                </xsl:otherwise>
+                                            </xsl:choose>
+
                                         </xsl:when>
                                         <!-- End of Array handling of default class - that is the OMElement -->
                                         <xsl:otherwise>
@@ -3290,10 +3361,18 @@
                                                 }
                                             }
                                             // call the converter utility  to convert and set the array
+                                            <xsl:choose>
+                                                <xsl:when test="$basePropertyType='java.lang.String'">
+                                                    object.set<xsl:value-of select="$javaName"/>(<xsl:value-of select="$listName"/>);
+
+                                                </xsl:when>
+                                                <xsl:otherwise>
                                             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"/>));
+                                                            <xsl:value-of select="$basePropertyType"/>.class,<xsl:value-of select="$listName"/>));
+
+                                                </xsl:otherwise>
+                                            </xsl:choose>
                                         </xsl:otherwise>
                                     </xsl:choose>
 



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