axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r328581 - in /webservices/axis2/trunk/java/modules/codegen: other/ src/org/apache/axis2/databinding/schema/ src/org/apache/axis2/databinding/schema/template/ test/org/apache/axis2/databinding/schema/
Date Wed, 26 Oct 2005 07:41:29 GMT
Author: ajith
Date: Wed Oct 26 00:41:07 2005
New Revision: 328581

URL: http://svn.apache.org/viewcvs?rev=328581&view=rev
Log:
The earlier fix had a problem with anonymous complex types. Fixed that

Removed:
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/AbstractSchemaCompilerTester.java
Modified:
    webservices/axis2/trunk/java/modules/codegen/other/beanGenerationSchema.xsd
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/BeanWriterMetaInfoHolder.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/JavaBeanWriter.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/SchemaCompiler.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/template/BeanTemplate.xsl

Modified: webservices/axis2/trunk/java/modules/codegen/other/beanGenerationSchema.xsd
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/other/beanGenerationSchema.xsd?rev=328581&r1=328580&r2=328581&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/other/beanGenerationSchema.xsd (original)
+++ webservices/axis2/trunk/java/modules/codegen/other/beanGenerationSchema.xsd Wed Oct 26
00:41:07 2005
@@ -10,11 +10,13 @@
 				<xs:element name="property" type="propertyType" maxOccurs="unbounded"/>
 			</xs:sequence>
 			<xs:attribute name="name" type="xs:string" use="required"/>
+			<xs:attribute name="originalName" type="xs:string" use="required"/>
 			<xs:attribute name="package" type="xs:string" use="required"/>
 			<xs:attribute name="nsuri" type="xs:string" use="required"/>
 			<xs:attribute name="nsprefix" type="xs:string" use="required"/>
 			<xs:attribute name="type" type="xs:string" use="optional" fixed="yes"/>
 			<xs:attribute name="extension" type="xs:string" use="optional"/>
+			<xs:attribute name="anon" type="xs:string" use="optional" fixed="yes"/>
 		</xs:complexType>
 	</xs:element>
 	<xs:complexType name="propertyType">

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/BeanWriterMetaInfoHolder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/BeanWriterMetaInfoHolder.java?rev=328581&r1=328580&r2=328581&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/BeanWriterMetaInfoHolder.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/BeanWriterMetaInfoHolder.java
Wed Oct 26 00:41:07 2005
@@ -29,6 +29,7 @@
 
 
     private boolean ordered = false;
+    private boolean anonymous = false;
     private boolean extension = false;
     private String extensionClassName = "";
     private Map elementToSchemaQNameMap = new HashMap();
@@ -37,6 +38,14 @@
     private Map qNameMaxOccursCountMap = new HashMap();
     private Map qNameMinOccursCountMap = new HashMap();
     private Map qNameOrderMap = new HashMap();
+
+    public boolean isAnonymous() {
+        return anonymous;
+    }
+
+    public void setAnonymous(boolean anonymous) {
+        this.anonymous = anonymous;
+    }
 
     public String getExtensionClassName() {
         return extensionClassName;

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/JavaBeanWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/JavaBeanWriter.java?rev=328581&r1=328580&r2=328581&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/JavaBeanWriter.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/JavaBeanWriter.java
Wed Oct 26 00:41:07 2005
@@ -107,6 +107,10 @@
             XSLTUtils.addAttribute(model,"type","yes",rootElt);
         }
 
+        if (metainf.isAnonymous()){
+             XSLTUtils.addAttribute(model,"anon","yes",rootElt);
+        }
+
         if (metainf.isExtension()){
             XSLTUtils.addAttribute(model,"extension",metainf.getExtensionClassName(),rootElt);
         }
@@ -123,7 +127,6 @@
             Element property = XSLTUtils.addChildElement(model,"property",rootElt);
             name = qNames[i];
             String xmlName = name.getLocalPart();
-            System.out.println(xmlName);
             XSLTUtils.addAttribute(model,"name",xmlName,property);
 
             String javaName = "";

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/SchemaCompiler.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/SchemaCompiler.java?rev=328581&r1=328580&r2=328581&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/SchemaCompiler.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/SchemaCompiler.java
Wed Oct 26 00:41:07 2005
@@ -149,6 +149,7 @@
                 //intent of the user when he declares the complexType anonymously is to use
it privately
                 //First copy the schema types content into the metainf holder
                 metainf = (BeanWriterMetaInfoHolder)this.processedAnonymousComplexTypesMap.get(xsElt);
+                metainf.setAnonymous(true);
             }
             String writtenClassName = writer.write(xsElt,processedTypemap,metainf);
             processedElementMap.put(xsElt.getQName(),writtenClassName);

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/template/BeanTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/template/BeanTemplate.xsl?rev=328581&r1=328580&r2=328581&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/template/BeanTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/template/BeanTemplate.xsl
Wed Oct 26 00:41:07 2005
@@ -76,7 +76,7 @@
         */
         public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName){
         <xsl:choose>
-            <xsl:when test="@type">
+            <xsl:when test="@type|@anon">
                   Object[] elementList = new Object[]{
         <xsl:for-each select="property[not(@attribute)]">
             <xsl:variable name="propertyName"><xsl:value-of select="@name"/></xsl:variable>
@@ -114,6 +114,7 @@
          return org.apache.axis2.databinding.utils.ADBPullParser.createPullParser(qName,
elementList, attribList);
             </xsl:when>
             <xsl:otherwise>
+
             //We can safely assume an element has only one type associated with it
              <!-- This better be only one!!-->
             <xsl:for-each select="property[@ours]">
@@ -121,6 +122,7 @@
                 <xsl:variable name="varName">local<xsl:value-of select="@javaname"/></xsl:variable>
            return <xsl:value-of select="$varName"/>.getPullParser(MY_QNAME);
             </xsl:for-each>
+
             <!-- What do we do for the other case ???? -->
              <xsl:for-each select="property[not(@ours)]">
                 <xsl:variable name="propertyName"><xsl:value-of select="@name"/></xsl:variable>



Mime
View raw message