axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r534864 [1/3] - in /webservices/axis2/trunk/java/modules/adb-codegen: ./ src/org/apache/axis2/schema/ src/org/apache/axis2/schema/template/ src/org/apache/axis2/schema/writer/ test-resources/testsuite/ test/org/apache/axis2/schema/innerChoi...
Date Thu, 03 May 2007 13:56:34 GMT
Author: amilas
Date: Thu May  3 06:56:33 2007
New Revision: 534864

URL: http://svn.apache.org/viewvc?view=rev&rev=534864
Log:
Added the sequence/choice minOccurs/maxOccurs and innerparticals (i.e. sequence/choice) support

Added:
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/innerParticles.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/particalMaxOccures.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/innerparticles/
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/innerparticles/InnerParticlesTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/particalmaxoccurs/
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/particalmaxoccurs/ParticalMaxOccursTest.java
Modified:
    webservices/axis2/trunk/java/modules/adb-codegen/maven.xml
    webservices/axis2/trunk/java/modules/adb-codegen/pom.xml
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.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
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaConstants.java
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/BeanWriter.java
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/CStructWriter.java
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/innerChoice/InnerChoiceTest.java

Modified: webservices/axis2/trunk/java/modules/adb-codegen/maven.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/maven.xml?view=diff&rev=534864&r1=534863&r2=534864
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/maven.xml (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/maven.xml Thu May  3 06:56:33 2007
@@ -271,7 +271,28 @@
             <arg file="${testsuite.source.dir}/boolean.xsd"/>
             <arg file="${schema.generated.src.dir}"/>
         </java>
+        
+        <!-- ################################################################### -->
+        <!-- All simple derived types xsd -->
+        <ant:echo>Compiling particalMaxOccures.xsd</ant:echo>
+        <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+            <jvmarg line="${maven.junit.jvmargs}"/>
+            <classpath refid="maven.dependency.classpath"/>
+            <classpath location="${compiled.classes.dir}"/>
+            <arg file="${testsuite.source.dir}/particalMaxOccures.xsd"/>
+            <arg file="${schema.generated.src.dir}"/>
+        </java>
 
+        <!-- ################################################################### -->
+        <!-- All simple derived types xsd -->
+        <ant:echo>Compiling innerParticles.xsd</ant:echo>
+        <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+            <jvmarg line="${maven.junit.jvmargs}"/>
+            <classpath refid="maven.dependency.classpath"/>
+            <classpath location="${compiled.classes.dir}"/>
+            <arg file="${testsuite.source.dir}/innerParticles.xsd"/>
+            <arg file="${schema.generated.src.dir}"/>
+        </java>
 
         <!-- ################################################################### -->
         <!-- Compile the generated classes -->

Modified: webservices/axis2/trunk/java/modules/adb-codegen/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/pom.xml?view=diff&rev=534864&r1=534863&r2=534864
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/pom.xml (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/pom.xml Thu May  3 06:56:33 2007
@@ -15,355 +15,380 @@
  ! See the License for the specific language governing permissions and
  ! limitations under the License.
  !-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-	<parent>
-		<groupId>org.apache.axis2</groupId>
-		<artifactId>axis2-parent</artifactId>
-		<version>SNAPSHOT</version>
-		<relativePath>../parent/pom.xml</relativePath>
-	</parent>
-	<artifactId>axis2-adb-codegen</artifactId>
-	<name>Apache Axis 2.0 - ADB Codegen</name>
-	<description>ADB code generation support for Axis2</description>
-	<dependencies>
-		<dependency>
-			<groupId>org.apache.axis2</groupId>
-			<artifactId>axis2-adb</artifactId>
-			<version>${version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.axis2</groupId>
-			<artifactId>axis2-codegen</artifactId>
-			<version>${version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.axis2</groupId>
-			<artifactId>axis2-kernel</artifactId>
-			<version>${version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.ws.commons.schema</groupId>
-			<artifactId>XmlSchema</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>xmlunit</groupId>
-			<artifactId>xmlunit</artifactId>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>junit</groupId>
-			<artifactId>junit</artifactId>
-		</dependency>
-	</dependencies>
-	<build>
-		<sourceDirectory>src</sourceDirectory>
-		<testSourceDirectory>test</testSourceDirectory>
-		<resources>
-			<resource>
-				<directory>conf</directory>
-				<excludes>
-					<exclude>**/*.properties</exclude>
-				</excludes>
-				<filtering>false</filtering>
-			</resource>
-			<resource>
-				<directory>src</directory>
-				<excludes>
-					<exclude>**/*.java</exclude>
-				</excludes>
-			</resource>
-		</resources>
-		<plugins>
-			<plugin>
-				<artifactId>maven-surefire-plugin</artifactId>
-				<inherited>true</inherited>
-				<configuration>
-					<skip>false</skip>
-					<excludes>
-						<exclude>**/*Abstract*.java</exclude>
-						<exclude>**/*Util*.java</exclude>
-						<exclude>**/*PhaseResolvingTest.java</exclude>
-					</excludes>
-					<includes>
-						<include>**/*Test.java</include>
-					</includes>
-				</configuration>
-			</plugin>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-antrun-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>generate-test-sources</id>
-						<phase>generate-test-sources</phase>
-						<configuration>
-							<tasks>
-								<property name="compiled.classes.dir" location="target/classes"/>
-								<property name="test.compiled.classes.dir" location="target/test-classes"/>
-								<property name="schema.source.dir" location="test-resources/xsd"/>
-								<property name="testsuite.source.dir" location="test-resources/testsuite"/>
-								<property name="schema.output.base.dir" location="target/schema"/>
-								<property name="schema.generated.src.dir" location="${schema.output.base.dir}/src"/>
-								<property name="schema.generated.classes.dir" location="${schema.output.base.dir}/classes"/>
-								<property name="maven.junit.jvmargs" value=""/>
-								<!-- make the dirs -->
-								<mkdir dir="${schema.output.base.dir}"/>
-								<mkdir dir="${schema.generated.src.dir}"/>
-								<mkdir dir="${schema.generated.classes.dir}"/>
-								<mkdir dir="${test.compiled.classes.dir}"/>
-								<!-- Run schema compiler with designated schemas -->
-								<echo>Compiling simple_maxOccurs2.xsd</echo>
-								<!-- simple max occurs 2 xsd -->
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${schema.source.dir}/simple_maxOccurs2.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<echo>Compiling anonymous_complexType.xsd</echo>
-								<!-- anon complex type xsd -->
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${schema.source.dir}/anonymous_complexType.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- anon choice xsd -->
-								<echo>Compiling simple_choice.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${schema.source.dir}/simple_choice.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- anon particle all xsd -->
-								<echo>Compiling simple_particle_all.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${schema.source.dir}/simple_particle_all.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- simple max occurs xsd -->
-								<echo>Compiling simple_maxOccurs.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${schema.source.dir}/simple_maxOccurs.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- simple any type xsd -->
-								<echo>Compiling simple_anytype.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${schema.source.dir}/simple_anytype.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- min occurs 0 xsd -->
-								<echo>Compiling simple-minoccurs0.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${schema.source.dir}/simple-minoccurs0.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- complex min occurs 0 xsd -->
-								<echo>Compiling complex-minoccurs0.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${schema.source.dir}/complex-minoccurs0.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<echo>Compiling simple-recursive-datatypes.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${schema.source.dir}/simple-recursive-datatypes.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<echo>Compiling mixed_minoccus0.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${schema.source.dir}/mixed_minoccus0.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- ################################################################### -->
-								<!-- All simple primitive types xsd -->
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${schema.source.dir}/simple/simpleType-All.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- All simple derived types xsd -->
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${schema.source.dir}/derived/derivedType-All.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- ################################################################### -->
-								<!-- All simple derived types xsd -->
-								<echo>Compiling complete.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${testsuite.source.dir}/complete.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- ################################################################### -->
-								<!-- All simple derived types xsd -->
-								<echo>Compiling simpleExtension.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${testsuite.source.dir}/extensions.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- ################################################################### -->
-								<!-- All simple derived types xsd -->
-								<echo>Compiling union.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${testsuite.source.dir}/union.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- ################################################################### -->
-								<!-- All simple derived types xsd -->
-								<echo>Compiling all.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${testsuite.source.dir}/all.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- ################################################################### -->
-								<!-- All simple derived types xsd -->
-								<echo>Compiling enumeration.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${testsuite.source.dir}/enumeration.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- ################################################################### -->
-								<!-- All simple derived types xsd -->
-								<echo>Compiling restrictions.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${testsuite.source.dir}/restrictions.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- ################################################################### -->
-								<!-- All simple derived types xsd -->
-								<echo>Compiling choice.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${testsuite.source.dir}/choice.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- ################################################################### -->
-								<!-- All simple derived types xsd -->
-								<echo>Compiling list.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${testsuite.source.dir}/list.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- ################################################################### -->
-								<!-- All simple derived types xsd -->
-								<echo>Compiling element_references.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${testsuite.source.dir}/element_references.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- ################################################################### -->
-								<!-- All simple derived types xsd -->
-								<echo>Compiling innersequence_choice.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${testsuite.source.dir}/innersequence_choice.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- ################################################################### -->
-								<!-- All simple derived types xsd -->
-								<echo>Compiling testattribute.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${testsuite.source.dir}/testattribute.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-								<!-- ################################################################### -->
-								<!-- All simple derived types xsd -->
-								<echo>Compiling boolean.xsd</echo>
-								<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-									<jvmarg line="${maven.junit.jvmargs}"/>
-									<classpath refid="maven.runtime.classpath"/>
-									<classpath location="${compiled.classes.dir}"/>
-									<arg file="${testsuite.source.dir}/boolean.xsd"/>
-									<arg file="${schema.generated.src.dir}"/>
-								</java>
-							</tasks>
-						</configuration>
-						<goals>
-							<goal>run</goal>
-						</goals>
-					</execution>
-				</executions>
-			</plugin>
-			<plugin>
-				<groupId>org.codehaus.mojo</groupId>
-				<artifactId>build-helper-maven-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>add-test-source</id>
-						<phase>process-test-resources</phase>
-						<goals>
-							<goal>add-test-source</goal>
-						</goals>
-						<configuration>
-							<sources>
-								<source>${basedir}/target/schema/src</source>
-							</sources>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-		</plugins>
-	</build>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.axis2</groupId>
+        <artifactId>axis2-parent</artifactId>
+        <version>SNAPSHOT</version>
+        <relativePath>../parent/pom.xml</relativePath>
+    </parent>
+    <artifactId>axis2-adb-codegen</artifactId>
+    <name>Apache Axis 2.0 - ADB Codegen</name>
+    <description>ADB code generation support for Axis2</description>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-adb</artifactId>
+            <version>${version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-codegen</artifactId>
+            <version>${version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-kernel</artifactId>
+            <version>${version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.schema</groupId>
+            <artifactId>XmlSchema</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>xmlunit</groupId>
+            <artifactId>xmlunit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+    </dependencies>
+    <build>
+        <sourceDirectory>src</sourceDirectory>
+        <testSourceDirectory>test</testSourceDirectory>
+        <resources>
+            <resource>
+                <directory>conf</directory>
+                <excludes>
+                    <exclude>**/*.properties</exclude>
+                </excludes>
+                <filtering>false</filtering>
+            </resource>
+            <resource>
+                <directory>src</directory>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <inherited>true</inherited>
+                <configuration>
+                    <skip>false</skip>
+                    <excludes>
+                        <exclude>**/*Abstract*.java</exclude>
+                        <exclude>**/*Util*.java</exclude>
+                        <exclude>**/*PhaseResolvingTest.java</exclude>
+                    </excludes>
+                    <includes>
+                        <include>**/*Test.java</include>
+                    </includes>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>generate-test-sources</id>
+                        <phase>generate-test-sources</phase>
+                        <configuration>
+                            <tasks>
+                                <property name="compiled.classes.dir" location="target/classes"/>
+                                <property name="test.compiled.classes.dir" location="target/test-classes"/>
+                                <property name="schema.source.dir" location="test-resources/xsd"/>
+                                <property name="testsuite.source.dir" location="test-resources/testsuite"/>
+                                <property name="schema.output.base.dir" location="target/schema"/>
+                                <property name="schema.generated.src.dir" location="${schema.output.base.dir}/src"/>
+                                <property name="schema.generated.classes.dir"
+                                          location="${schema.output.base.dir}/classes"/>
+                                <property name="maven.junit.jvmargs" value=""/>
+                                <!-- make the dirs -->
+                                <mkdir dir="${schema.output.base.dir}"/>
+                                <mkdir dir="${schema.generated.src.dir}"/>
+                                <mkdir dir="${schema.generated.classes.dir}"/>
+                                <mkdir dir="${test.compiled.classes.dir}"/>
+                                <!-- Run schema compiler with designated schemas -->
+                                <echo>Compiling simple_maxOccurs2.xsd</echo>
+                                <!-- simple max occurs 2 xsd -->
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${schema.source.dir}/simple_maxOccurs2.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <echo>Compiling anonymous_complexType.xsd</echo>
+                                <!-- anon complex type xsd -->
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${schema.source.dir}/anonymous_complexType.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- anon choice xsd -->
+                                <echo>Compiling simple_choice.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${schema.source.dir}/simple_choice.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- anon particle all xsd -->
+                                <echo>Compiling simple_particle_all.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${schema.source.dir}/simple_particle_all.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- simple max occurs xsd -->
+                                <echo>Compiling simple_maxOccurs.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${schema.source.dir}/simple_maxOccurs.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- simple any type xsd -->
+                                <echo>Compiling simple_anytype.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${schema.source.dir}/simple_anytype.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- min occurs 0 xsd -->
+                                <echo>Compiling simple-minoccurs0.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${schema.source.dir}/simple-minoccurs0.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- complex min occurs 0 xsd -->
+                                <echo>Compiling complex-minoccurs0.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${schema.source.dir}/complex-minoccurs0.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <echo>Compiling simple-recursive-datatypes.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${schema.source.dir}/simple-recursive-datatypes.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <echo>Compiling mixed_minoccus0.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${schema.source.dir}/mixed_minoccus0.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- ################################################################### -->
+                                <!-- All simple primitive types xsd -->
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${schema.source.dir}/simple/simpleType-All.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- All simple derived types xsd -->
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${schema.source.dir}/derived/derivedType-All.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- ################################################################### -->
+                                <!-- All simple derived types xsd -->
+                                <echo>Compiling complete.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${testsuite.source.dir}/complete.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- ################################################################### -->
+                                <!-- All simple derived types xsd -->
+                                <echo>Compiling simpleExtension.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${testsuite.source.dir}/extensions.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- ################################################################### -->
+                                <!-- All simple derived types xsd -->
+                                <echo>Compiling union.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${testsuite.source.dir}/union.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- ################################################################### -->
+                                <!-- All simple derived types xsd -->
+                                <echo>Compiling all.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${testsuite.source.dir}/all.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- ################################################################### -->
+                                <!-- All simple derived types xsd -->
+                                <echo>Compiling enumeration.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${testsuite.source.dir}/enumeration.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- ################################################################### -->
+                                <!-- All simple derived types xsd -->
+                                <echo>Compiling restrictions.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${testsuite.source.dir}/restrictions.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- ################################################################### -->
+                                <!-- All simple derived types xsd -->
+                                <echo>Compiling choice.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${testsuite.source.dir}/choice.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- ################################################################### -->
+                                <!-- All simple derived types xsd -->
+                                <echo>Compiling list.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${testsuite.source.dir}/list.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- ################################################################### -->
+                                <!-- All simple derived types xsd -->
+                                <echo>Compiling element_references.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${testsuite.source.dir}/element_references.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- ################################################################### -->
+                                <!-- All simple derived types xsd -->
+                                <echo>Compiling innersequence_choice.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${testsuite.source.dir}/innersequence_choice.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- ################################################################### -->
+                                <!-- All simple derived types xsd -->
+                                <echo>Compiling testattribute.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${testsuite.source.dir}/testattribute.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+                                <!-- ################################################################### -->
+                                <!-- All simple derived types xsd -->
+                                <echo>Compiling boolean.xsd</echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${testsuite.source.dir}/boolean.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+
+                                <!-- ################################################################### -->
+                                <!-- All simple derived types xsd -->
+                                <ant:echo>Compiling particalMaxOccures.xsd</ant:echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.dependency.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${testsuite.source.dir}/particalMaxOccures.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+
+                                <!-- ################################################################### -->
+                                <!-- All simple derived types xsd -->
+                                <ant:echo>Compiling innerParticles.xsd</ant:echo>
+                                <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+                                    <jvmarg line="${maven.junit.jvmargs}"/>
+                                    <classpath refid="maven.dependency.classpath"/>
+                                    <classpath location="${compiled.classes.dir}"/>
+                                    <arg file="${testsuite.source.dir}/innerParticles.xsd"/>
+                                    <arg file="${schema.generated.src.dir}"/>
+                                </java>
+
+                            </tasks>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>add-test-source</id>
+                        <phase>process-test-resources</phase>
+                        <goals>
+                            <goal>add-test-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>${basedir}/target/schema/src</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java?view=diff&rev=534864&r1=534863&r2=534864
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java Thu May  3 06:56:33 2007
@@ -63,6 +63,10 @@
     protected boolean isUnion;
     protected boolean isList;
 
+    protected boolean isParticleClass;
+    // keep whether this class has a partical class type variable
+    protected boolean hasParticleType;
+
     protected List nillableQNameList = new ArrayList();
 
     //the parent metainfo holder, useful in handling extensions and
@@ -410,6 +414,18 @@
     }
 
     /**
+     *
+     * @param qName
+     * @return whether the attribute is a partical class or not
+     */
+
+    public boolean getParticleTypeStatusForQName(QName qName){
+        Integer state = (Integer) specialTypeFlagMap.get(qName);
+        return state != null && getStatus(state.intValue(),
+                SchemaConstants.PARTICLE_TYPE_ELEMENT);
+    }
+
+    /**
      * Gets whether a given QName has the any attribute status.
      *
      * @param qName
@@ -794,8 +810,6 @@
         this.memberTypes.put(qname,className);
     }
 
-
-
     public boolean isList() {
         return isList;
     }
@@ -820,5 +834,20 @@
         this.itemTypeClassName = itemTypeClassName;
     }
 
+    public boolean isParticleClass() {
+        return isParticleClass;
+    }
+
+    public void setParticleClass(boolean particleClass) {
+        isParticleClass = particleClass;
+    }
+
+    public boolean isHasParticleType() {
+        return hasParticleType;
+    }
+
+    public void setHasParticleType(boolean hasParticleType) {
+        this.hasParticleType = hasParticleType;
+    }
 
 }

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?view=diff&rev=534864&r1=534863&r2=534864
==============================================================================
--- 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 May  3 06:56:33 2007
@@ -328,7 +328,7 @@
                     //populate the map with the partname - class name
                     //attached to the schema element
                     XmlSchemaElement xmlSchemaElement = (XmlSchemaElement) item;
-                    boolean isArray = (xmlSchemaElement.getMaxOccurs() - xmlSchemaElement.getMinOccurs()) > 1;
+                    boolean isArray = xmlSchemaElement.getMaxOccurs() > 1;
 
                     XmlSchemaType schemaType = xmlSchemaElement.getSchemaType();
                     String partName = null;
@@ -352,7 +352,7 @@
                     // for it for now
 
                     XmlSchemaAny xmlSchemaAny = (XmlSchemaAny) item;
-                    boolean isArray = xmlSchemaAny.getMaxOccurs() - xmlSchemaAny.getMinOccurs() > 1;
+                    boolean isArray = xmlSchemaAny.getMaxOccurs() > 1;
 
                     QName partQName = WSDLUtil.getPartQName(opName,
                             qnameSuffix,

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=534864&r1=534863&r2=534864
==============================================================================
--- 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 May  3 06:56:33 2007
@@ -869,9 +869,11 @@
      * @param complexType
      * @throws SchemaCompilationException
      */
-    private void processAnonymousComplexSchemaType(XmlSchemaElement elt, XmlSchemaComplexType complexType, XmlSchema parentSchema)
+    private void processAnonymousComplexSchemaType(XmlSchemaElement elt,
+                                                   XmlSchemaComplexType complexType,
+                                                   XmlSchema parentSchema)
             throws SchemaCompilationException {
-        BeanWriterMetaInfoHolder metaInfHolder = processComplexType(complexType, parentSchema);
+        BeanWriterMetaInfoHolder metaInfHolder = processComplexType(elt.getQName(),complexType, parentSchema);
 
         //since this is a special case (an unnamed complex type) we'll put the already processed
         //metainf holder in a special map to be used later
@@ -883,7 +885,8 @@
      *
      * @param complexType
      */
-    private void processNamedComplexSchemaType(XmlSchemaComplexType complexType, XmlSchema parentSchema) throws SchemaCompilationException {
+    private void processNamedComplexSchemaType(XmlSchemaComplexType complexType,
+                                               XmlSchema parentSchema) throws SchemaCompilationException {
 
         if (processedTypemap.containsKey(complexType.getQName())
                 || baseSchemaTypeMap.containsKey(complexType.getQName())) {
@@ -898,7 +901,7 @@
         complexType.addMetaInfo(SchemaConstants.SchemaCompilerInfoHolder.CLASSNAME_KEY,
                 fullyQualifiedClassName);
 
-        BeanWriterMetaInfoHolder metaInfHolder = processComplexType(complexType, parentSchema);
+        BeanWriterMetaInfoHolder metaInfHolder = processComplexType(complexType.getQName(),complexType, parentSchema);
         //add this information to the metainfo holder
         metaInfHolder.setOwnQname(complexType.getQName());
         metaInfHolder.setOwnClassName(fullyQualifiedClassName);
@@ -918,11 +921,28 @@
      */
     private String writeComplexType(XmlSchemaComplexType complexType, BeanWriterMetaInfoHolder metaInfHolder)
             throws SchemaCompilationException {
-        String javaClassName = writer.write(complexType, processedTypemap, metaInfHolder);
+        String javaClassName = writer.write(complexType.getQName(), processedTypemap, metaInfHolder);
         processedTypeMetaInfoMap.put(complexType.getQName(), metaInfHolder);
         return javaClassName;
     }
 
+
+    /**
+     * Writes complex Sequence,Choice, all elements
+     * @param qname complex type qname
+     * @param metaInfHolder
+     * @return  written java class name
+     * @throws SchemaCompilationException
+     */
+
+
+    private String writeComplexParticle(QName qname,BeanWriterMetaInfoHolder metaInfHolder)
+            throws SchemaCompilationException {
+       String javaClassName = writer.write(qname, processedTypemap, metaInfHolder);
+        processedTypeMetaInfoMap.put(qname, metaInfHolder);
+        return javaClassName;
+    }
+
     /**
      * Writes a complex type
      *
@@ -936,12 +956,15 @@
         processedTypeMetaInfoMap.put(simpleType.getQName(), metaInfHolder);
     }
 
-    private BeanWriterMetaInfoHolder processComplexType(XmlSchemaComplexType complexType, XmlSchema parentSchema) throws SchemaCompilationException {
+    private BeanWriterMetaInfoHolder processComplexType(
+            QName parentElementQName,
+            XmlSchemaComplexType complexType,
+            XmlSchema parentSchema) throws SchemaCompilationException {
         XmlSchemaParticle particle = complexType.getParticle();
         BeanWriterMetaInfoHolder metaInfHolder = new BeanWriterMetaInfoHolder();
         if (particle != null) {
             //Process the particle
-            processParticle(particle, metaInfHolder, parentSchema);
+            processParticle(parentElementQName, particle, metaInfHolder, parentSchema);
         }
 
         //process attributes - first look for the explicit attributes
@@ -1029,7 +1052,7 @@
 
             //process the particle of this node
             if (extension.getParticle() != null) {
-                processParticle(extension.getParticle(), metaInfHolder, parentSchema);
+                processParticle(null,extension.getParticle(), metaInfHolder, parentSchema);
             }
 
             // process attributes
@@ -1085,7 +1108,7 @@
             copyMetaInfoHierarchy(metaInfHolder, restriction.getBaseTypeName(), parentSchema);
 
             //process the particle of this node
-            processParticle(restriction.getParticle(), metaInfHolder, parentSchema);
+            processParticle(null,restriction.getParticle(), metaInfHolder, parentSchema);
 
             //process attributes - first look for the explicit attributes
             XmlSchemaObjectCollection attribs = restriction.getAttributes();
@@ -1630,39 +1653,115 @@
 
     /**
      * Process a particle- A particle may be a sequence,all or a choice
-     *
-     * @param particle
-     * @param metainfHolder
+     * @param parentElementQName - this can either be parent element QName or parent Complex type qname
+     * @param particle - particle being processed
+     * @param metainfHolder -
+     * @param parentSchema
      * @throws SchemaCompilationException
      */
-    private void processParticle(XmlSchemaParticle particle, //particle being processed
-                                 BeanWriterMetaInfoHolder metainfHolder // metainf holder
+    private void processParticle(QName parentElementQName,
+                                 XmlSchemaParticle particle,
+                                 BeanWriterMetaInfoHolder metainfHolder
             , XmlSchema parentSchema) throws SchemaCompilationException {
+
         if (particle instanceof XmlSchemaSequence) {
-            XmlSchemaObjectCollection items = ((XmlSchemaSequence) particle).getItems();
-            if (options.isBackwordCompatibilityMode()) {
-                process(items, metainfHolder, false, parentSchema);
+            XmlSchemaSequence xmlSchemaSequence = (XmlSchemaSequence) particle;
+
+            //remove this : only for testing
+            if (parentElementQName != null) {
+                QName qname = new QName("http://mynamespace.com/testparticlemaxoccurs", "TestCustomType");
+                if (!qname.equals(parentElementQName)) {
+                    if (parentElementQName.getNamespaceURI().equals("http://mynamespace.com/testparticlemaxoccurs")) {
+                        xmlSchemaSequence.setMaxOccurs(5);
+                        xmlSchemaSequence.setMinOccurs(0);
+                    }
+                }
+            }
+
+
+            XmlSchemaObjectCollection items = xmlSchemaSequence.getItems();
+            //TODO: support parentElementQName null instances. i.e for extensions
+            if ((xmlSchemaSequence.getMaxOccurs() > 1) && (parentElementQName != null)) {
+                // we have to process many sequence types
+                BeanWriterMetaInfoHolder beanWriterMetaInfoHolder = new BeanWriterMetaInfoHolder();
+                process(parentElementQName, items, beanWriterMetaInfoHolder, true, parentSchema);
+                beanWriterMetaInfoHolder.setParticleClass(true);
+                QName sequenceQName = new QName(parentElementQName.getNamespaceURI(),
+                         parentElementQName.getLocalPart() + "Sequence");
+                String javaClassName = writeComplexParticle(sequenceQName,beanWriterMetaInfoHolder);
+                processedTypemap.put(sequenceQName, javaClassName);
+
+                // add this as an array to the original class
+                metainfHolder.registerMapping(sequenceQName,
+                        sequenceQName,
+                        findClassName(sequenceQName,true),
+                        SchemaConstants.ARRAY_TYPE);
+                metainfHolder.setOrdered(true);
+                metainfHolder.registerQNameIndex(sequenceQName,metainfHolder.getOrderStartPoint() + 1);
+                metainfHolder.setHasParticleType(true);
+                metainfHolder.addtStatus(sequenceQName,SchemaConstants.PARTICLE_TYPE_ELEMENT);
+                metainfHolder.addMaxOccurs(sequenceQName,xmlSchemaSequence.getMaxOccurs());
+                metainfHolder.addMinOccurs(sequenceQName,xmlSchemaSequence.getMinOccurs());
+
+
             } else {
-                process(items, metainfHolder, true, parentSchema);
+                if (options.isBackwordCompatibilityMode()) {
+                    process(parentElementQName,items, metainfHolder, false, parentSchema);
+                } else {
+                    process(parentElementQName,items, metainfHolder, true, parentSchema);
+                }
             }
+
         } else if (particle instanceof XmlSchemaAll) {
             XmlSchemaObjectCollection items = ((XmlSchemaAll) particle).getItems();
-            process(items, metainfHolder, false, parentSchema);
+            process(parentElementQName,items, metainfHolder, false, parentSchema);
         } else if (particle instanceof XmlSchemaChoice) {
+            XmlSchemaChoice xmlSchemaChoice = (XmlSchemaChoice) particle;
             XmlSchemaObjectCollection items = ((XmlSchemaChoice) particle).getItems();
-            metainfHolder.setChoice(true);
-            process(items, metainfHolder, false, parentSchema);
+
+            if ((xmlSchemaChoice.getMaxOccurs() > 1)) {
+                // we have to process many sequence types
+                BeanWriterMetaInfoHolder beanWriterMetaInfoHolder = new BeanWriterMetaInfoHolder();
+                beanWriterMetaInfoHolder.setChoice(true);
+                process(parentElementQName,items, beanWriterMetaInfoHolder, false, parentSchema);
+                beanWriterMetaInfoHolder.setParticleClass(true);
+                QName choiceQName = new QName(parentElementQName.getNamespaceURI(),
+                         parentElementQName.getLocalPart() + "Choice");
+                String javaClassName = writeComplexParticle(choiceQName,beanWriterMetaInfoHolder);
+                processedTypemap.put(choiceQName, javaClassName);
+
+                // add this as an array to the original class
+                metainfHolder.registerMapping(choiceQName,
+                        choiceQName,
+                        findClassName(choiceQName,true),
+                        SchemaConstants.ARRAY_TYPE);
+                metainfHolder.setOrdered(true);
+                metainfHolder.setHasParticleType(true);
+                metainfHolder.registerQNameIndex(choiceQName,metainfHolder.getOrderStartPoint() + 1);
+                metainfHolder.addtStatus(choiceQName,SchemaConstants.PARTICLE_TYPE_ELEMENT);
+                metainfHolder.addMaxOccurs(choiceQName,xmlSchemaChoice.getMaxOccurs());
+                metainfHolder.addMinOccurs(choiceQName,xmlSchemaChoice.getMinOccurs());
+
+            } else {
+                metainfHolder.setChoice(true);
+                process(parentElementQName,items, metainfHolder, false, parentSchema);
+            }
+
 
         }
     }
 
     /**
+     *
+     * @param parentElementQName - this could either be the complex type parentElementQName or element parentElementQName
      * @param items
      * @param metainfHolder
      * @param order
+     * @param parentSchema
      * @throws SchemaCompilationException
      */
-    private void process(XmlSchemaObjectCollection items,
+    private void process(QName parentElementQName,
+                         XmlSchemaObjectCollection items,
                          BeanWriterMetaInfoHolder metainfHolder,
                          boolean order,
                          XmlSchema parentSchema) throws SchemaCompilationException {
@@ -1671,6 +1770,8 @@
         Map processedElementTypeMap = new LinkedHashMap();
         List localNillableList = new ArrayList();
 
+        Map particleQNameMap = new HashMap();
+
         // this list is used to keep the details of the
         // elements within a choice withing sequence
         List innerChoiceElementList = new ArrayList();
@@ -1704,6 +1805,53 @@
                 }
                 //we do not register the array status for the any type
                 processedElementArrayStatusMap.put(any, isArray(any) ? Boolean.TRUE : Boolean.FALSE);
+            } else if (item instanceof XmlSchemaSequence) {
+                // we have to process many sequence types
+
+                XmlSchemaSequence xmlSchemaSequence = (XmlSchemaSequence) item;
+                if (xmlSchemaSequence.getItems().getCount() > 0) {
+                    BeanWriterMetaInfoHolder beanWriterMetaInfoHolder = new BeanWriterMetaInfoHolder();
+                    process(parentElementQName, xmlSchemaSequence.getItems(), beanWriterMetaInfoHolder, true, parentSchema);
+                    beanWriterMetaInfoHolder.setParticleClass(true);
+                    QName sequenceQName = new QName(parentElementQName.getNamespaceURI(),
+                            parentElementQName.getLocalPart() + "Sequence" + getNextTypeSuffix());
+                    String javaClassName = writeComplexParticle(sequenceQName, beanWriterMetaInfoHolder);
+                    processedTypemap.put(sequenceQName, javaClassName);
+
+                    //put the partical to array
+                    Boolean isArray = xmlSchemaSequence.getMaxOccurs() > 1 ? Boolean.TRUE : Boolean.FALSE;
+                    processedElementArrayStatusMap.put(item, isArray);
+                    particleQNameMap.put(item, sequenceQName);
+
+                    if (order) {
+                        elementOrderMap.put(item, new Integer(sequenceCounter));
+                    }
+                }
+
+            } else if (item instanceof XmlSchemaChoice) {
+                // we have to process many sequence types
+
+                XmlSchemaChoice xmlSchemaChoice = (XmlSchemaChoice) item;
+                if (xmlSchemaChoice.getItems().getCount() > 0) {
+                    BeanWriterMetaInfoHolder beanWriterMetaInfoHolder = new BeanWriterMetaInfoHolder();
+                    beanWriterMetaInfoHolder.setChoice(true);
+                    process(parentElementQName, xmlSchemaChoice.getItems(), beanWriterMetaInfoHolder, false, parentSchema);
+                    beanWriterMetaInfoHolder.setParticleClass(true);
+                    QName choiceQName = new QName(parentElementQName.getNamespaceURI(),
+                            parentElementQName.getLocalPart() + "Choice" + getNextTypeSuffix());
+                    String javaClassName = writeComplexParticle(choiceQName, beanWriterMetaInfoHolder);
+                    processedTypemap.put(choiceQName, javaClassName);
+
+                    //put the partical to array
+                    Boolean isArray = xmlSchemaChoice.getMaxOccurs() > 1 ? Boolean.TRUE : Boolean.FALSE;
+                    processedElementArrayStatusMap.put(item, isArray);
+                    particleQNameMap.put(item, choiceQName);
+
+                    if (order) {
+                        elementOrderMap.put(item, new Integer(sequenceCounter));
+                    }
+                }
+
             } else if (order && (item instanceof XmlSchemaChoice)) {
 
                 // this is a tempory patch for process only inner sequence choices
@@ -1849,6 +1997,52 @@
                     //record the order in the metainf holder for the any
                     Integer integer = (Integer) elementOrderMap.get(any);
                     metainfHolder.registerQNameIndex(anyElementFieldName,
+                            startingItemNumberOrder + integer.intValue());
+                }
+            } else if (child instanceof XmlSchemaSequence) {
+                XmlSchemaSequence xmlSchemaSequence = (XmlSchemaSequence) child;
+                QName sequenceQName = (QName) particleQNameMap.get(child);
+                boolean isArray = xmlSchemaSequence.getMaxOccurs() > 1;
+
+                // add this as an array to the original class
+                metainfHolder.registerMapping(sequenceQName,
+                        sequenceQName,
+                        findClassName(sequenceQName, isArray));
+                if (isArray) {
+                    metainfHolder.addtStatus(sequenceQName, SchemaConstants.ARRAY_TYPE);
+                }
+                metainfHolder.addtStatus(sequenceQName, SchemaConstants.PARTICLE_TYPE_ELEMENT);
+                metainfHolder.addMaxOccurs(sequenceQName, xmlSchemaSequence.getMaxOccurs());
+                metainfHolder.addMinOccurs(sequenceQName, xmlSchemaSequence.getMinOccurs());
+                metainfHolder.setHasParticleType(true);
+
+                if (order) {
+                    //record the order in the metainf holder for the any
+                    Integer integer = (Integer) elementOrderMap.get(child);
+                    metainfHolder.registerQNameIndex(sequenceQName,
+                            startingItemNumberOrder + integer.intValue());
+                }
+            } else if (child instanceof XmlSchemaChoice) {
+                XmlSchemaChoice xmlSchemaChoice = (XmlSchemaChoice) child;
+                QName choiceQName = (QName) particleQNameMap.get(child);
+                boolean isArray = xmlSchemaChoice.getMaxOccurs() > 1;
+
+                // add this as an array to the original class
+                metainfHolder.registerMapping(choiceQName,
+                        choiceQName,
+                        findClassName(choiceQName, isArray));
+                if (isArray) {
+                    metainfHolder.addtStatus(choiceQName, SchemaConstants.ARRAY_TYPE);
+                }
+                metainfHolder.addtStatus(choiceQName, SchemaConstants.PARTICLE_TYPE_ELEMENT);
+                metainfHolder.addMaxOccurs(choiceQName, xmlSchemaChoice.getMaxOccurs());
+                metainfHolder.addMinOccurs(choiceQName, xmlSchemaChoice.getMinOccurs());
+                metainfHolder.setHasParticleType(true);
+
+                if (order) {
+                    //record the order in the metainf holder for the any
+                    Integer integer = (Integer) elementOrderMap.get(child);
+                    metainfHolder.registerQNameIndex(choiceQName,
                             startingItemNumberOrder + integer.intValue());
                 }
             }

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaConstants.java?view=diff&rev=534864&r1=534863&r2=534864
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaConstants.java (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaConstants.java Thu May  3 06:56:33 2007
@@ -81,14 +81,15 @@
     public static final QName XSD_TOKEN = new QName(URI_DEFAULT_SCHEMA_XSD, "token");
 
     //bit patterns for the types
-    public static final int ATTRIBUTE_TYPE = 0x01;
-    public static final int ELEMENT_TYPE = 0x02;
-    public static final int ARRAY_TYPE = 0x04;
-    public static final int ANY_TYPE = 0x08;
-    public static final int BINARY_TYPE = 0x10;
-    public static final int OPTIONAL_TYPE = 0x20;
-    public static final int SIMPLE_TYPE_OR_CONTENT = 0x40;
-    public static final int INNER_CHOICE_ELEMENT = 0x80;
+    public static final int ATTRIBUTE_TYPE = 0x0001;
+    public static final int ELEMENT_TYPE = 0x0002;
+    public static final int ARRAY_TYPE = 0x0004;
+    public static final int ANY_TYPE = 0x0008;
+    public static final int BINARY_TYPE = 0x0010;
+    public static final int OPTIONAL_TYPE = 0x0020;
+    public static final int SIMPLE_TYPE_OR_CONTENT = 0x0040;
+    public static final int INNER_CHOICE_ELEMENT = 0x0080;
+    public static final int PARTICLE_TYPE_ELEMENT = 0x0100;
 
     public static class SchemaPropertyNames{
 



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