You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2006/09/01 04:31:23 UTC

svn commit: r439140 - in /webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema: CompilerOptions.java ExtensionUtility.java SchemaCompiler.java

Author: dims
Date: Thu Aug 31 19:31:23 2006
New Revision: 439140

URL: http://svn.apache.org/viewvc?rev=439140&view=rev
Log:
implement generate-all option for ADB basically to pump out any types/simpletypes that are in the schema but not referenced by an element

Modified:
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/CompilerOptions.java
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/CompilerOptions.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/CompilerOptions.java?rev=439140&r1=439139&r2=439140&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/CompilerOptions.java (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/CompilerOptions.java Thu Aug 31 19:31:23 2006
@@ -40,6 +40,8 @@
      */
     private File outputLocation;
     private String packageName = null;
+    private boolean generateAll = false;
+
     /**
      * Package for the mapper
      */
@@ -146,6 +148,12 @@
         Matcher m = pat.matcher(wordToMatch);
         return m.matches();
     }
-
     
+    public boolean isGenerateAll() {
+        return generateAll;
+    }
+
+    public void setGenerateAll(boolean generateAll) {
+        this.generateAll = generateAll;
+    }
 }

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java?rev=439140&r1=439139&r2=439140&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java Thu Aug 31 19:31:23 2006
@@ -344,6 +344,10 @@
             //output
             options.setWriteOutput(!configuration.isPackClasses());
         }
+        
+        if(configuration.isGenerateAll()) {
+            options.setGenerateAll(true);
+        }
     }
 
 }

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=439140&r1=439139&r2=439140&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 Thu Aug 31 19:31:23 2006
@@ -321,6 +321,28 @@
             //this is the set of outer elements so we need to generate classes
             writeElement((XmlSchemaElement) xmlSchemaElement2Iterator.next());
         }
+        
+        if(options.isGenerateAll()) {
+            Iterator xmlSchemaTypes2Iterator = schema.getSchemaTypes().getValues();
+            while (xmlSchemaTypes2Iterator.hasNext()) {
+                XmlSchemaType schemaType = (XmlSchemaType) xmlSchemaTypes2Iterator.next();
+                if(this.isAlreadyProcessed(schemaType.getQName())) {
+                    continue;
+                }
+                if (schemaType instanceof XmlSchemaComplexType) {
+                    //write classes for complex types
+                    XmlSchemaComplexType complexType = (XmlSchemaComplexType) schemaType;
+                    if (complexType.getName() != null) {
+                        processNamedComplexSchemaType(complexType, schema);
+                    }
+                } else if (schemaType instanceof XmlSchemaSimpleType) {
+                    //process simple type
+                    processSimpleSchemaType((XmlSchemaSimpleType) schemaType,
+                            null,
+                            schema);
+                }
+            }
+        }
 
         if (!isPartofGroup){
             //complete the compilation



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