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 aj...@apache.org on 2005/10/14 04:56:51 UTC

svn commit: r320982 - in /webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2: databinding/schema/SchemaCompiler.java wsdl/codegen/extension/SimpleDBExtension.java

Author: ajith
Date: Thu Oct 13 19:56:43 2005
New Revision: 320982

URL: http://svn.apache.org/viewcvs?rev=320982&view=rev
Log:
1. Removed some debugging code

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/schema/SchemaCompiler.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java

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=320982&r1=320981&r2=320982&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 Thu Oct 13 19:56:43 2005
@@ -106,7 +106,9 @@
         //The processing element logic seems to be quite simple. Look at the relevant schema type
         //for each and every element and process that accordingly.
         //this means that any unused type definitions would not be generated!
+
         XmlSchemaType schemaType = xsElt.getSchemaType();
+
         if (processedElementmap.containsKey(xsElt.getQName())){
             return;
         }
@@ -116,7 +118,7 @@
             processSchema(schemaType);
             qName = schemaType.getQName();
         }else{
-            //perhaps this has an anoynimous complex type!
+            //perhaps this has an anoynimous complex type! Handle it here
         }
 
 
@@ -129,7 +131,9 @@
         }else if (baseSchemaTypeMap.containsKey(qName)){
             className =  baseSchemaTypeMap.get(qName).toString();
         }else{
-            //throw an exception here
+           //this is a schema type we do not know. Or perhaps there's no schema type at all
+           //the right class to represent this is the java.lang.Object
+            className = Object.class.getName();
         }
 
         processedElementmap.put(xsElt.getQName(),className);
@@ -157,9 +161,6 @@
             return;
         }
 
-        //to start with we need to write a class to represent this
-        //
-
         XmlSchemaParticle particle =  complexType.getParticle();
         BeanWriterMetaInfoHolder metaInfHolder = new BeanWriterMetaInfoHolder();
         if (particle!=null){
@@ -171,9 +172,10 @@
 
         //write the class. This type mapping would have been populated right now
         String fullyQualifiedClassName = writer.write(complexType,processedTypemap,metaInfHolder);
+        //populate the type mapping with the elements
         processedTypemap.put(complexType.getQName(),fullyQualifiedClassName);
 
-        //populate the type mapping with the elements
+
 
     }
 

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java?rev=320982&r1=320981&r2=320982&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java Thu Oct 13 19:56:43 2005
@@ -69,7 +69,7 @@
                 String key;
                 while (keys.hasNext()) {
                     key = (String) keys.next();
-                    //schemaColl.mapNamespace(key,(String)nsMap.get(key));
+                    schemaColl.mapNamespace(key,(String)nsMap.get(key));
                 }
                 Schema schema;
 
@@ -79,35 +79,32 @@
                     //compile these schemas
                     while (!importedSchemaStack.isEmpty()) {
                         Element el = (Element)importedSchemaStack.pop();
-                        ////////////////////////////////////////////
-                        System.out.println("el = " + el);
-                        ///////////////////////////////////////////
                         XmlSchema thisSchema = schemaColl.read(el);
                         xmlSchemaTypeVector.add(thisSchema);
                     }
                 }
+            }
+            //call the schema compiler
+            CompilerOptions options = new CompilerOptions().setOutputLocation(configuration.getOutputLocation());
+            SchemaCompiler schemaCompiler = new SchemaCompiler(options);
+            schemaCompiler
+                    .compile(xmlSchemaTypeVector);
 
-                //call the schema compiler
-                CompilerOptions options = new CompilerOptions().setOutputLocation(configuration.getOutputLocation());
-                SchemaCompiler schemaCompiler = new SchemaCompiler(options);
-                schemaCompiler
-                        .compile(xmlSchemaTypeVector);
+            //create the type mapper
+            JavaTypeMapper mapper = new JavaTypeMapper();
+            //get the processed element map and transfer it to the type mapper
+            Map processedMap = schemaCompiler.getProcessedElementmap();
+            Iterator processedkeys = processedMap.keySet().iterator();
+            QName qNameKey;
+            while (processedkeys.hasNext()) {
+                qNameKey =(QName)processedkeys.next();
+                mapper.addTypeMapping(qNameKey,processedMap.get(qNameKey));
+            }
 
-                //create the type mapper
-                JavaTypeMapper mapper = new JavaTypeMapper();
-                //get the processed element map and transfer it to the type mapper
-                Map processedMap = schemaCompiler.getProcessedElementmap();
-                Iterator processedkeys = processedMap.keySet().iterator();
-                QName qNameKey;
-                while (processedkeys.hasNext()) {
-                   qNameKey =(QName)processedkeys.next();
-                   mapper.addTypeMapping(qNameKey,processedMap.get(qNameKey));
-                }
+            //set the type mapper to the config
+            configuration.setTypeMapper(mapper);
 
-                //set the type mapper to the config
-                configuration.setTypeMapper(mapper);
 
-            }
         } catch (Exception e) {
             throw new RuntimeException(e);
         }