axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r448796 - in /webservices/axis2/trunk/java/modules: adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
Date Fri, 22 Sep 2006 04:10:16 GMT
Author: deepal
Date: Thu Sep 21 21:10:16 2006
New Revision: 448796

URL: http://svn.apache.org/viewvc?view=rev&rev=448796
Log:
completed Qaname handling :)

EchoQName is working properly .

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

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=448796&r1=448795&r2=448796
==============================================================================
--- 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
Thu Sep 21 21:10:16 2006
@@ -1344,6 +1344,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="propertyTypeName">javax.xml.namespace.QName</xsl:variable>
 
                             <xsl:variable name="propQName">new javax.xml.namespace.QName("<xsl:value-of
select="$namespace"/>","<xsl:value-of select="$propertyName"/>")</xsl:variable>
 
@@ -1563,8 +1564,21 @@
                                 <xsl:otherwise>
                                     java.lang.String content = reader.getElementText();
                                     <xsl:if test="not(enumFacet)">
-                                    object.set<xsl:value-of select="$javaName"/>(
+                                        <xsl:if test="$propertyTypeName=$propertyType">
+                                            int index = content.indexOf(":");
+                                            java.lang.String prefix ="";
+                                            java.lang.String namespaceuri ="";
+                                            if(index >0){
+                                                 prefix = content.substring(0,index);
+                                                 namespaceuri = reader.getNamespaceURI(prefix);
+                                             }
+                                             object.set<xsl:value-of select="$javaName"/>(
+                                                  org.apache.axis2.databinding.utils.ConverterUtil.convertToQName(content,namespaceuri));
+                                         </xsl:if>
+                                         <xsl:if test="not($propertyTypeName=$propertyType)">
+                                              object.set<xsl:value-of select="$javaName"/>(
                                         org.apache.axis2.databinding.utils.ConverterUtil.convertTo<xsl:value-of
select="$shortTypeName"/>(content));
+                                         </xsl:if>
                                     </xsl:if>
                                     <xsl:if test="(enumFacet)">
                                     object = <xsl:value-of select="$name"/>.fromString(content);
@@ -2329,6 +2343,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="propertyTypeName">javax.xml.namespace.QName</xsl:variable>
 
                             <xsl:variable name="propQName">new javax.xml.namespace.QName("<xsl:value-of
select="$namespace"/>","<xsl:value-of select="$propertyName"/>")</xsl:variable>
 
@@ -2543,8 +2558,21 @@
                                 <!-- start of the simple types handling -->
                                 <xsl:otherwise>
                                     java.lang.String content = reader.getElementText();
-                                    object.set<xsl:value-of select="$javaName"/>(
+                                    <xsl:if test="$propertyTypeName=$propertyType">
+                                            int index = content.indexOf(":");
+                                            java.lang.String prefix ="";
+                                            java.lang.String namespaceuri ="";
+                                            if(index >0){
+                                                 prefix = content.substring(0,index);
+                                                 namespaceuri = reader.getNamespaceURI(prefix);
+                                             }
+                                             object.set<xsl:value-of select="$javaName"/>(
+                                                  org.apache.axis2.databinding.utils.ConverterUtil.convertToQName(content,namespaceuri));
+                                         </xsl:if>
+                                         <xsl:if test="not($propertyTypeName=$propertyType)">
+                                              object.set<xsl:value-of select="$javaName"/>(
                                         org.apache.axis2.databinding.utils.ConverterUtil.convertTo<xsl:value-of
select="$shortTypeName"/>(content));
+                                          </xsl:if>
                                     <xsl:if test="$isType or $anon">  <!-- This
is a subelement property to be consumed -->
                                         reader.next();
                                     </xsl:if>

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java?view=diff&rev=448796&r1=448795&r2=448796
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
Thu Sep 21 21:10:16 2006
@@ -600,13 +600,13 @@
      * @param source
      * @return Returns QName.
      */
-    public static QName convertToQName(String source) {
+    public static QName convertToQName(String source, String nameSpaceuri) {
         source = source.trim();
         int colon = source.lastIndexOf(":");
-        String namespace = colon < 0 ? "" : "";// todo Fix this. Need to take a namespace
with this
         //context.getNamespaceURI(source.substring(0, colon));
         String localPart = colon < 0 ? source : source.substring(colon + 1);
-        return new QName(namespace, localPart);
+        String perfix =    colon <= 0 ? "" : source.substring(0,colon);
+        return new QName(nameSpaceuri, localPart,perfix);
     }
 
     /* ################################################################# */



---------------------------------------------------------------------
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