axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r349940 - in /webservices/axis2/trunk/java/modules: codegen/src/org/apache/axis2/wsdl/template/java/ core/src/org/apache/axis2/client/
Date Wed, 30 Nov 2005 13:08:37 GMT
Author: chinthaka
Date: Wed Nov 30 05:08:15 2005
New Revision: 349940

URL: http://svn.apache.org/viewcvs?rev=349940&view=rev
Log:
Removing un-necessary AbstractCallbackSupporter and moving the two util methods found there
in to the templates itself.

Removed:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/AbstractCallbackSupporter.java
Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/ADBSupporterTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/XMLBeansSupporterTemplate.xsl

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/ADBSupporterTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/ADBSupporterTemplate.xsl?rev=349940&r1=349939&r2=349940&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/ADBSupporterTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/ADBSupporterTemplate.xsl
Wed Nov 30 05:08:15 2005
@@ -13,7 +13,13 @@
          *  <xsl:value-of select="@name"/> supporter class for Axis2's databinding
          */
 
-        public class <xsl:value-of select="@name"/> extends org.apache.axis2.client.AbstractCallbackSupporter{
+        import org.apache.axis2.om.OMElement;
+        import org.apache.axis2.om.OMNode;
+        import org.apache.axis2.om.OMText;
+        import javax.xml.namespace.QName;
+        import java.util.Iterator;
+
+        public class <xsl:value-of select="@name"/> {
         <xsl:variable name="base64"><xsl:value-of select="base64Elements/name"/></xsl:variable>
         <xsl:if test="$base64">
             private static javax.xml.namespace.QName[] qNameArray = {
@@ -87,6 +93,26 @@
             return null;
         }
 
+    protected static void optimizeContent(OMElement element, QName[] qNames){
+        for (int i = 0; i &lt; qNames.length; i++) {
+            markElementsAsOptimized(qNames[i],element);
+        }
+    }
+
+    private static void markElementsAsOptimized(QName qName,OMElement rootElt){
+        if (rootElt.getQName().equals(qName)){
+            //get the text node and mark it
+            OMNode node = rootElt.getFirstOMChild();
+            if (node.getType()==OMNode.TEXT_NODE){
+                ((OMText)node).setOptimize(true);
+            }
+
+        }
+        Iterator childElements = rootElt.getChildElements();
+        while (childElements.hasNext()) {
+            markElementsAsOptimized(qName,(OMElement)childElements.next());
+        }
+    }
   }
     </xsl:template>
 </xsl:stylesheet>

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/XMLBeansSupporterTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/XMLBeansSupporterTemplate.xsl?rev=349940&r1=349939&r2=349940&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/XMLBeansSupporterTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/XMLBeansSupporterTemplate.xsl
Wed Nov 30 05:08:15 2005
@@ -13,7 +13,13 @@
          *  <xsl:value-of select="@name"/> Supporter class for XML beans 
          */
 
-        public class <xsl:value-of select="@name"/> extends org.apache.axis2.client.AbstractCallbackSupporter{
+        import org.apache.axis2.om.OMElement;
+        import org.apache.axis2.om.OMNode;
+        import org.apache.axis2.om.OMText;
+        import javax.xml.namespace.QName;
+        import java.util.Iterator;
+
+        public class <xsl:value-of select="@name"/> {
         <xsl:variable name="base64"><xsl:value-of select="base64Elements/name"/></xsl:variable>
         <xsl:if test="$base64">
             private static javax.xml.namespace.QName[] qNameArray = {
@@ -79,6 +85,37 @@
         }
         return null;
         }
+
+        /**
+     *
+     * @param element
+     * @param qNames
+     */
+    protected static void optimizeContent(OMElement element, QName[] qNames){
+        for (int i = 0; i &lt; qNames.length; i++) {
+            markElementsAsOptimized(qNames[i],element);
+        }
+    }
+
+    /**
+     *
+     * @param qName
+     * @param rootElt
+     */
+    private static void markElementsAsOptimized(QName qName,OMElement rootElt){
+        if (rootElt.getQName().equals(qName)){
+            //get the text node and mark it
+            OMNode node = rootElt.getFirstOMChild();
+            if (node.getType()==OMNode.TEXT_NODE){
+                ((OMText)node).setOptimize(true);
+            }
+
+        }
+        Iterator childElements = rootElt.getChildElements();
+        while (childElements.hasNext()) {
+            markElementsAsOptimized(qName,(OMElement)childElements.next());
+        }
+    }
         }
     </xsl:template>
 



Mime
View raw message