axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r550787 - /webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
Date Tue, 26 Jun 2007 12:14:05 GMT
Author: amilas
Date: Tue Jun 26 05:14:04 2007
New Revision: 550787

URL: http://svn.apache.org/viewvc?view=rev&rev=550787
Log:
added the group reference support directly to the complex 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?view=diff&rev=550787&r1=550786&r2=550787
==============================================================================
--- 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
Tue Jun 26 05:14:04 2007
@@ -1838,6 +1838,38 @@
             }
 
 
+        } else if (particle instanceof XmlSchemaGroupRef){
+
+            XmlSchemaGroupRef xmlSchemaGroupRef = (XmlSchemaGroupRef) particle;
+            QName groupQName = xmlSchemaGroupRef.getRefName();
+            if (groupQName != null) {
+                if (!processedTypemap.containsKey(groupQName)) {
+                    // processe the schema here
+                    XmlSchema resolvedParentSchema = resolveParentSchema(groupQName, parentSchema);
+                    XmlSchemaGroup xmlSchemaGroup = getGroup(groupQName, resolvedParentSchema);
+                    if (xmlSchemaGroup != null) {
+                        processGroup(xmlSchemaGroup, groupQName, parentSchema);
+                    } else {
+                        throw new SchemaCompilationException("Refered Group " + groupQName.getLocalPart()
+ " can not be found ");
+                    }
+                }
+            } else {
+                throw new SchemaCompilationException("Referenced name is null");
+            }
+            boolean isArray = xmlSchemaGroupRef.getMaxOccurs() > 1;
+
+            // add this as an array to the original class
+            metainfHolder.registerMapping(groupQName, groupQName, findClassName(groupQName,
isArray));
+            if (isArray) {
+                metainfHolder.addtStatus(groupQName, SchemaConstants.ARRAY_TYPE);
+            }
+            metainfHolder.addtStatus(groupQName, SchemaConstants.PARTICLE_TYPE_ELEMENT);
+            metainfHolder.addMaxOccurs(groupQName, xmlSchemaGroupRef.getMaxOccurs());
+            metainfHolder.addMinOccurs(groupQName, xmlSchemaGroupRef.getMinOccurs());
+            metainfHolder.setHasParticleType(true);
+            metainfHolder.setOrdered(true);
+            metainfHolder.registerQNameIndex(groupQName,metainfHolder.getOrderStartPoint()
+ 1);
+
         }
     }
 



---------------------------------------------------------------------
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