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 am...@apache.org on 2007/09/05 11:33:50 UTC

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

Author: amilas
Date: Wed Sep  5 02:33:49 2007
New Revision: 572926

URL: http://svn.apache.org/viewvc?rev=572926&view=rev
Log:
remove the unused innerchoice functionalities. this feature is supported by the inner particles features.

Modified:
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
    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/SchemaCompiler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java?rev=572926&r1=572925&r2=572926&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java Wed Sep  5 02:33:49 2007
@@ -1991,34 +1991,6 @@
                 } else {
                     throw new SchemaCompilationException("Referenced name is null");
                 }
-
-            } else if (order && (item instanceof XmlSchemaChoice)) {
-
-                // this is a tempory patch for process only inner sequence choices
-                // but we have do this with a proper design
-                XmlSchemaChoice choice = (XmlSchemaChoice) item;
-                XmlSchemaObject choiceChild;
-                XmlSchemaObjectCollection schemaItems = choice.getItems();
-                for (int j = 0; j < schemaItems.getCount(); j++) {
-                   choiceChild = schemaItems.getItem(j);
-                   if (choiceChild instanceof XmlSchemaElement){
-                       // i.e this is an inner choice element
-                       //recursively process the element
-                        XmlSchemaElement xsElt = (XmlSchemaElement) choiceChild;
-
-                        boolean isArray = isArray(xsElt);
-                        processElement(xsElt, processedElementTypeMap, localNillableList, parentSchema); //we know for sure this is not an outer type
-                        processedElementArrayStatusMap.put(xsElt, (isArray) ? Boolean.TRUE : Boolean.FALSE);
-                        if (order) {
-                            //we need to keep the order of the elements. So push the elements to another
-                            //hashmap with the order number
-                            elementOrderMap.put(xsElt, new Integer(sequenceCounter));
-                            sequenceCounter++;
-                        }
-                       innerChoiceElementList.add(xsElt.getQName());
-                   }
-                }
-
             } else {
                 //there may be other types to be handled here. Add them
                 //when we are ready

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?rev=572926&r1=572925&r2=572926&view=diff
==============================================================================
--- 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 Wed Sep  5 02:33:49 2007
@@ -112,13 +112,13 @@
             return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
         }
 
-        <xsl:if test="$choice or (count(property[@innerchoice='yes']) > 0)">
+        <xsl:if test="$choice">
             /** Whenever a new property is set ensure all others are unset
              *  There can be only one choice and the last one wins
              */
             private void clearAllSettingTrackers() {
             <xsl:for-each select="property">
-                <xsl:if test="$choice or (@innerchoice='yes')">
+                <xsl:if test="$choice">
                    local<xsl:value-of select="@javaname"/>Tracker = false;
                 </xsl:if>
            </xsl:for-each>
@@ -213,10 +213,10 @@
                          <!-- call the validator-->
                                 validate<xsl:value-of select="$javaName"/>(param);
 
-                         <xsl:if test="$choice or (@innerchoice='yes')">
+                         <xsl:if test="$choice">
                               clearAllSettingTrackers();
                          </xsl:if>
-                         <xsl:if test="$min=0 or $choice or (@innerchoice='yes')">
+                         <xsl:if test="$min=0 or $choice">
                             <!-- the updating of setting tracker for null values should
                                  happen if the attribute is marked as nillable. Else
                                  the user can set a null value and it is never marked
@@ -331,7 +331,7 @@
                         <xsl:if test="not(enumFacet)">
                         <!-- Generate a tracker only if the min occurs is zero, which means if the user does
                            not bother to set that value, we do not send it -->
-                           <xsl:if test="$min=0 or $choice or (@innerchoice='yes')">
+                           <xsl:if test="$min=0 or $choice">
                            /*  This tracker boolean wil be used to detect whether the user called the set method
                           *   for this attribute. It will be used to determine whether to include this field
                            *   in the serialized XML
@@ -379,10 +379,10 @@
                               <!-- call the validator-->
                                    validate<xsl:value-of select="$javaName"/>(param);
 
-                               <xsl:if test="$choice or (@innerchoice='yes')">
+                               <xsl:if test="$choice">
                                    clearAllSettingTrackers();
                                </xsl:if>
-                               <xsl:if test="$min=0 or $choice or (@innerchoice='yes')">
+                               <xsl:if test="$min=0 or $choice">
                                    <!-- the updating of setting tracker for null values should
                                      happen if the attribute is marked as nillable. Else
                                      the user can set a null value and it is never marked
@@ -433,10 +433,10 @@
                                    <xsl:value-of select="$varName"/> = new <xsl:value-of select="$propertyType"/>{};
                                    }
 
-                            <xsl:if test="$choice or (@innerchoice='yes')">
+                            <xsl:if test="$choice">
                                    clearAllSettingTrackers();
                             </xsl:if>
-                            <xsl:if test="$min=0 or $choice or (@innerchoice='yes')">
+                            <xsl:if test="$min=0 or $choice">
                                  //update the setting tracker
                                 <xsl:value-of select="$settingTracker"/> = true;
                             </xsl:if>
@@ -460,10 +460,10 @@
                                * @param param <xsl:value-of select="$javaName"/>
                                */
                                public void set<xsl:value-of select="$javaName"/>(<xsl:value-of select="$propertyType"/> param){
-                            <xsl:if test="$choice or (@innerchoice='yes')">
+                            <xsl:if test="$choice">
                                 clearAllSettingTrackers();
                             </xsl:if>
-                            <xsl:if test="$min=0 or $choice or (@innerchoice='yes')">
+                            <xsl:if test="$min=0 or $choice">
                                 <xsl:choose>
                                    <xsl:when test="@primitive and not(@array)">
                                        // setting primitive attribute tracker to true
@@ -983,7 +983,7 @@
                     <xsl:variable name="propertyBaseType"><xsl:value-of select="@arrayBaseType"/></xsl:variable>
                     <xsl:variable name="particleClassType" select="@particleClassType"></xsl:variable>
 
-                    <xsl:if test="$min=0 or $choice or (@innerchoice='yes')"> if (<xsl:value-of select="$settingTracker"/>){</xsl:if>
+                    <xsl:if test="$min=0 or $choice"> if (<xsl:value-of select="$settingTracker"/>){</xsl:if>
                     <xsl:choose>
                         <xsl:when test="@ours and not(@array) and not(@default)">
                             <xsl:choose>
@@ -1575,7 +1575,7 @@
                              </xsl:if>
                         </xsl:otherwise>
                     </xsl:choose>
-                    <xsl:if test="$min=0 or $choice or (@innerchoice='yes')">}</xsl:if>
+                    <xsl:if test="$min=0 or $choice">}</xsl:if>
 
                 </xsl:for-each>
                    <!-- write the end element for the type-->
@@ -3370,7 +3370,7 @@
                                     }
                                 </xsl:if>
                             </xsl:if>
-                            <xsl:if test="$ordered and $min!=0 and not(@innerchoice='yes')">
+                            <xsl:if test="$ordered and $min!=0">
                                 else{
                                     // A start element we are not expecting indicates an invalid parameter was passed
                                     throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName());



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