You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by am...@apache.org on 2010/12/25 09:49:02 UTC

svn commit: r1052758 - /axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java

Author: amilas
Date: Sat Dec 25 08:49:02 2010
New Revision: 1052758

URL: http://svn.apache.org/viewvc?rev=1052758&view=rev
Log:
fixed the issue AXIS2-3994

Modified:
    axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java

Modified: axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java?rev=1052758&r1=1052757&r2=1052758&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java (original)
+++ axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java Sat Dec 25 08:49:02 2010
@@ -781,6 +781,29 @@ public class SchemaCompiler {
                         javaClassName);
                 xsElt.addMetaInfo(SchemaConstants.SchemaCompilerInfoHolder.CLASSNAME_KEY,
                         javaClassName);
+            } else if (referencedElement.getSchemaTypeName() != null){
+                QName schemaTypeName = referencedElement.getSchemaTypeName();
+                XmlSchema newResolvedSchema = getParentSchema(resolvedSchema, schemaTypeName, COMPONENT_TYPE);
+                XmlSchemaType xmlSchemaType = newResolvedSchema.getTypeByName(schemaTypeName);
+                if (xmlSchemaType != null) {
+                    if (!this.processedElementRefMap.containsKey(referencedElement.getQName())) {
+                        // we know this is a named complex type
+                        processSchema(referencedElement, xmlSchemaType, newResolvedSchema, false);
+                        // if this is an anonomous complex type we have to set this
+                        this.processedElementRefMap.put(referencedElement.getQName(),
+                                this.processedTypemap.get(schemaTypeName));
+
+                    }
+
+                    String javaClassName = this.processedTypemap.get(referencedElement.getSchemaTypeName());
+                    referencedElement.addMetaInfo(SchemaConstants.SchemaCompilerInfoHolder.CLASSNAME_KEY,
+                            javaClassName);
+                    xsElt.addMetaInfo(SchemaConstants.SchemaCompilerInfoHolder.CLASSNAME_KEY,
+                            javaClassName);
+                } else {
+                    throw new SchemaCompilationException(" Can not find the schema type with name " + schemaTypeName);
+                }
+
             }
 
             // schema type name is present but not the schema type object