geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r436867 - in /geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator: Utils.java XsdGenerator.java
Date Fri, 25 Aug 2006 17:31:58 GMT
Author: gnodet
Date: Fri Aug 25 10:31:58 2006
New Revision: 436867

URL: http://svn.apache.org/viewvc?rev=436867&view=rev
Log:
XBEAN-48: When using an array of a know type, the generated xsd does not reference the generate

Modified:
    geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/Utils.java
    geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/XsdGenerator.java

Modified: geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/Utils.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/Utils.java?rev=436867&r1=436866&r2=436867&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/Utils.java
(original)
+++ geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/Utils.java
Fri Aug 25 10:31:58 2006
@@ -128,7 +128,10 @@
         String nestedTypeName = type.getName();
         for (Iterator iter = namespaceMapping.getElements().iterator(); iter.hasNext();)
{
             ElementMapping element = (ElementMapping) iter.next();
-            if (nestedTypeName.equals(element.getClassName())) {
+            if (element.getClassName().equals(nestedTypeName) ||
+                element.getInterfaces().contains(nestedTypeName) ||
+                element.getSuperClasses().contains(nestedTypeName)) 
+            {
                 elements.add(element);
             }
         }

Modified: geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/XsdGenerator.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/XsdGenerator.java?rev=436867&r1=436866&r2=436867&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/XsdGenerator.java
(original)
+++ geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/XsdGenerator.java
Fri Aug 25 10:31:58 2006
@@ -22,7 +22,6 @@
 import java.io.PrintWriter;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Collections;
 
 /**
  * @author Dain Sundstrom
@@ -177,7 +176,6 @@
         } else {
             types = Utils.findImplementationsOf(namespaceMapping, type);
         }
-        types = Collections.EMPTY_LIST;
         String maxOccurs = type.isCollection() ? "unbounded" : "1";
 
         out.println("        <xs:element name='" + attributeMapping.getAttributeName()
+ "' minOccurs='0' maxOccurs='1'>");
@@ -197,6 +195,7 @@
                 ElementMapping element = (ElementMapping) iterator.next();
                 out.println("              <xs:element ref='tns:" + element.getElementName()
+ "'/>");
             }
+            out.println("              <xs:any/>");
             out.println("            </xs:choice>");
         }
         out.println("          </xs:complexType>");



Mime
View raw message