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 aj...@apache.org on 2006/05/30 11:33:16 UTC

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

Author: ajith
Date: Tue May 30 02:33:15 2006
New Revision: 410232

URL: http://svn.apache.org/viewvc?rev=410232&view=rev
Log:
1. Added direct base64Binary support to ADB. Now if the pull parser supports the special way of producing the data handler through the getProperty() method, ADB can populate the datahandler directly.

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/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl?rev=410232&r1=410231&r2=410232&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 Tue May 30 02:33:15 2006
@@ -509,6 +509,15 @@
 
                 </xsl:for-each>
 
+                boolean isReaderMTOMAware = false;
+                <!-- workaround for the issues in the wstx reader!-->
+                try{
+                  isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE));
+                }catch(java.lang.IllegalArgumentException e){
+                  isReaderMTOMAware = false;
+                }
+
+
                 <xsl:if test="$isType or $anon">
                     <!-- Skip the outer start element in order to process the subelements. -->
                     reader.next();
@@ -726,6 +735,26 @@
                                      </xsl:if>
                                 </xsl:when>
                                 <!-- end of OMelement handling -->
+                                <!-- start of the simple types handling for binary content-->
+                                <xsl:when test="@binary">
+                                    if (isReaderMTOMAware
+                                      &amp;&amp;
+                                    java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_BINARY))){
+                                         //MTOM aware reader - get the datahandler directly and put it in the object
+                                         object.set<xsl:value-of select="$javaName"/>(
+                                         (javax.activation.DataHandler)reader.getProperty(org.apache.axiom.om.OMConstants.DATA_HANDLER));
+                                     }else{
+                                        //Do the usual conversion
+                                        java.lang.String content = getElementTextProperly(reader);
+                                        object.set<xsl:value-of select="$javaName"/>(
+                                        org.apache.axis2.databinding.utils.ConverterUtil.convertTo<xsl:value-of select="$shortTypeName"/>(content));
+
+                                     }
+
+                                    <xsl:if test="$isType or $anon">  <!-- This is a subelement property to be consumed -->
+                                        reader.next();
+                                    </xsl:if>
+                                </xsl:when>
                                 <!-- start of the simple types handling -->
                                 <xsl:otherwise>
                                     java.lang.String content = getElementTextProperly(reader);



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