axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r410497 [1/6] - in /webservices/axis2/trunk/java/modules: adb-codegen/ adb-codegen/src/ adb-codegen/src/org/ adb-codegen/src/org/apache/ adb-codegen/src/org/apache/axis2/ adb-codegen/src/org/apache/axis2/schema/ adb-codegen/src/org/apache/a...
Date Wed, 31 May 2006 11:35:36 GMT
Author: ajith
Date: Wed May 31 04:35:30 2006
New Revision: 410497

URL: http://svn.apache.org/viewvc?rev=410497&view=rev
Log:
1. Moved the adb codegen part out from the codegen and created a new module for that.
2. Added necessary module names to the etc/project.properties
3. Changed the SimpleDBExtension.java to load the adb schema compiler by reflection

Added:
    webservices/axis2/trunk/java/modules/adb-codegen/
    webservices/axis2/trunk/java/modules/adb-codegen/maven.xml
    webservices/axis2/trunk/java/modules/adb-codegen/project.properties
    webservices/axis2/trunk/java/modules/adb-codegen/project.xml
    webservices/axis2/trunk/java/modules/adb-codegen/src/
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/
    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/CompilerOptions.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/SchemaCompilationException.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/XSD2Java.java
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/i18n/
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/i18n/SchemaCompilerMessages.java
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/i18n/resource.properties
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/schema-compile.properties
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/
    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/template/PlainBeanTemplate.xsl
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/typemap/
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/typemap/JavaTypeMap.java
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/typemap/TypeMap.java
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/util/
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/util/PrimitiveTypeFinder.java
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/util/SchemaPropertyLoader.java
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/
    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/JavaBeanWriter.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/anonymous_complexType.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/complex-minoccurs0.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/complex_all.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/complex_content_extension.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/derived/
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/derived/derivedType-All.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/import.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/import2.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/mixed_minoccus0.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple/
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple-minoccurs0.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple-recursive-datatypes.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple/simpleType-All.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_any.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_any_attribute.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_anytype.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_attrib.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_choice.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_element.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_element_reference.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_maxOccurs.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_maxOccurs2.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_nillable.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_particle_all.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_recursive.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_restriction.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_sequence.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_sequence_2.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/AbstractSchemaCompilerTester.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/AnonymousComplexTypeTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/ComplexAllTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/ComplexExtensionTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/ImportTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/RecursiveCompileTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAnyAttribTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAnyTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAnyTypeTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAttributeTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleChoiceTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleElementReferenceTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleElementTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleParticleAllTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleRestrictionTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleSequence2Test.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleSequenceTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/XmlMaxOccurs2Test.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/XmlmaxOccursTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/simple/
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/simple/SimpleTypeAllCompileTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/AbstractDerivedPopulater.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/DerivedTypeBytePopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/DerivedTypeIntPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/DerivedTypeIntegerPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/DerivedTypeLongPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/DerivedTypeNegativeIntegerPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/DerivedTypeNonNegativeIntegerPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/DerivedTypeNonPositiveIntegerPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/DerivedTypePositveIntegerPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/DerivedTypeShortPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/DerivedTypeUnsignedBytePopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/DerivedTypeUnsignedIntPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/DerivedTypeUnsignedLongPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/derived/DerivedTypeUnsignedShortPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/ADBInOutTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateAnonComplexTypeTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateAnyTypeTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateArrayInArrayTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateArrayTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateChoiceTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateComplexMinOccurs0Test.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateMinOccurs0Test.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateMixedMinoccurs0Test.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateParticleAllTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateRecursiveTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/AbstractSimplePopulater.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeAnyURIPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeBase64BinPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeBooleanPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDatePopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDateTimePopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDayPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDoublePopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDurationPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeFloatPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeHexBinaryPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeMonthDayPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeQNamePopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeTimePopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypegMonthPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypegYearMonthPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypegYearPopulateTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/package.html
    webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/util/PrettyPrinter.java
      - copied, changed from r410213, webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/PrettyPrinter.java
    webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/wsdl/codegen/
    webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/wsdl/codegen/writer/
Removed:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/PrettyPrinter.java
    webservices/axis2/trunk/java/modules/codegen/test-resources/xsd/
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/schema/
Modified:
    webservices/axis2/trunk/java/modules/codegen/maven.xml
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/ClassWriter.java
    webservices/axis2/trunk/java/modules/integration/project.xml

