geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r468218 - in /geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator: DocumentationGenerator.java NamespaceMapping.java WikiDocumentationGenerator.java XsdGenerator.java
Date Fri, 27 Oct 2006 01:03:47 GMT
Author: dblevins
Date: Thu Oct 26 18:03:47 2006
New Revision: 468218

URL: http://svn.apache.org/viewvc?view=rev&rev=468218
Log:
Moved the isSimpleType check to NamespaceMapping so you don't get so many "Warning, could
not load class:"  output lines.  Still to many for my taste (more than one per class is too
much), but this is better.

Modified:
    geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/DocumentationGenerator.java
    geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/NamespaceMapping.java
    geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/WikiDocumentationGenerator.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/DocumentationGenerator.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/DocumentationGenerator.java?view=diff&rev=468218&r1=468217&r2=468218
==============================================================================
--- geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/DocumentationGenerator.java
(original)
+++ geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/DocumentationGenerator.java
Thu Oct 26 18:03:47 2006
@@ -124,7 +124,7 @@
         for (Iterator iterator = element.getAttributes().iterator(); iterator.hasNext() &&
(!hasAttributes || !hasElements);) {
             AttributeMapping attributeMapping = (AttributeMapping) iterator.next();
             Type type = attributeMapping.getType();
-            if (Utils.isSimpleType(type)) {
+            if (namespaceMapping.isSimpleType(type)) {
                 hasAttributes = true;
             } else {
                 hasElements = true;
@@ -137,7 +137,7 @@
             for (Iterator iterator = element.getAttributes().iterator(); iterator.hasNext();)
{
                 AttributeMapping attributeMapping = (AttributeMapping) iterator.next();
                 Type type = attributeMapping.getType();
-                if (Utils.isSimpleType(type)) {
+                if (namespaceMapping.isSimpleType(type)) {
                     out.println("  <tr><td>" + attributeMapping.getAttributeName()
+ "</td><td>" + Utils.getXsdType(type)
                             + "</td><td>" + attributeMapping.getDescription()
+ "</td></tr>");
                 }
@@ -152,7 +152,7 @@
             for (Iterator iterator = element.getAttributes().iterator(); iterator.hasNext();)
{
                 AttributeMapping attributeMapping = (AttributeMapping) iterator.next();
                 Type type = attributeMapping.getType();
-                if (!Utils.isSimpleType(type)) {
+                if (!namespaceMapping.isSimpleType(type)) {
                     out.print("  <tr><td>" + attributeMapping.getAttributeName()
+ "</td><td>");
                     printComplexPropertyTypeDocumentation(out, namespaceMapping, type);
                     out.println("</td><td>" + attributeMapping.getDescription()
+ "</td></tr>");

Modified: geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/NamespaceMapping.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/NamespaceMapping.java?view=diff&rev=468218&r1=468217&r2=468218
==============================================================================
--- geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/NamespaceMapping.java
(original)
+++ geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/NamespaceMapping.java
Thu Oct 26 18:03:47 2006
@@ -77,4 +77,15 @@
     public int compareTo(Object obj) {
         return namespace.compareTo(((NamespaceMapping) obj).namespace);
     }
+
+    private final HashMap checkedTypes = new HashMap();
+
+    public boolean isSimpleType(Type type) {
+        Boolean b = (Boolean) checkedTypes.get(type);
+        if (b == null){
+            b = Utils.isSimpleType(type)? Boolean.TRUE: Boolean.FALSE;
+            checkedTypes.put(type, b);
+        }
+        return b.booleanValue();
+    }
 }

Modified: geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/WikiDocumentationGenerator.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/WikiDocumentationGenerator.java?view=diff&rev=468218&r1=468217&r2=468218
==============================================================================
--- geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/WikiDocumentationGenerator.java
(original)
+++ geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/WikiDocumentationGenerator.java
Thu Oct 26 18:03:47 2006
@@ -53,7 +53,6 @@
     }
 
     private void generateDocumentation(PrintWriter out, NamespaceMapping namespaceMapping)
{
-    	
         HashMap refercencedTypes = new HashMap();
     	
         // Build of map of types that are referenced by element types. 
@@ -63,7 +62,7 @@
                 AttributeMapping attribute = (AttributeMapping) iterator.next();
                 Type type = getNestedType( attribute.getType() );
 				
-                if( Utils.isSimpleType( type) ) 
+                if( namespaceMapping.isSimpleType( type) )
                     continue;
 				
                 if( !refercencedTypes.containsKey(type.getName()) )

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?view=diff&rev=468218&r1=468217&r2=468218
==============================================================================
--- 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
Thu Oct 26 18:03:47 2006
@@ -87,7 +87,7 @@
         int complexCount = 0;
         for (Iterator iterator = element.getAttributes().iterator(); iterator.hasNext();)
{
             AttributeMapping attributeMapping = (AttributeMapping) iterator.next();
-            if (!Utils.isSimpleType(attributeMapping.getType())) {
+            if (!namespaceMapping.isSimpleType(attributeMapping.getType())) {
                 complexCount++;
             }
         }
@@ -95,7 +95,7 @@
             out.println("      <xs:sequence>");
             for (Iterator iterator = element.getAttributes().iterator(); iterator.hasNext();)
{
                 AttributeMapping attributeMapping = (AttributeMapping) iterator.next();
-                if (!Utils.isSimpleType(attributeMapping.getType())) {
+                if (!namespaceMapping.isSimpleType(attributeMapping.getType())) {
                     generateElementMappingComplexProperty(out, namespaceMapping, attributeMapping);
                 }
             }
@@ -104,7 +104,7 @@
 
         for (Iterator iterator = element.getAttributes().iterator(); iterator.hasNext();)
{
             AttributeMapping attributeMapping = (AttributeMapping) iterator.next();
-            if (Utils.isSimpleType(attributeMapping.getType())) {
+            if (namespaceMapping.isSimpleType(attributeMapping.getType())) {
                 generateElementMappingSimpleProperty(out, attributeMapping);
             } else if (!attributeMapping.getType().isCollection()) {
                 generateElementMappingComplexPropertyAsRef(out, attributeMapping);



Mime
View raw message