axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r602868 - /webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
Date Mon, 10 Dec 2007 11:38:33 GMT
Author: amilas
Date: Mon Dec 10 03:38:32 2007
New Revision: 602868

URL: http://svn.apache.org/viewvc?rev=602868&view=rev
Log:
set the schema type correctly if an referenced element have a simple type

Modified:
    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/SchemaCompiler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java?rev=602868&r1=602867&r2=602868&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
Mon Dec 10 03:38:32 2007
@@ -647,16 +647,32 @@
             // here what we want is to set the schema type name for the element
             if (referencedElement.getSchemaType() != null) {
                 if (!this.processedElementRefMap.containsKey(referencedElement.getQName())){
-                    processSchema(referencedElement, referencedElement.getSchemaType(), resolvedSchema,
true);
-                    // if this is an anonomous complex type we have to set this
-                    this.processedElementRefMap.put(referencedElement.getQName(),
-                            this.processedTypemap.get(referencedElement.getSchemaTypeName()));
+                    if ((referencedElement.getSchemaTypeName() != null)
+                            && this.baseSchemaTypeMap.containsKey(referencedElement.getSchemaTypeName())){
+                       // this element refers to an defined xml schema type
+                       this.processedElementRefMap.put(referencedElement.getQName(),
+                                this.baseSchemaTypeMap.get(referencedElement.getSchemaTypeName()));
+                    } else {
+                        processSchema(referencedElement, referencedElement.getSchemaType(),
resolvedSchema, true);
+                        // if this is an anonomous complex type we have to set this
+                        this.processedElementRefMap.put(referencedElement.getQName(),
+                                this.processedTypemap.get(referencedElement.getSchemaTypeName()));
+                    }
+
                 }
-                String javaClassName = (String) this.processedTypemap.get(referencedElement.getSchemaTypeName());
-                referencedElement.addMetaInfo(SchemaConstants.SchemaCompilerInfoHolder.CLASSNAME_KEY,
-                        javaClassName);
-                xsElt.addMetaInfo(SchemaConstants.SchemaCompilerInfoHolder.CLASSNAME_KEY,
-                        javaClassName);
+                String javaClassName;
+                if ((referencedElement.getSchemaTypeName() != null)
+                        && this.baseSchemaTypeMap.containsKey(referencedElement.getSchemaTypeName()))
{
+                    // here we have to do nothing since we do not generate a name
+                } else {
+                    javaClassName = (String) this.processedTypemap.get(referencedElement.getSchemaTypeName());
+                    referencedElement.addMetaInfo(SchemaConstants.SchemaCompilerInfoHolder.CLASSNAME_KEY,
+                            javaClassName);
+                    xsElt.addMetaInfo(SchemaConstants.SchemaCompilerInfoHolder.CLASSNAME_KEY,
+                            javaClassName);
+                }
+
+
             }
 
             // schema type name is present but not the schema type object



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


Mime
View raw message