Added: webservices/axis2/trunk/java/modules/adb-codegen/maven.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/maven.xml?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/maven.xml (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/maven.xml Wed May 31 04:35:30 2006
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Revision: 1.21 $ $Date: 2004-10-27 20:54:09 +0600 (Wed, 27 Oct 2004) $ -->
+
+<project default="jar"
+         xmlns:j="jelly:core"
+         xmlns:u="jelly:util"
+         xmlns:maven="jelly:maven"
+         xmlns:util="jelly:util"
+         xmlns:deploy="deploy"
+         xmlns:ant="jelly:ant">
+
+    <preGoal name="itest:compile">
+        <u:file var="file" name="${maven.itest.src}"/>
+        <j:if test="${!file.exists()}">
+            <j:expr value="${context.setVariable('maven.itest.skip', 'true')}"/>
+        </j:if>
+    </preGoal>
+
+<!-- run the schema compiler -->
+    <postGoal name="test:compile">
+        <!--<j:if test="context.getVariable('maven.test.skip') != 'true'}">-->
+
+        <j:set var="compiled.classes.dir" value="target/classes"/>
+        <!-- Theres got to be a better way to do this -->
+        <j:set var="schema.source.dir" value="test-resources/xsd"/>
+        <j:set var="schema.output.base.dir" value="target/schema"/>
+        <j:set var="schema.generated.src.dir" value="${schema.output.base.dir}/src"/>
+        <j:set var="schema.generated.classes.dir" value="${schema.output.base.dir}/classes"/>
+        <!-- make the dirs -->
+        <mkdir dir="${schema.output.base.dir}"/>
+        <mkdir dir="${schema.generated.src.dir}"/>
+        <mkdir dir="${schema.generated.classes.dir}"/>
+        <!-- Run schema compiler with designated schemas -->
+        <ant:echo>Compiling simple_maxOccurs2.xsd</ant:echo>
+        <!-- simple max occurs 2 xsd -->
+        <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="${schema.source.dir}/simple_maxOccurs2.xsd"/>
+            <arg file="${schema.generated.src.dir}"/>
+        </java>
+        <ant:echo>Compiling anonymous_complexType.xsd</ant:echo>
+        <!-- anon complex type xsd -->
+        <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="${schema.source.dir}/anonymous_complexType.xsd"/>
+            <arg file="${schema.generated.src.dir}"/>
+        </java>
+          <!-- anon choice xsd -->
+        <ant:echo>Compiling simple_choice.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="${schema.source.dir}/simple_choice.xsd"/>
+            <arg file="${schema.generated.src.dir}"/>
+        </java>
+        <!-- anon particle all xsd -->
+        <ant:echo>Compiling simple_particle_all.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="${schema.source.dir}/simple_particle_all.xsd"/>
+            <arg file="${schema.generated.src.dir}"/>
+        </java>
+        <!-- simple max occurs xsd -->
+        <ant:echo>Compiling simple_maxOccurs.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="${schema.source.dir}/simple_maxOccurs.xsd"/>
+            <arg file="${schema.generated.src.dir}"/>
+        </java>
+
+        <!-- simple any type xsd -->
+        <ant:echo>Compiling simple_anytype.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="${schema.source.dir}/simple_anytype.xsd"/>
+            <arg file="${schema.generated.src.dir}"/>
+        </java>
+
+
+        <!-- min occurs 0 xsd -->
+        <ant:echo>Compiling simple-minoccurs0.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="${schema.source.dir}/simple-minoccurs0.xsd"/>
+            <arg file="${schema.generated.src.dir}"/>
+        </java>
+
+          <!-- complex min occurs 0 xsd -->
+        <ant:echo>Compiling complex-minoccurs0.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="${schema.source.dir}/complex-minoccurs0.xsd"/>
+            <arg file="${schema.generated.src.dir}"/>
+        </java>
+
+        <ant:echo>Compiling simple-recursive-datatypes.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="${schema.source.dir}/simple-recursive-datatypes.xsd"/>
+            <arg file="${schema.generated.src.dir}"/>
+        </java>
+
+          <ant:echo>Compiling mixed_minoccus0.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="${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.dependency.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.dependency.classpath"/>
+            <classpath location="${compiled.classes.dir}"/>
+            <arg file="${schema.source.dir}/derived/derivedType-All.xsd"/>
+            <arg file="${schema.generated.src.dir}"/>
+        </java>
+        <!-- ################################################################### -->
+        <!-- Compile the generated classes -->
+        <javac destdir="${schema.generated.classes.dir}" srcdir="${schema.generated.src.dir}">
+            <classpath refid="maven.dependency.classpath"></classpath>
+            <classpath location="${compiled.classes.dir}"></classpath>
+        </javac>
+
+        <ant:path id="schema.generated.classes.dir" location="${schema.generated.classes.dir}"/>
+        <maven:addPath id="maven.dependency.classpath" refid="schema.generated.classes.dir"/>
+        <!--</j:if>-->
+    </postGoal>
+</project>

Added: webservices/axis2/trunk/java/modules/adb-codegen/project.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/project.properties?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/project.properties (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/project.properties Wed May 31 04:35:30 2006
@@ -0,0 +1,17 @@
+# -------------------------------------------------------------------
+# Copyright 2001-2004 The Apache Software Foundation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -------------------------------------------------------------------
+
+maven.multiproject.type=jar

Added: webservices/axis2/trunk/java/modules/adb-codegen/project.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/project.xml?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/project.xml (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/project.xml Wed May 31 04:35:30 2006
@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+<project>
+    <pomVersion>3</pomVersion>
+    <extend>../../etc/project.xml</extend>
+
+    <id>axis2-adb-codegen</id>
+    <name>Apache Axis 2.0 - ADB Codegen</name>
+    <groupId>axis2</groupId>
+    <description>ADB code generation support for Axis2</description>
+
+    <dependencies>
+       <dependency>
+            <groupId>ws-commons</groupId>
+            <artifactId>axiom-api</artifactId>
+            <version>${axiom.version}</version>
+        </dependency>
+       
+        <dependency>
+            <groupId>ws-commons</groupId>
+            <artifactId>axiom-impl</artifactId>
+            <version>${axiom.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>axis2</groupId>
+            <artifactId>axis2-common</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+        <dependency>
+            <groupId>axis2</groupId>
+            <artifactId>axis2-codegen</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+        <dependency>
+            <groupId>axis2</groupId>
+            <artifactId>axis2-core</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+	  <dependency>
+            <groupId>axis2</groupId>
+            <artifactId>axis2-adb</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ws.commons</groupId>
+            <artifactId>XmlSchema</artifactId>
+            <version>${XmlSchema.version}</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>${commons.logging.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+         <dependency>
+            <groupId>geronimo-spec</groupId>
+            <artifactId>geronimo-spec-activation</artifactId>
+            <version>${geronimo.spec.activation.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>${stax.impl.groupid}</groupId>
+            <artifactId>${stax.impl.artifactid}</artifactId>
+            <version>${stax.impl.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+            <url>http://dist.codehaus.org/stax/jars/</url>
+        </dependency>
+        <dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax-api</artifactId>
+            <version>${stax.api.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+            <url>http://dist.codehaus.org/stax/jars/</url>
+        </dependency>
+        <dependency>
+            <groupId>wsdl4j</groupId>
+            <artifactId>wsdl4j</artifactId>
+            <version>${wsdl4j.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>ant</groupId>
+            <artifactId>ant</artifactId>
+            <version>${ant.version}</version>
+            <type>jar</type>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>xmlunit</groupId>
+            <artifactId>xmlunit</artifactId>
+            <version>${xmlunit.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+            <url>http://www.ibiblio.org/maven/xmlunit/jars/</url>
+        </dependency>
+         <dependency>
+            <groupId>annogen</groupId>
+            <artifactId>annogen</artifactId>
+            <version>${annogen.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>backport-util-concurrent</groupId>
+            <artifactId>backport-util-concurrent</artifactId>
+            <version>${backport_util_concurrent.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>ws-commons</groupId>
+            <artifactId>neethi</artifactId>
+            <version>${neethi.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+    </dependencies>
+
+    <reports/>
+    <!-- add the build properties-->
+    <build>
+        <resources>
+            <resource>
+                <directory>src</directory>
+                <includes>
+                    <include>**/*.properties</include>
+                    <include>**/*.xml</include>
+                    <include>**/*.xsl</include>
+                    <include>**/*.xsd</include>
+                </includes>
+            </resource>
+        </resources>
+    </build>
+</project>

Added: 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?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java Wed May 31 04:35:30 2006
@@ -0,0 +1,432 @@
+package org.apache.axis2.schema;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.LinkedHashMap;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * This class is used as a holder to pass on the meta information to the bean writer.
+ * This meta information is used by the writer to write the databinding conversion code.
+ * Note - Metainfholders are not meant to be reused!!!. They are per-class basis and are strictly
+ * not thread safe!!!!
+ */
+public class BeanWriterMetaInfoHolder {
+
+
+    protected boolean ordered = false;
+    protected boolean anonymous = false;
+    protected boolean choice = false;
+
+    protected boolean extension = false;
+    private String extensionClassName = "";
+    protected Map elementToSchemaQNameMap = new LinkedHashMap();
+    protected Map elementToJavaClassMap = new LinkedHashMap();
+    protected Map specialTypeFlagMap = new LinkedHashMap();
+    protected Map qNameMaxOccursCountMap = new LinkedHashMap();
+    protected Map qNameMinOccursCountMap = new LinkedHashMap();
+    protected Map qNameOrderMap = new LinkedHashMap();
+
+    protected List nillableQNameList  = new ArrayList();
+
+
+
+
+    //the parent metainfo holder, useful in handling extensions and
+    //restrictions
+    protected BeanWriterMetaInfoHolder parent = null;
+
+    public boolean isChoice() {
+        return choice;
+    }
+
+    public void setChoice(boolean choice) {
+        this.choice = choice;
+    }
+
+    /**
+     * Gets the parent
+     * @return
+     */
+    public BeanWriterMetaInfoHolder getParent() {
+        return parent;
+    }
+
+    /**
+     * Gets the anonymous status.
+     *
+     * @return Returns boolean.
+     */
+    public boolean isAnonymous() {
+        return anonymous;
+    }
+
+    /**
+     * Sets the anonymous flag.
+     *
+     * @param anonymous
+     */
+    public void setAnonymous(boolean anonymous) {
+        this.anonymous = anonymous;
+    }
+
+    /**
+     * Sets the extensions base class name. Valid only when the isExtension
+     * returns true.
+     *
+     * @return Returns String.
+     */
+    public String getExtensionClassName() {
+        return extensionClassName;
+    }
+
+    /**
+     * Sets the extensions base class name. Valid only when the isExtension
+     * returns true.
+     *
+     * @param extensionClassName
+     */
+    public void setExtensionClassName(String extensionClassName) {
+        this.extensionClassName = extensionClassName;
+    }
+
+    /**
+     * Gets the extension status.
+     *
+     * @return Returns boolean.
+     */
+    public boolean isExtension() {
+        return extension;
+    }
+
+
+
+    /**
+     * Sets the extension status.
+     *
+     * @param extension
+     */
+    public void setExtension(boolean extension) {
+        this.extension = extension;
+    }
+
+    /**
+     * Gets the ordered status.
+     *
+     * @return Returns boolean.
+     */
+    public boolean isOrdered() {
+        return ordered;
+    }
+
+    /**
+     * Sets the ordered flag. 
+     *
+     * @param ordered
+     */
+    public void setOrdered(boolean ordered) {
+        this.ordered = ordered;
+    }
+
+    /**
+     * Registers a mapping.
+     *
+     * @param qName
+     * @param schemaName
+     * @param javaClassName
+     */
+    public void registerMapping(QName qName, QName schemaName, String javaClassName) {
+        registerMapping(qName, schemaName, javaClassName, SchemaConstants.ELEMENT_TYPE);
+    }
+
+
+    /* Registers a Qname as nillable
+     * The qName better be of an element
+     *
+     * @param qName
+     * @param schemaName
+     * @param javaClassName
+     */
+    public void registerNillableQName(QName eltQName) {
+        nillableQNameList.add(eltQName);
+    }
+
+    /**
+     * Returns whether a QName is nillable or not
+     * @param eltQName
+     * @return
+     */
+    public boolean isNillable(QName eltQName) {
+        return nillableQNameList.contains(eltQName);
+    }
+
+    /**
+     * Registers a mapping.
+     *
+     * @param qName
+     * @param schemaName
+     * @param javaClassName
+     * @param type
+     */
+    public void registerMapping(QName qName, QName schemaName, String javaClassName, int type) {
+        this.elementToJavaClassMap.put(qName, javaClassName);
+        this.elementToSchemaQNameMap.put(qName, schemaName);
+        addtStatus(qName, type);
+
+    }
+
+    /**
+     * Gets the schema name for the given QName.
+     *
+     * @param eltQName
+     * @return Returns QName.
+     */
+    public QName getSchemaQNameForQName(QName eltQName) {
+        return (QName) this.elementToSchemaQNameMap.get(eltQName);
+    }
+
+    /**
+     * Gets the class name for the QName.
+     *
+     * @param eltQName
+     * @return Returns String.
+     */
+    public String getClassNameForQName(QName eltQName) {
+        return (String) this.elementToJavaClassMap.get(eltQName);
+    }
+
+    /**
+     * Gets whether a given QName is an attribute
+     *
+     * @param qName
+     * @return Returns boolean.
+     */
+    public boolean getAttributeStatusForQName(QName qName) {
+
+        Integer state = (Integer) specialTypeFlagMap.get(qName);
+        return state != null && getStatus(state.intValue(),SchemaConstants.ATTRIBUTE_TYPE);
+    }
+
+    /**
+     * Gets whether a given QName represents a anyType
+     *
+     * @param qName
+     * @return Returns boolean.
+     */
+    public boolean getAnyStatusForQName(QName qName) {
+        Integer state = (Integer) specialTypeFlagMap.get(qName);
+        return state != null && getStatus(state.intValue(),SchemaConstants.ANY_TYPE);
+    }
+
+    /**
+     * Gets whether a given QName refers to an array.
+     *
+     * @param qName
+     * @return Returns boolean.
+     */
+    public boolean getArrayStatusForQName(QName qName) {
+        Integer state = (Integer) specialTypeFlagMap.get(qName);
+        return state != null && getStatus(state.intValue(),
+                SchemaConstants.ARRAY_TYPE);
+    }
+
+    /**
+     * Gets whether a given QName refers to an array.
+     *
+     * @param qName
+     * @return Returns boolean.
+     */
+    public boolean getBinaryStatusForQName(QName qName) {
+        Integer state = (Integer) specialTypeFlagMap.get(qName);
+        return state != null && getStatus(state.intValue(),
+                SchemaConstants.BINARY_TYPE);
+    }
+    /**
+     * Gets whether a given QName has the any attribute status.
+     *
+     * @param qName
+     * @return Returns boolean.
+     */
+    public boolean getAnyAttributeStatusForQName(QName qName) {
+       return getArrayStatusForQName(qName) &&
+               getAnyStatusForQName(qName);
+    }
+
+    /**
+     * Clears the whole set of tables.
+     */
+    public void clearTables() {
+        this.elementToJavaClassMap.clear();
+        this.elementToSchemaQNameMap.clear();
+        this.elementToSchemaQNameMap.clear();
+        this.elementToJavaClassMap.clear();
+        this.specialTypeFlagMap.clear();
+        this.qNameMaxOccursCountMap.clear();
+        this.qNameMinOccursCountMap.clear();
+        this.qNameOrderMap.clear();
+    }
+
+    /**
+     * Adds the minOccurs associated with a QName.
+     *
+     * @param qName
+     * @param minOccurs
+     */
+    public void addMinOccurs(QName qName, long minOccurs) {
+        this.qNameMinOccursCountMap.put(qName, new Long(minOccurs));
+    }
+
+    /**
+     * Registers a QName for the order.
+     *
+     * @param qName
+     * @param index
+     */
+    public void registerQNameIndex(QName qName, int index) {
+        this.qNameOrderMap.put(new Integer(index), qName);
+    }
+
+    /**
+     * Adds the minOccurs associated with a QName.
+     *
+     * @param qName
+     * @return Returns long.
+     */
+    public long getMinOccurs(QName qName) {
+        Long l = (Long) this.qNameMinOccursCountMap.get(qName);
+        return l != null ? l.longValue() : 1; //default for min is 1
+    }
+
+    /**
+     * Gets the maxOccurs associated with a QName.
+     *
+     * @param qName
+     * @return Returns long.
+     */
+    public long getMaxOccurs(QName qName) {
+        Long l = (Long) this.qNameMaxOccursCountMap.get(qName);
+        return l != null ? l.longValue() : 1; //default for max is 1
+    }
+
+    /**
+     * Adds the maxOccurs associated with a QName.
+     *
+     * @param qName
+     * @param maxOccurs
+     */
+    public void addMaxOccurs(QName qName, long maxOccurs) {
+        this.qNameMaxOccursCountMap.put(qName, new Long(maxOccurs));
+    }
+
+    /**
+     * @return Returns Iterator.
+     * @deprecated Use #getQNameArray
+     */
+    public Iterator getElementQNameIterator() {
+        return elementToJavaClassMap.keySet().iterator();
+    }
+
+    /**
+     * Gets the QName array - may not be ordered.
+     *
+     * @return Returns QName[].
+     */
+    public QName[] getQNameArray() {
+        Set keySet = elementToJavaClassMap.keySet();
+        return (QName[]) keySet.toArray(new QName[keySet.size()]);
+    }
+
+    /**
+     * Gets the ordered QName array - useful in sequences where the order needs to be preserved
+     * Note - #registerQNameIndex needs to be called if this is to work properly!
+     *
+     * @return Returns QName[].
+     */
+    public QName[] getOrderedQNameArray() {
+        //get the keys of the order map
+        Set set = qNameOrderMap.keySet();
+        int count = set.size();
+        Integer[] keys = (Integer[]) set.toArray(new Integer[count]);
+        Arrays.sort(keys);
+
+        //Now refill the Ordered QName Array
+        List returnQNames = new ArrayList();
+        for (int i = 0; i < keys.length; i++) {
+            returnQNames.add(qNameOrderMap.get(keys[i]));
+        }
+
+        //we've missed the attributes, so if there are attributes
+        //add them explicitly to the end of this list
+        QName[] allNames = getQNameArray();
+        for (int i = 0; i < allNames.length; i++) {
+            if(getAttributeStatusForQName(allNames[i])){
+                returnQNames.add(allNames[i]);
+            }
+        }
+
+        return (QName[])returnQNames.toArray(new QName[returnQNames.size()]);
+    }
+
+    /**
+     *  Finds the starting count for the addition of new items to the order
+     * @return the starting number for the sequence
+     */
+    public int getOrderStartPoint(){
+        return qNameOrderMap.size();
+    }
+
+
+    /**
+     * Creates link to th
+     * @param metaInfo
+     */
+    public void setAsParent(BeanWriterMetaInfoHolder metaInfo){
+        parent = metaInfo;
+    }
+
+    /**
+     * Adds a another status to a particular Qname.
+     * A Qname can be associated with multiple status flags
+     * and they all will be preserved
+     * @param type
+     * @param mask
+     */
+
+    public void addtStatus(QName type,int mask){
+        Object obj = this.specialTypeFlagMap.get(type);
+        if (obj!=null){
+            int preValue = ((Integer)obj).intValue();
+            this.specialTypeFlagMap.put(type, new Integer((preValue | mask)));
+        }else{
+            this.specialTypeFlagMap.put(type, new Integer(mask));
+        }
+
+    }
+
+
+    private boolean getStatus(int storedStatus,int mask){
+        //when the mask is anded with the status then we should get
+        //the mask it self!
+        return (mask==(mask & storedStatus));
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/CompilerOptions.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/CompilerOptions.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/CompilerOptions.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/CompilerOptions.java Wed May 31 04:35:30 2006
@@ -0,0 +1,114 @@
+package org.apache.axis2.schema;
+
+import org.apache.axis2.schema.i18n.SchemaCompilerMessages;
+
+import java.io.File;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.Map;
+import java.util.HashMap;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * This is a bean class that captures all the compiler options.
+ * Right now the compiler options consist of the following
+ * 1. output file location - A folder with necessary rights for the
+ * schema compiler to write the files
+ * 2.package name
+ * 3.namespace to package map
+ * 4.boolean flag marking whether to wrap or unwrap
+ * 4.boolean flag marking whether to write classes or not
+ */
+public class CompilerOptions {
+
+    /**
+     * Generated output file
+     */
+    private File outputLocation;
+    private String packageName = null;
+
+    /**
+     * Keep track of the namespace and packages mapping
+     */
+    private Map ns2PackageMap = new HashMap();
+
+    public Map getNs2PackageMap() {
+        return ns2PackageMap;
+    }
+
+    public void setNs2PackageMap(Map ns2PackageMap) {
+        this.ns2PackageMap = ns2PackageMap;
+    }
+
+    /**
+     * This flag tells the databinder to either write the output or
+     * not. if this is set to true it will write the output at once.
+     * if not the outputter will populate the 
+     */
+    private boolean writeOutput = false;
+
+    /**
+     * This flag determines whether the generated classes are wrapped or not
+     * if the wrapper flag is true, then only a single file will be generated
+     */
+    private boolean wrapClasses = false;
+
+    public boolean isWriteOutput() {
+        return writeOutput;
+    }
+
+    public void setWriteOutput(boolean writeOutput) {
+        this.writeOutput = writeOutput;
+    }
+
+    public boolean isWrapClasses() {
+        return wrapClasses;
+    }
+
+    public void setWrapClasses(boolean wrapClasses) {
+        this.wrapClasses = wrapClasses;
+    }
+
+    public String getPackageName() {
+        return packageName;
+    }
+
+    public CompilerOptions setPackageName(String packageName) {
+        // Validate the package name.
+        if (packageName != null && testValue(packageName)) {
+            this.packageName = packageName;
+        } else {
+            throw new RuntimeException(SchemaCompilerMessages.getMessage("schema.unsupportedvalue"));
+        }
+        return this;
+    }
+
+    public File getOutputLocation() {
+        return outputLocation;
+    }
+
+    public CompilerOptions setOutputLocation(File outputLocation) {
+        this.outputLocation = outputLocation;
+        return this;
+    }
+
+    private boolean testValue(String wordToMatch) {
+        Pattern pat = Pattern.compile("^(\\w+\\.)+$");
+        Matcher m = pat.matcher(wordToMatch);
+        return m.matches();
+    }
+}

Added: 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?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java Wed May 31 04:35:30 2006
@@ -0,0 +1,174 @@
+package org.apache.axis2.schema;
+
+import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
+import org.apache.axis2.wsdl.databinding.JavaTypeMapper;
+import org.apache.axis2.wsdl.databinding.DefaultTypeMapper;
+import org.apache.axis2.wsdl.util.XSLTConstants;
+
+import javax.xml.namespace.QName;
+import java.util.Map;
+import java.util.Iterator;
+import java.util.HashMap;
+import java.util.List;
+import java.io.File;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * This is the utility for the extension to call
+ */
+public class ExtensionUtility {
+
+    public static void invoke(CodeGenConfiguration configuration) throws Exception{
+        List schemaList = configuration.getAxisService().getSchema();
+        if (schemaList == null || schemaList.isEmpty()) {
+            //there are no types to be code generated
+            //However if the type mapper is left empty it will be a problem for the other
+            //processes. Hence the default type mapper is set to the configuration
+            configuration.setTypeMapper(new DefaultTypeMapper());
+            return;
+        }
+        //call the schema compiler
+        CompilerOptions options = new CompilerOptions();
+
+        //set the default options
+        populateDefaultOptions(options,configuration);
+
+        //set the user parameters. the user parameters get the preference over
+        //the default ones. But the user better know what he's doing if he
+        //used module specific parameters
+        populateUserparameters(options,configuration);
+
+        SchemaCompiler schemaCompiler = new SchemaCompiler(options);
+        // run the schema compiler
+        schemaCompiler.compile(schemaList);
+
+        //create the type mapper
+        JavaTypeMapper mapper = new JavaTypeMapper();
+
+        if (options.isWriteOutput()){
+            //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.addTypeMappingName(qNameKey, processedMap.get(qNameKey).toString());
+            }
+
+        }else{
+            //get the processed model map and transfer it to the type mapper
+            //since the options mentiond that its not writable, it should have
+            //populated the model map
+            Map processedModelMap = schemaCompiler.getProcessedModelMap();
+            Iterator processedkeys = processedModelMap.keySet().iterator();
+            QName qNameKey;
+            while (processedkeys.hasNext()) {
+                qNameKey = (QName) processedkeys.next();
+                mapper.addTypeMappingObject(qNameKey, processedModelMap.get(qNameKey));
+            }
+
+            Map processedMap = schemaCompiler.getProcessedElementMap();
+            processedkeys = processedMap.keySet().iterator();
+            while (processedkeys.hasNext()) {
+                qNameKey = (QName) processedkeys.next();
+                mapper.addTypeMappingName(qNameKey, processedMap.get(qNameKey).toString());
+            }
+
+            //get the ADB template from the schema compilers property bag and set the
+            //template
+            configuration.putProperty(XSLTConstants.EXTERNAL_TEMPLATE_PROPERTY_KEY,
+                    schemaCompiler.getCompilerProperties().getProperty(
+                            SchemaConstants.SchemaPropertyNames.BEAN_WRITER_TEMPLATE_KEY));
+
+        }
+
+        //set the type mapper to the config
+        configuration.setTypeMapper(mapper);
+
+    }
+
+    /**
+     *
+     * @param options
+     */
+    private static void populateUserparameters(CompilerOptions options,CodeGenConfiguration configuration){
+        Map propertyMap = configuration.getProperties();
+        if (propertyMap.containsKey(SchemaConstants.SchemaCompilerArguments.WRAP_SCHEMA_CLASSES)){
+            if (Boolean.valueOf(
+                    propertyMap.get(SchemaConstants.SchemaCompilerArguments.WRAP_SCHEMA_CLASSES).toString()).
+                    booleanValue()) {
+                options.setWrapClasses(true);
+            }else{
+                options.setWrapClasses(false);
+            }
+        }
+
+        if (propertyMap.containsKey(SchemaConstants.SchemaCompilerArguments.WRITE_SCHEMA_CLASSES)){
+            if (Boolean.valueOf(
+                    propertyMap.get(SchemaConstants.SchemaCompilerArguments.WRITE_SCHEMA_CLASSES).toString()).
+                    booleanValue()) {
+                options.setWriteOutput(true);
+            }else{
+                options.setWriteOutput(false);
+            }
+        }
+
+        // add the custom package name
+        if (propertyMap.containsKey(SchemaConstants.SchemaCompilerArguments.PACKAGE)){
+            String packageName = (String)propertyMap.get(SchemaConstants.SchemaCompilerArguments.PACKAGE);
+            if (packageName!=null || !"".equals(packageName)){
+                options.setPackageName(packageName);
+            }
+
+        }
+    }
+
+
+    /**
+     *
+     * @param options
+     */
+    private static void populateDefaultOptions(CompilerOptions options,CodeGenConfiguration configuration) {
+        //create the output directory
+        File outputDir = new File(configuration.getOutputLocation(), "src");
+        if(!outputDir.exists()) {
+            outputDir.mkdirs();
+        }
+
+        /// these options need to be taken from the command line
+        options.setOutputLocation(outputDir);
+        options.setNs2PackageMap(configuration.getUri2PackageNameMap()==null?
+                new HashMap():
+                configuration.getUri2PackageNameMap());
+
+        //default setting is to set the wrap status depending on whether it's
+        //the server side or the client side
+        if (configuration.isServerSide()){
+            //for the serverside we generate unwrapped  by default
+            options.setWrapClasses(false);
+            //for the serverside we write the output by default
+            options.setWriteOutput(true);
+        }else{
+            // for the client let the users preference be the word here
+            options.setWrapClasses(configuration.isPackClasses());
+            //for the client side the default setting is not to write the
+            //output
+            options.setWriteOutput(!configuration.isPackClasses());
+        }
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompilationException.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompilationException.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompilationException.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompilationException.java Wed May 31 04:35:30 2006
@@ -0,0 +1,40 @@
+package org.apache.axis2.schema;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * A simeple extension from the java.lang.exception to serve as the schema compilers
+ * Exception
+ */
+public class SchemaCompilationException extends Exception {
+
+    private static final long serialVersionUID = 2520939560060608157L;
+
+	public SchemaCompilationException() {
+    }
+
+    public SchemaCompilationException(String message) {
+        super(message);
+    }
+
+    public SchemaCompilationException(Throwable cause) {
+        super(cause);
+    }
+
+    public SchemaCompilationException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}



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