You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by aj...@apache.org on 2006/05/31 13:35:36 UTC

svn commit: r410497 [4/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...

Added: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java Wed May 31 04:35:30 2006
@@ -0,0 +1,688 @@
+package org.apache.axis2.schema.writer;
+
+import org.apache.axis2.schema.BeanWriterMetaInfoHolder;
+import org.apache.axis2.schema.CompilerOptions;
+import org.apache.axis2.schema.SchemaCompilationException;
+import org.apache.axis2.schema.SchemaCompiler;
+import org.apache.axis2.schema.i18n.SchemaCompilerMessages;
+import org.apache.axis2.schema.typemap.JavaTypeMap;
+import org.apache.axis2.schema.util.PrimitiveTypeFinder;
+import org.apache.axis2.schema.util.SchemaPropertyLoader;
+import org.apache.axis2.util.JavaUtils;
+import org.apache.axis2.util.URLProcessor;
+import org.apache.axis2.util.XSLTTemplateProcessor;
+import org.apache.axis2.util.XSLTUtils;
+import org.apache.axis2.util.PrettyPrinter;
+import org.apache.ws.commons.schema.XmlSchemaComplexType;
+import org.apache.ws.commons.schema.XmlSchemaElement;
+import org.apache.ws.commons.schema.XmlSchemaSimpleType;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import javax.xml.namespace.QName;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Templates;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamSource;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/*
+ * 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.
+ */
+
+/**
+ * Java Bean writer for the schema compiler.
+ */
+public class JavaBeanWriter implements BeanWriter {
+
+    public static final String WRAPPED_DATABINDING_CLASS_NAME = "WrappedDatabinder";
+
+    private String javaBeanTemplateName = null;
+    private boolean templateLoaded = false;
+    private Templates templateCache;
+
+    private List namesList;
+    private static int count = 0;
+    private boolean wrapClasses = false;
+    private boolean writeClasses=false;
+
+    private String packageName = null;
+    private File rootDir;
+
+    private Document globalWrappedDocument;
+
+    private Map modelMap = new HashMap();
+    private static final String DEFAULT_PACKAGE = "adb";
+
+    private Map baseTypeMap = new JavaTypeMap().getTypeMap();
+
+    private Map ns2packageNameMap = new HashMap();
+
+    /**
+     * Default constructor
+     */
+    public JavaBeanWriter() {
+    }
+
+    /**
+     * This returns a map of Qnames vs DOMDocument models. One can use this method to
+     * obtain the raw DOMmodels used to write the classes.
+     * This has no meaning when the classes are supposed to be wrapped  so the
+     *
+     * @see org.apache.axis2.schema.writer.BeanWriter#getModelMap()
+     * @return Returns Map.
+     * @throws SchemaCompilationException
+     */
+    public Map getModelMap(){
+        return modelMap;
+    }
+
+    public void init(CompilerOptions options) throws SchemaCompilationException {
+        try {
+            initWithFile(options.getOutputLocation());
+            packageName = options.getPackageName();
+            writeClasses = options.isWriteOutput();
+            if (!writeClasses){
+                wrapClasses = false;
+            }else{
+                wrapClasses = options.isWrapClasses();
+            }
+
+            //if the wrap mode is set then create a global document to keep the wrapped
+            //element models
+            if (options.isWrapClasses()) {
+                globalWrappedDocument = XSLTUtils.getDocument();
+                Element rootElement = XSLTUtils.getElement(globalWrappedDocument, "beans");
+                globalWrappedDocument.appendChild(rootElement);
+                XSLTUtils.addAttribute(globalWrappedDocument, "name", WRAPPED_DATABINDING_CLASS_NAME, rootElement);
+                String tempPackageName;
+
+                if (packageName !=null && packageName.endsWith(".")) {
+                    tempPackageName = this.packageName.substring(0, this.packageName.lastIndexOf("."));
+                }else{
+                    tempPackageName = DEFAULT_PACKAGE;
+                }
+
+                XSLTUtils.addAttribute(globalWrappedDocument, "package", tempPackageName, rootElement);
+            }
+
+            //add the ns mappings
+            this.ns2packageNameMap = options.getNs2PackageMap();
+
+        } catch (IOException e) {
+            throw new SchemaCompilationException(e);
+        } catch (ParserConfigurationException e) {
+            throw new SchemaCompilationException(e); //todo need to put correct error messages
+        }
+    }
+
+    /**
+     * @param element
+     * @param typeMap
+     * @param metainf
+     * @return Returns String.
+     * @throws SchemaCompilationException
+     */
+    public String write(XmlSchemaElement element, Map typeMap, BeanWriterMetaInfoHolder metainf) throws SchemaCompilationException {
+
+        try {
+            QName qName = element.getQName();
+
+            return process(qName, metainf, typeMap, true, null);
+        } catch (Exception e) {
+            throw new SchemaCompilationException(e);
+        }
+
+
+    }
+
+    /**
+     * @param complexType
+     * @param typeMap
+     * @param metainf
+     * @param fullyQualifiedClassName the name returned by makeFullyQualifiedClassName() or null if it wasn't called
+     * @throws org.apache.axis2.schema.SchemaCompilationException
+     *
+     * @see BeanWriter#write(org.apache.ws.commons.schema.XmlSchemaComplexType, java.util.Map, org.apache.axis2.schema.BeanWriterMetaInfoHolder)
+     */
+    public String write(XmlSchemaComplexType complexType, Map typeMap, BeanWriterMetaInfoHolder metainf, String fullyQualifiedClassName)
+            throws SchemaCompilationException {
+
+        try {
+            //determine the package for this type.
+            QName qName = complexType.getQName();
+            return process(qName, metainf, typeMap, false, fullyQualifiedClassName);
+
+        } catch (SchemaCompilationException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new SchemaCompilationException(e);
+        }
+
+
+    }
+
+    /**
+     * @throws Exception
+     * @see BeanWriter#writeBatch()
+     */
+    public void writeBatch() throws SchemaCompilationException {
+        try {
+            if (wrapClasses) {
+                String tempPackage ;
+                if (packageName==null){
+                    tempPackage = DEFAULT_PACKAGE;
+                }else{
+                    tempPackage = packageName;
+                }
+                File out = createOutFile(tempPackage, WRAPPED_DATABINDING_CLASS_NAME);
+                //parse with the template and create the files
+                parse(globalWrappedDocument, out);
+            }
+        } catch (Exception e) {
+            throw new SchemaCompilationException(e);
+        }
+    }
+
+    /**
+     * @param simpleType
+     * @param typeMap
+     * @param metainf
+     * @return Returns String.
+     * @throws SchemaCompilationException
+     * @see BeanWriter#write(org.apache.ws.commons.schema.XmlSchemaSimpleType, java.util.Map, org.apache.axis2.schema.BeanWriterMetaInfoHolder)
+     */
+    public String write(XmlSchemaSimpleType simpleType, Map typeMap, BeanWriterMetaInfoHolder metainf) throws SchemaCompilationException {
+        throw new SchemaCompilationException(SchemaCompilerMessages.getMessage("schema.notimplementedxception"));
+    }
+
+    /**
+     * @param rootDir
+     * @throws IOException
+     * @see BeanWriter#init(java.io.File)
+     */
+    private void initWithFile(File rootDir) throws IOException {
+        if (rootDir == null) {
+            this.rootDir = new File(".");
+        } else if (!rootDir.isDirectory()) {
+            throw new IOException(SchemaCompilerMessages.getMessage("schema.rootnotfolderexception"));
+        } else {
+            this.rootDir = rootDir;
+        }
+
+        namesList = new ArrayList();
+        javaBeanTemplateName = SchemaPropertyLoader.getBeanTemplate();
+    }
+
+
+    /** Make the fully qualified class name for an element or named type
+     * @param qName the qualified Name for this element or type in the schema
+     * @return the appropriate fully qualified class name to use in generated code
+     */
+    public String makeFullyQualifiedClassName(QName qName) {
+
+        String namespaceURI = qName.getNamespaceURI();
+        String basePackageName;
+
+        if (ns2packageNameMap.containsKey(namespaceURI)){
+            basePackageName = (String)ns2packageNameMap.get(namespaceURI);
+        }else{
+            basePackageName = URLProcessor.makePackageName(namespaceURI);
+        }
+
+        String packageName = this.packageName == null ?
+                basePackageName :
+                this.packageName + basePackageName;
+
+        String originalName = qName.getLocalPart();
+        String className = makeUniqueJavaClassName(this.namesList, originalName);
+
+        String packagePrefix = null;
+
+        String fullyqualifiedClassName;
+
+        if (wrapClasses)
+            packagePrefix =  (this.packageName == null ? DEFAULT_PACKAGE+"." : this.packageName) + WRAPPED_DATABINDING_CLASS_NAME;
+        else if (writeClasses)
+            packagePrefix = packageName;
+        if (packagePrefix!=null)
+            fullyqualifiedClassName = packagePrefix + (packagePrefix.endsWith(".")?"":".") + className;
+        else
+            fullyqualifiedClassName = className;
+        //return the fully qualified class name
+        return fullyqualifiedClassName;
+    }
+
+    /**
+     * A util method that holds common code
+     * for the complete schema that the generated XML complies to
+     * look under other/beanGenerationSchema.xsd
+     *
+     * @param qName
+     * @param metainf
+     * @param typeMap
+     * @param isElement
+     * @param fullyQualifiedClassName the name returned by makeFullyQualifiedClassName() or null if it wasn't called
+     * @return Returns String.
+     * @throws Exception
+     */
+    private String process(QName qName, BeanWriterMetaInfoHolder metainf, Map typeMap, boolean isElement, String fullyQualifiedClassName) throws Exception {
+
+        if (fullyQualifiedClassName == null)
+            fullyQualifiedClassName = makeFullyQualifiedClassName(qName);
+        String className = fullyQualifiedClassName.substring(1+fullyQualifiedClassName.lastIndexOf('.'));
+        String basePackageName;
+        if (fullyQualifiedClassName.lastIndexOf('.')==-1){// no 'dots' so the package is not there
+             basePackageName = "";
+        }else{
+            basePackageName = fullyQualifiedClassName.substring(0,fullyQualifiedClassName.lastIndexOf('.'));
+        }
+
+        String originalName = qName.getLocalPart();
+        ArrayList propertyNames = new ArrayList();
+
+        if (!templateLoaded) {
+            loadTemplate();
+        }
+
+        //if wrapped then do not write the classes now but add the models to a global document. However in order to write the
+        //global class that is generated, one needs to call the writeBatch() method
+        if (wrapClasses) {
+            globalWrappedDocument.getDocumentElement().appendChild(
+                    getBeanElement(globalWrappedDocument, className, originalName, basePackageName, qName, isElement, metainf, propertyNames, typeMap)
+            );
+
+        } else {
+            //create the model
+            Document model = XSLTUtils.getDocument();
+            //make the XML
+            model.appendChild(getBeanElement(model, className, originalName, basePackageName, qName, isElement, metainf, propertyNames, typeMap));
+
+            if (writeClasses){
+                //create the file
+                File out = createOutFile(basePackageName, className);
+                //parse with the template and create the files
+                parse(model, out);
+            }
+
+            //add the model to the model map
+            modelMap.put(
+                    new QName(qName.getNamespaceURI(),className)
+                    ,model);
+
+
+        }
+
+        //return the fully qualified class name
+        return fullyQualifiedClassName;
+
+    }
+
+
+    /**
+     * @param model
+     * @param className
+     * @param originalName
+     * @param packageName
+     * @param qName
+     * @param isElement
+     * @param metainf
+     * @param propertyNames
+     * @param typeMap
+     * @return Returns Element.
+     * @throws SchemaCompilationException
+     */
+    private Element getBeanElement(
+            Document model, String className, String originalName,
+            String packageName, QName qName, boolean isElement,
+            BeanWriterMetaInfoHolder metainf, ArrayList propertyNames, Map typeMap
+    ) throws SchemaCompilationException {
+
+        Element rootElt = XSLTUtils.getElement(model, "bean");
+        XSLTUtils.addAttribute(model, "name", className, rootElt);
+        XSLTUtils.addAttribute(model, "originalName", originalName, rootElt);
+        XSLTUtils.addAttribute(model, "package", packageName, rootElt);
+        XSLTUtils.addAttribute(model, "nsuri", qName.getNamespaceURI(), rootElt);
+        XSLTUtils.addAttribute(model, "nsprefix", getPrefixForURI(qName.getNamespaceURI(), qName.getPrefix()), rootElt);
+
+        if (!wrapClasses) {
+            XSLTUtils.addAttribute(model, "unwrapped", "yes", rootElt);
+        }
+
+        if (!writeClasses){
+            XSLTUtils.addAttribute(model, "skip-write", "yes", rootElt);
+        }
+
+        if (!isElement) {
+            XSLTUtils.addAttribute(model, "type", "yes", rootElt);
+        }
+
+        if (metainf.isAnonymous()) {
+            XSLTUtils.addAttribute(model, "anon", "yes", rootElt);
+        }
+
+        if (metainf.isExtension()) {
+            XSLTUtils.addAttribute(model, "extension", metainf.getExtensionClassName(), rootElt);
+        }
+
+
+        if (metainf.isChoice()) {
+            XSLTUtils.addAttribute(model, "choice", "yes", rootElt);
+        }
+
+        if (metainf.isOrdered()) {
+            XSLTUtils.addAttribute(model, "ordered", "yes", rootElt);
+        }
+
+        if (isElement && metainf.isNillable(qName)) {
+            XSLTUtils.addAttribute(model, "nillable", "yes", rootElt);
+        }
+
+        //populate all the information
+        populateInfo(metainf, model, rootElt, propertyNames, typeMap,false);
+
+
+        return rootElt;
+    }
+
+    /**
+     *
+     * @param metainf
+     * @param model
+     * @param rootElt
+     * @param propertyNames
+     * @param typeMap
+     * @throws SchemaCompilationException
+     */
+    private void populateInfo(BeanWriterMetaInfoHolder metainf,
+                              Document model,
+                              Element rootElt,
+                              ArrayList propertyNames,
+                              Map typeMap,boolean isInherited)throws SchemaCompilationException{
+        if (metainf.getParent()!=null){
+            populateInfo(metainf.getParent(),model,rootElt,propertyNames,typeMap,true);
+        }
+        addPropertyEntries(metainf, model, rootElt, propertyNames, typeMap,isInherited);
+
+    }
+
+    /**
+     *
+     * @param metainf
+     * @param model
+     * @param rootElt
+     * @param propertyNames
+     * @param typeMap
+     * @throws SchemaCompilationException
+     */
+    private void addPropertyEntries(BeanWriterMetaInfoHolder metainf, Document model, Element rootElt, ArrayList propertyNames,
+                                    Map typeMap,
+                                    boolean isInherited) throws SchemaCompilationException {
+        // go in the loop and add the part elements
+        QName[] qNames;
+        if (metainf.isOrdered()) {
+            qNames = metainf.getOrderedQNameArray();
+        } else {
+            qNames = metainf.getQNameArray();
+        }
+
+        QName name;
+        for (int i = 0; i < qNames.length; i++) {
+            Element property = XSLTUtils.addChildElement(model, "property", rootElt);
+            name = qNames[i];
+            String xmlName = name.getLocalPart();
+            XSLTUtils.addAttribute(model, "name", xmlName, property);
+            XSLTUtils.addAttribute(model, "nsuri", name.getNamespaceURI(), property);
+            String javaName = makeUniqueJavaClassName(propertyNames, xmlName);
+            XSLTUtils.addAttribute(model, "javaname", javaName, property);
+
+            String javaClassNameForElement = metainf.getClassNameForQName(name);
+
+
+            if (javaClassNameForElement == null) {
+                throw new SchemaCompilationException(SchemaCompilerMessages.getMessage("schema.typeMissing"));
+            }
+
+            XSLTUtils.addAttribute(model, "type", javaClassNameForElement, property);
+
+            if (PrimitiveTypeFinder.isPrimitive(javaClassNameForElement)){
+                XSLTUtils.addAttribute(model, "primitive", "yes", property);
+            }
+            //add an attribute that says the type is default
+            if (isDefault(javaClassNameForElement)){
+                XSLTUtils.addAttribute(model, "default", "yes", property);
+            }
+
+            if (typeMap.containsKey(metainf.getSchemaQNameForQName(name))) {
+                XSLTUtils.addAttribute(model, "ours", "yes", property);
+            }
+
+            if (metainf.getAttributeStatusForQName(name)) {
+                XSLTUtils.addAttribute(model, "attribute", "yes", property);
+            }
+
+            if (metainf.isNillable(name)){
+                XSLTUtils.addAttribute(model, "nillable", "yes", property);
+            }
+
+            String shortTypeName;
+            if (metainf.getSchemaQNameForQName(name) != null) {
+                //see whether the QName is a basetype
+                if (baseTypeMap.containsKey(metainf.getSchemaQNameForQName(name))){
+                    shortTypeName= metainf.getSchemaQNameForQName(name).getLocalPart();
+                }else{
+                    shortTypeName =  getShortTypeName(javaClassNameForElement);
+                }
+            }else{
+                shortTypeName =  getShortTypeName(javaClassNameForElement);
+            }
+            XSLTUtils.addAttribute(model, "shorttypename", shortTypeName, property);
+
+            if (isInherited){
+                XSLTUtils.addAttribute(model, "inherited", "yes", property);
+            }
+
+            if (metainf.getAnyStatusForQName(name)) {
+                XSLTUtils.addAttribute(model, "any", "yes", property);
+            }
+
+            if (metainf.getBinaryStatusForQName(name)) {
+                XSLTUtils.addAttribute(model, "binary", "yes", property);
+            }
+            //put the min occurs count irrespective of whether it's an array or not
+            long minOccurs = metainf.getMinOccurs(name);
+            XSLTUtils.addAttribute(model, "minOccurs", minOccurs + "", property);
+
+
+            if (metainf.getArrayStatusForQName(name)) {
+
+                XSLTUtils.addAttribute(model, "array", "yes", property);
+                XSLTUtils.addAttribute(
+                        model,
+                        "arrayBaseType",
+                        javaClassNameForElement.substring(0, javaClassNameForElement.indexOf("[")),
+                        property);
+
+                long maxOccurs = metainf.getMaxOccurs(name);
+                if (maxOccurs == Long.MAX_VALUE) {
+                    XSLTUtils.addAttribute(model, "unbound", "yes", property);
+                } else {
+                    XSLTUtils.addAttribute(model, "maxOccurs", maxOccurs + "", property);
+                }
+            }
+        }
+    }
+
+    /**
+     * Test whether the given class name matches the default
+     * @param javaClassNameForElement
+     * @return
+     */
+    private boolean isDefault(String javaClassNameForElement) {
+        return SchemaCompiler.DEFAULT_CLASS_NAME.equals(javaClassNameForElement)||
+                SchemaCompiler.DEFAULT_CLASS_ARRAY_NAME.equals(javaClassNameForElement);
+    }
+
+
+    /**
+     * Given the xml name, make a unique class name taking into account that some
+     * file systems are case sensitive and some are not.
+     * -Consider the Jax-WS spec for this
+     * @param listOfNames
+     * @param xmlName
+     * @return Returns String.
+     */
+    private String makeUniqueJavaClassName(List listOfNames, String xmlName) {
+        String javaName;
+        if (JavaUtils.isJavaKeyword(xmlName)) {
+            javaName = JavaUtils.makeNonJavaKeyword(xmlName);
+        } else {
+            javaName = JavaUtils.capitalizeFirstChar(JavaUtils.xmlNameToJava(xmlName));
+        }
+
+        while (listOfNames.contains(javaName.toLowerCase())) {
+            javaName = javaName + count++;
+        }
+
+        listOfNames.add(javaName.toLowerCase());
+        return javaName;
+    }
+
+
+    /**
+     * A bit of code from the old code generator. We are better off using the template
+     * engines and such stuff that's already there. But the class writers are hard to be
+     * reused so some code needs to be repeated (atleast a bit)
+     */
+    private void loadTemplate() throws SchemaCompilationException {
+
+        //first get the language specific property map
+        Class clazz = this.getClass();
+        InputStream xslStream;
+        String templateName = javaBeanTemplateName;
+        if (templateName != null) {
+            try {
+                xslStream = clazz.getResourceAsStream(templateName);
+                templateCache = TransformerFactory.newInstance().newTemplates(new StreamSource(xslStream));
+                templateLoaded = true;
+            } catch (TransformerConfigurationException e) {
+                throw new SchemaCompilationException(SchemaCompilerMessages.getMessage("schema.templateLoadException"), e);
+            }
+        } else {
+            throw new SchemaCompilationException(SchemaCompilerMessages.getMessage("schema.templateNotFoundException"));
+        }
+    }
+
+
+    /**
+     * Creates the output file
+     *
+     * @param packageName
+     * @param fileName
+     * @throws Exception
+     */
+    private File createOutFile(String packageName, String fileName) throws Exception {
+        return org.apache.axis2.util.FileWriter.createClassFile(this.rootDir,
+                packageName,
+                fileName,
+                ".java");
+    }
+
+    /**
+     * Writes the output file
+     *
+     * @param doc
+     * @param outputFile
+     * @throws Exception
+     */
+    private void parse(Document doc, File outputFile) throws Exception {
+        OutputStream outStream = new FileOutputStream(outputFile);
+        XSLTTemplateProcessor.parse(outStream,
+                doc,
+                this.templateCache.newTransformer());
+        outStream.flush();
+        outStream.close();
+
+        PrettyPrinter.prettify(outputFile);
+    }
+
+    /**
+     * Get a prefix for a namespace URI.  This method will ALWAYS
+     * return a valid prefix - if the given URI is already mapped in this
+     * serialization, we return the previous prefix.  If it is not mapped,
+     * we will add a new mapping and return a generated prefix of the form
+     * "ns<num>".
+     *
+     * @param uri is the namespace uri
+     * @return Returns prefix.
+     */
+    public String getPrefixForURI(String uri) {
+        return getPrefixForURI(uri, null);
+    }
+
+    /**
+     * Last used index suffix for "ns"
+     */
+    private int lastPrefixIndex = 1;
+
+    /**
+     * Map of namespaces URI to prefix(es)
+     */
+    HashMap mapURItoPrefix = new HashMap();
+    HashMap mapPrefixtoURI = new HashMap();
+
+    /**
+     * Get a prefix for the given namespace URI.  If one has already been
+     * defined in this serialization, use that.  Otherwise, map the passed
+     * default prefix to the URI, and return that.  If a null default prefix
+     * is passed, use one of the form "ns<num>"
+     */
+    public String getPrefixForURI(String uri, String defaultPrefix) {
+        if ((uri == null) || (uri.length() == 0))
+            return null;
+        String prefix = (String) mapURItoPrefix.get(uri);
+        if (prefix == null) {
+            if (defaultPrefix == null || defaultPrefix.length() == 0) {
+                prefix = "ns" + lastPrefixIndex++;
+                while (mapPrefixtoURI.get(prefix) != null) {
+                    prefix = "ns" + lastPrefixIndex++;
+                }
+            } else {
+                prefix = defaultPrefix;
+            }
+            mapPrefixtoURI.put(prefix, uri);
+            mapURItoPrefix.put(uri, prefix);
+        }
+        return prefix;
+    }
+
+    private String getShortTypeName(String typeClassName){
+        if (typeClassName.endsWith("[]")){
+            typeClassName = typeClassName.substring(0,typeClassName.lastIndexOf("["));
+        }
+
+        return typeClassName.substring(typeClassName.lastIndexOf(".")+1, typeClassName.length());
+
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/anonymous_complexType.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/anonymous_complexType.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/anonymous_complexType.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/anonymous_complexType.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,15 @@
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:tns="http://soapinterop.org1/types"
+        targetNamespace="http://soapinterop.org1/types"
+        elementFormDefault="qualified">
+    <element name="tempElt">
+        <complexType>
+            <sequence>
+                <element name="varString" type="xsd:string"/>
+                <element name="varInt" type="xsd:int"/>
+                <element name="varFloat" type="xsd:float"/>
+            </sequence>
+        </complexType>
+    </element>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/complex-minoccurs0.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/complex-minoccurs0.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/complex-minoccurs0.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/complex-minoccurs0.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           elementFormDefault="qualified"
+           attributeFormDefault="unqualified"
+           targetNamespace="http://test1.org"
+           xmlns:tns="http://test1.org">
+	<xs:element name="root">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="city" type="xs:string"/>
+				<xs:element name="person" type="tns:personType" minOccurs="0"/>
+				<xs:element name="address" type="tns:addressType" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+    <xs:complexType name="personType">
+        <xs:sequence>
+            <xs:element name="name" type="xs:string"/>
+            <xs:element name="age" type="xs:int"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="addressType">
+        <xs:sequence>
+            <xs:element name="streetName" type="xs:string"/>
+            <xs:element name="streetNo" type="xs:int"/>
+        </xs:sequence>
+    </xs:complexType>
+</xs:schema>

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/complex_all.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/complex_all.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/complex_all.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/complex_all.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,75 @@
+<s:schema elementFormDefault="qualified" targetNamespace="http://www.strikeiron.com" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://www.strikeiron.com">
+      <s:element name="GetQuotes">
+        <s:complexType>
+          <s:sequence>
+            <s:element minOccurs="0" maxOccurs="1" name="TickerSymbolList" type="s:string" />
+          </s:sequence>
+        </s:complexType>
+
+      </s:element>
+      <s:element name="GetQuotesResponse">
+        <s:complexType>
+          <s:sequence>
+            <s:element minOccurs="0" maxOccurs="1" name="GetQuotesResult" type="s0:ArrayOfRealQuote" />
+          </s:sequence>
+        </s:complexType>
+      </s:element>
+      <s:complexType name="ArrayOfRealQuote">
+
+        <s:sequence>
+          <s:element minOccurs="0" maxOccurs="unbounded" name="RealQuote" nillable="true" type="s0:RealQuote" />
+        </s:sequence>
+      </s:complexType>
+      <s:complexType name="RealQuote">
+        <s:sequence>
+          <s:element minOccurs="0" maxOccurs="1" name="Symbol" type="s:string" />
+          <s:element minOccurs="0" maxOccurs="1" name="CUSIP" type="s:string" />
+          <s:element minOccurs="0" maxOccurs="1" name="CIK" type="s:string" />
+          <s:element minOccurs="0" maxOccurs="1" name="Name" type="s:string" />
+          <s:element minOccurs="0" maxOccurs="1" name="Date" type="s:string" />
+          <s:element minOccurs="0" maxOccurs="1" name="Time" type="s:string" />
+          <s:element minOccurs="1" maxOccurs="1" name="Last" type="s:double" />
+          <s:element minOccurs="1" maxOccurs="1" name="Quantity" type="s:int" />
+          <s:element minOccurs="1" maxOccurs="1" name="ChangeFromPrevious" type="s:double" />
+          <s:element minOccurs="1" maxOccurs="1" name="PercentChangeFromPrevious" type="s:double" />
+          <s:element minOccurs="1" maxOccurs="1" name="Open" type="s:double" />
+          <s:element minOccurs="1" maxOccurs="1" name="ChangeFromOpen" type="s:double" />
+
+          <s:element minOccurs="1" maxOccurs="1" name="PercentChangeFromOpen" type="s:double" />
+          <s:element minOccurs="1" maxOccurs="1" name="Bid" type="s:double" />
+          <s:element minOccurs="1" maxOccurs="1" name="Ask" type="s:double" />
+          <s:element minOccurs="1" maxOccurs="1" name="Spread" type="s:double" />
+          <s:element minOccurs="1" maxOccurs="1" name="BidQuantity" type="s:int" />
+          <s:element minOccurs="1" maxOccurs="1" name="AskQuantity" type="s:int" />
+          <s:element minOccurs="1" maxOccurs="1" name="Volume" type="s:int" />
+          <s:element minOccurs="1" maxOccurs="1" name="ECNVolume" type="s:int" />
+          <s:element minOccurs="1" maxOccurs="1" name="Highest" type="s:double" />
+
+          <s:element minOccurs="1" maxOccurs="1" name="Lowest" type="s:double" />
+          <s:element minOccurs="0" maxOccurs="1" name="Rank" type="s:string" />
+        </s:sequence>
+      </s:complexType>
+      <s:element name="ResponseInfo" type="s0:ResponseInfo" />
+      <s:complexType name="ResponseInfo">
+        <s:sequence>
+          <s:element minOccurs="1" maxOccurs="1" name="ResponseCode" type="s:int" />
+          <s:element minOccurs="0" maxOccurs="1" name="Response" type="s:string" />
+
+        </s:sequence>
+      </s:complexType>
+      <s:element name="GetOneQuote">
+        <s:complexType>
+          <s:sequence>
+            <s:element minOccurs="0" maxOccurs="1" name="TickerSymbol" type="s:string" />
+          </s:sequence>
+        </s:complexType>
+      </s:element>
+
+      <s:element name="GetOneQuoteResponse">
+        <s:complexType>
+          <s:sequence>
+            <s:element minOccurs="0" maxOccurs="1" name="GetOneQuoteResult" type="s0:RealQuote" />
+          </s:sequence>
+        </s:complexType>
+      </s:element>
+    </s:schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/complex_content_extension.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/complex_content_extension.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/complex_content_extension.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/complex_content_extension.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,28 @@
+<schema elementFormDefault="qualified"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:tns="urn:sobject.enterprise.soap.sforce.com"
+        targetNamespace="urn:sobject.enterprise.soap.sforce.com">
+    <complexType name="sObject">
+        <sequence>
+            <element name="fieldsToNull"  type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+            <element name="Id" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="1" />
+        </sequence>
+    </complexType>
+    <complexType name="Account">
+        <complexContent>
+            <extension base="tns:sObject">
+                <sequence>
+                    <element name="AccountNumber" nillable="true" minOccurs="0" type="xsd:string"/>
+                    <element name="Active__c" nillable="true" minOccurs="0" type="xsd:string"/>
+                    <element name="AnnualRevenue" nillable="true" minOccurs="0" type="xsd:double"/>
+                    <element name="BillingCity" nillable="true" minOccurs="0" type="xsd:string"/>
+                    <element name="BillingCountry" nillable="true" minOccurs="0" type="xsd:string"/>
+                    <element name="BillingPostalCode" nillable="true" minOccurs="0" type="xsd:string"/>
+                    <element name="BillingState" nillable="true" minOccurs="0" type="xsd:string"/>
+                </sequence>
+            </extension>
+        </complexContent>
+    </complexType>
+    <element name="Account" type="tns:Account"/>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/derived/derivedType-All.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/derived/derivedType-All.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/derived/derivedType-All.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/derived/derivedType-All.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,33 @@
+<schema targetNamespace="http://soapinterop.org/xsd"
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xs="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd1="http://soapinterop.org/xsd"
+        elementFormDefault="qualified">
+
+    <xs:element name="DerivedPositiveInteger" type="xs:positiveInteger"/>
+	<xs:element name="DerivedNegativeInteger" type="xs:negativeInteger"/>
+	<xs:element name="DerivedNonNegativeInteger" type="xs:nonNegativeInteger"/>
+	<xs:element name="DerivedNonPositiveInteger" type="xs:nonPositiveInteger"/>
+	<xs:element name="DerivedUnsignedShort" type="xs:unsignedShort"/>
+	<xs:element name="DerivedUnsignedLong" type="xs:unsignedLong"/>
+	<xs:element name="DerivedUnsignedInt" type="xs:unsignedInt"/>
+	<xs:element name="DerivedUnsignedByte" type="xs:unsignedByte"/>
+	<xs:element name="DerivedLong" type="xs:long"/>
+	<xs:element name="DerivedShort" type="xs:short"/>
+	<xs:element name="DerivedInt" type="xs:int"/>
+	<xs:element name="DerivedByte" type="xs:byte"/>
+	<xs:element name="DerivedToken" type="xs:token"/>
+	<xs:element name="DerivedLanguage" type="xs:language"/>
+	<xs:element name="DerivedNMTOKEN" type="xs:NMTOKEN"/>
+	<xs:element name="DerivedNMTOKENS" type="xs:NMTOKENS"/>
+	<xs:element name="DerivedID" type="xs:ID"/>
+	<xs:element name="DerivedIDRef" type="xs:IDREF"/>
+	<xs:element name="DerivedEntity" type="xs:ENTITY"/>
+	<xs:element name="DerivedEntities" type="xs:ENTITIES"/>
+	<xs:element name="DerivedName" type="xs:Name"/>
+	<xs:element name="DerivedNameToken" type="xs:NMTOKEN"/>
+	<xs:element name="DerivedNCName" type="xs:NCName"/>
+	<xs:element name="DerivedNormalizedString" type="xs:normalizedString"/>
+	<xs:element name="DerivedInteger" type="xs:integer"/>
+
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/import.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/import.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/import.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/import.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,10 @@
+<schema targetNamespace="http://soapinterop.org/xsd"
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd1="http://soapinterop.org/xsd"
+        xmlns:xsd2="http://soapinterop.org/xsd2"
+        elementFormDefault="qualified">
+    <import namespace="http://soapinterop.org/xsd2" schemaLocation="import2.xsd"></import>
+    <element name="echoStructParam" type="xsd2:SOAPStruct"/>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/import2.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/import2.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/import2.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/import2.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,14 @@
+<schema targetNamespace="http://soapinterop.org/xsd2"
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd1="http://soapinterop.org/xsd2"
+        elementFormDefault="qualified">
+    <complexType name="SOAPStruct">
+        <all>
+            <element name="varFloat" type="xsd:float"/>
+            <element name="varInt" type="xsd:int"/>
+            <element name="varString" type="xsd:string"/>
+        </all>
+    </complexType>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/mixed_minoccus0.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/mixed_minoccus0.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/mixed_minoccus0.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/mixed_minoccus0.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,23 @@
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:tns="http://recursion1.org"
+        targetNamespace="http://recursion1.org"
+        elementFormDefault="qualified">
+    <xsd:element name="stringListResponseElement" type="tns:StringListResponseType"/>
+    <xsd:complexType name="StringListResponseType">
+        <xsd:choice>
+            <xsd:element name="stringList" type="tns:StringList"/>
+            <xsd:element name="exception" type="tns:ExceptionType"/>
+        </xsd:choice>
+    </xsd:complexType>
+    <xsd:complexType name="StringList">
+        <xsd:sequence>
+            <xsd:element name="s" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:complexType>
+     <xsd:complexType name="ExceptionType">
+        <xsd:sequence>
+            <xsd:element name="message" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:complexType>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple-minoccurs0.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple-minoccurs0.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple-minoccurs0.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple-minoccurs0.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" targetNamespace="http://test.org">
+	<xs:element name="root">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="A" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
+				<xs:element name="B" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element name="C" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element name="D" type="xs:string" minOccurs="0" maxOccurs="1"/>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+</xs:schema>

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple-recursive-datatypes.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple-recursive-datatypes.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple-recursive-datatypes.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple-recursive-datatypes.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,12 @@
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:tns="http://recursion.org"
+        targetNamespace="http://recursion.org"
+        elementFormDefault="qualified">
+    <complexType name="TypeE">
+        <sequence>
+            <element name="E" type="xsd:string"/>
+        </sequence>
+    </complexType>
+    <element name="E" type="tns:TypeE"/>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple/simpleType-All.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple/simpleType-All.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple/simpleType-All.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple/simpleType-All.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,24 @@
+<schema targetNamespace="http://soapinterop.org/xsd"
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd1="http://soapinterop.org/xsd"
+        elementFormDefault="qualified">
+    <element name="dateParam" type="xsd:date"/>
+    <element name="dateTimeParam" type="xsd:dateTime"/>
+    <element name="dayParam" type="xsd:gDay"/>
+    <element name="durationParam" type="xsd:duration"/>
+    <element name="monthParam" type="xsd:gMonth"/>
+    <element name="monthDayParam" type="xsd:gMonthDay"/>
+    <element name="timeParam" type="xsd:time"/>
+    <element name="yearParam" type="xsd:gYear"/>
+    <element name="yearMonthParam" type="xsd:gYearMonth"/>
+    <element name="doubleParam" type="xsd:double"/>
+    <element name="stringParam" type="xsd:string"/>
+	<element name="booleanParam" type="xsd:boolean"/>
+	<element name="decimalParam" type="xsd:decimal"/>
+	<element name="floatParam" type="xsd:float"/>
+	<element name="hexBinParam" type="xsd:hexBinary"/>
+	<element name="base64BinParam" type="xsd:base64Binary"/>
+	<element name="anyURIParam" type="xsd:anyURI"/>
+	<element name="qNameParam" type="xsd:QName"/>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_any.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_any.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_any.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_any.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,17 @@
+<schema targetNamespace="http://soapinterop.org/xsd"
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd1="http://soapinterop.org/xsd"
+        elementFormDefault="qualified">
+    <complexType name="SOAPStruct">
+        <sequence>
+            <element name="varFloat" type="xsd:float"/>
+            <element name="varInt" type="xsd:int"/>
+            <element name="varString" type="xsd:string"/>
+            <any/>  <!-- note the inclusion of any here -->
+        </sequence>
+
+    </complexType>
+    <element name="myobject" type="xsd1:SOAPStruct"/>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_any_attribute.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_any_attribute.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_any_attribute.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_any_attribute.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,16 @@
+<schema targetNamespace="http://soapinterop.org/xsd"
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd1="http://soapinterop.org/xsd"
+        elementFormDefault="qualified">
+    <complexType name="SOAPStruct">
+        <sequence>
+            <element name="varFloat" type="xsd:float"/>
+            <element name="varInt" type="xsd:int"/>
+            <element name="varString" type="xsd:string"/>
+        </sequence>
+     <anyAttribute />
+    </complexType>
+    <element name="myobject" type="xsd1:SOAPStruct"/>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_anytype.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_anytype.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_anytype.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_anytype.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,9 @@
+<schema targetNamespace="http://soapinterop.org/xsd2"
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd1="http://soapinterop.org/xsd"
+        elementFormDefault="qualified">
+
+    <element name="myObject" type="xsd:anyType"/>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_attrib.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_attrib.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_attrib.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_attrib.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,22 @@
+<schema targetNamespace="http://soapinterop.org/xsd"
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd1="http://soapinterop.org/xsd"
+        elementFormDefault="qualified">
+    <complexType name="SOAPStruct">
+        <all>
+            <element name="varFloat" type="xsd:float"/>
+            <element name="varInt" type="xsd:int"/>
+            <element name="varString" type="xsd:string"/>
+        </all>
+        <attribute name="type1" type="xsd:string"></attribute>
+        <attribute name="type2" type="xsd:string"></attribute>
+        <attribute name="type3" type="xsd:int"></attribute>
+        <attribute name="type4" type="xsd:float"></attribute>
+    </complexType>
+    <element name="echoStringParam" type="xsd:string"/>
+    <element name="echoStringReturn" type="xsd:string"/>
+    <element name="echoStructParam" type="xsd1:SOAPStruct"/>
+    <element name="echoStructReturn" type="xsd1:SOAPStruct"/>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_choice.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_choice.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_choice.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_choice.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,14 @@
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:tns="http://soapinterop.org/types"
+        targetNamespace="http://soapinterop.org/types"
+        elementFormDefault="qualified">
+      <complexType name="SOAPStruct">
+        <choice>
+            <element name="varString" type="xsd:string"/>
+            <element name="varInt" type="xsd:int"/>
+            <element name="varFloat" type="xsd:float"/>
+        </choice>
+    </complexType>
+    <element name="myElement" type="tns:SOAPStruct"/>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_element.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_element.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_element.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_element.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,18 @@
+<schema targetNamespace="http://soapinterop.org/xsd"
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd1="http://soapinterop.org/xsd"
+        elementFormDefault="qualified">
+    <complexType name="SOAPStruct">
+        <all>
+            <element name="varFloat" type="xsd:float"/>
+            <element name="varInt" type="xsd:int"/>
+            <element name="varString" type="xsd:string"/>
+        </all>
+    </complexType>
+    <element name="echoStringParam" type="xsd:string"/>
+    <element name="echoStringReturn" type="xsd:string"/>
+    <element name="echoStructParam" type="xsd1:SOAPStruct"/>
+    <element name="echoStructReturn" type="xsd1:SOAPStruct"/>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_element_reference.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_element_reference.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_element_reference.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_element_reference.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,16 @@
+<schema elementFormDefault="qualified"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:tns="urn:sobject.enterprise.soap.sforce.com"
+        targetNamespace="urn:sobject.enterprise.soap.sforce.com">
+    <complexType name="sObject">
+        <sequence>
+            <element ref="tns:fieldsToNull" />
+            <element ref="tns:Id" />
+        </sequence>
+    </complexType>
+    <element name="fieldsToNull"  type="xsd:string" />
+    <element name="Id"  type="xsd:string" />
+    <element name="Account" type="tns:sObject"/>
+    
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_maxOccurs.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_maxOccurs.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_maxOccurs.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_maxOccurs.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,14 @@
+<schema targetNamespace="http://soapinterop.org2/xsd"
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd1="http://soapinterop.org2/xsd"
+        elementFormDefault="qualified">
+    <complexType name="SOAPStruct">
+        <sequence>
+            <element name="varFloat" type="xsd:float"/>
+            <element name="varInt" type="xsd:int"/>
+            <element name="varString" type="xsd:string" maxOccurs="10"/>
+        </sequence>
+    </complexType>
+    <element name="myobject" type="xsd1:SOAPStruct" />
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_maxOccurs2.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_maxOccurs2.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_maxOccurs2.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_maxOccurs2.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,20 @@
+<schema targetNamespace="http://soapinterop.org/xsd"
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd1="http://soapinterop.org/xsd"
+        elementFormDefault="qualified">
+    <complexType name="SOAPStruct">
+        <sequence>
+            <element name="varFloat" type="xsd:float"/>
+            <element name="varInt" type="xsd:int"/>
+            <element name="varString" type="xsd:string" maxOccurs="10"/>
+        </sequence>
+    </complexType>
+    <complexType name="SOAPStructArray">
+        <sequence>
+            <element name="soapStructures" type="xsd1:SOAPStruct" maxOccurs="10"></element>
+        </sequence>
+    </complexType>
+    <element name="myobject" type="xsd1:SOAPStructArray" />
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_nillable.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_nillable.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_nillable.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_nillable.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,13 @@
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:tns="http://soapinterop.org/types"
+        targetNamespace="http://soapinterop.org/types">
+    <complexType name="SOAPStruct1">
+        <sequence>
+            <element name="varString" type="xsd:string" nillable="true"/>
+            <element name="varInt" type="xsd:int"/>
+            <element name="varFloat" type="xsd:float"/>
+        </sequence>
+    </complexType>
+    <element name="myElementNillable" type="tns:SOAPStruct1" nillable="true"/>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_particle_all.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_particle_all.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_particle_all.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_particle_all.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,14 @@
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:tns="http://soapinterop.org/types"
+        targetNamespace="http://soapinterop.org/types"
+        elementFormDefault="qualified">
+      <complexType name="SimpleParticleAllStruct">
+        <all>
+            <element name="varString" type="xsd:string"/>
+            <element name="varInt" type="xsd:int"/>
+            <element name="varFloat" type="xsd:float"/>
+        </all>
+    </complexType>
+    <element name="myParticleAllElement" type="tns:SimpleParticleAllStruct"/>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_recursive.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_recursive.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_recursive.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_recursive.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,14 @@
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:tns="http://soapinterop.org/types"
+        targetNamespace="http://soapinterop.org/types">
+    <complexType name="SOAPStruct1">
+        <sequence>
+            <element name="varString" type="xsd:string" nillable="true"/>
+            <element name="varInt" type="xsd:int"/>
+            <element name="varFloat" type="xsd:float"/>
+            <element name="child" type="tns:SOAPStruct1"/>
+        </sequence>
+    </complexType>
+    <element name="myElementNillable" type="tns:SOAPStruct1" nillable="true"/>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_restriction.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_restriction.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_restriction.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_restriction.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,15 @@
+<xs:schema targetNamespace="http://soapinterop.org/xsd"
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns:tns="http://soapinterop.org/xsd"
+           elementFormDefault="qualified">
+    <xs:element name="char" nillable="true" type="tns:char"/>
+    <xs:simpleType name="char">
+        <xs:restriction base="xs:int"/>
+    </xs:simpleType>
+    <xs:element name="guid" nillable="true" type="tns:guid"/>
+    <xs:simpleType name="guid">
+        <xs:restriction base="xs:string">
+            <xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
+        </xs:restriction>
+    </xs:simpleType>
+</xs:schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_sequence.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_sequence.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_sequence.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_sequence.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,14 @@
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:tns="http://soapinterop.org/types"
+        targetNamespace="http://soapinterop.org/types">
+    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+    <complexType name="SOAPStruct">
+        <sequence>
+            <element name="varString" type="xsd:string"/>
+            <element name="varInt" type="xsd:int"/>
+            <element name="varFloat" type="xsd:float"/>
+        </sequence>
+    </complexType>
+    <element name="myElement" type="tns:SOAPStruct"/>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_sequence_2.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_sequence_2.xsd?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_sequence_2.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/xsd/simple_sequence_2.xsd Wed May 31 04:35:30 2006
@@ -0,0 +1,22 @@
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:tns="http://soapinterop.org/types"
+        targetNamespace="http://soapinterop.org/types">
+    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+    <complexType name="SOAPStruct">
+        <sequence>
+            <element name="varString" type="xsd:string"/>
+            <element name="varInt" type="xsd:int"/>
+            <element name="varFloat" type="xsd:float"/>
+        </sequence>
+    </complexType>
+    <!-- Has one more complex type that uses the already defined complex type -->
+    <complexType name="SOAPStructFault">
+        <sequence>
+            <element name="soapStruct" type="tns:SOAPStruct"/>
+        </sequence>
+    </complexType>
+    <element name="tempElt" type="tns:SOAPStructFault"/>
+</schema>
+
+

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/AbstractSchemaCompilerTester.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/AbstractSchemaCompilerTester.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/AbstractSchemaCompilerTester.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/AbstractSchemaCompilerTester.java Wed May 31 04:35:30 2006
@@ -0,0 +1,103 @@
+package org.apache.axis2.schema.compile;
+
+import junit.framework.TestCase;
+import org.apache.axis2.schema.CompilerOptions;
+import org.apache.axis2.schema.SchemaCompiler;
+import org.apache.ws.commons.schema.XmlSchema;
+import org.apache.ws.commons.schema.XmlSchemaCollection;
+import org.w3c.dom.Document;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+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.
+ */
+
+/* Maven is a little dumb when it comes to executing test cases. It tries to run everything
+  that ends with 'test' even if the class is abstract or non junit!!!!!
+  Rather than putting an explicit exclude, this is a cheaper way out
+*/
+public abstract class AbstractSchemaCompilerTester extends TestCase {
+
+    //this should be an xsd name in the test-resource directory
+    protected String fileName = "";
+    protected  XmlSchema currentSchema;
+    protected File outputFolder = null;
+
+    private static String TEMP_OUT_FOLDER="temp_compile";
+
+    protected void setUp() throws Exception {
+        //load the current Schema through a file
+        //first read the file into a DOM
+        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+        documentBuilderFactory.setNamespaceAware(true);
+
+        DocumentBuilder builder =  documentBuilderFactory.newDocumentBuilder();
+        Document doc = builder.parse(new File(fileName));
+
+        //now read it to a schema
+        XmlSchemaCollection schemaCol =  getSchemaReader();
+        currentSchema = schemaCol.read(doc,null);
+
+        outputFolder = new File(TEMP_OUT_FOLDER);
+        if (outputFolder.exists()){
+            if (outputFolder.isFile()){
+                outputFolder.delete();
+                outputFolder.mkdirs();
+            }
+        }else{
+            outputFolder.mkdirs();
+        }
+    }
+
+    protected  XmlSchemaCollection getSchemaReader(){
+        return new XmlSchemaCollection();
+    }
+
+    public void testSchema() throws Exception{
+        CompilerOptions compilerOptions = new CompilerOptions();
+        compilerOptions.setOutputLocation(outputFolder);
+        compilerOptions.setWrapClasses(false);
+        compilerOptions.setWriteOutput(true);
+        SchemaCompiler compiler = new SchemaCompiler(compilerOptions);
+        compiler.compile(currentSchema);
+       
+    }
+
+    protected void tearDown() throws Exception {
+         deleteDir(outputFolder);
+    }
+
+    /**
+     * Deletes all files and subdirectories under dir.
+     * Returns true if all deletions were successful.
+     * If a deletion fails, the method stops attempting to delete and returns false.
+     */
+    private boolean deleteDir(File dir) {
+        if (dir.isDirectory()) {
+            String[] children = dir.list();
+            for (int i=0; i<children.length; i++) {
+                boolean success = deleteDir(new File(dir, children[i]));
+                if (!success) {
+                    return false;
+                }
+            }
+        }
+
+        // The directory is now empty so delete it
+        return dir.delete();
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/AnonymousComplexTypeTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/AnonymousComplexTypeTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/AnonymousComplexTypeTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/AnonymousComplexTypeTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,24 @@
+package org.apache.axis2.schema.compile;
+
+/*
+ * 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.
+ */
+
+public class AnonymousComplexTypeTest extends AbstractSchemaCompilerTester {
+    protected void setUp() throws Exception {
+        this.fileName = "test-resources/xsd/anonymous_complexType.xsd";
+        super.setUp();
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/ComplexAllTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/ComplexAllTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/ComplexAllTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/ComplexAllTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,26 @@
+package org.apache.axis2.schema.compile;
+
+/*
+ * 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.
+ */
+
+public class ComplexAllTest extends AbstractSchemaCompilerTester {
+     protected void setUp() throws Exception {
+         this.fileName = "test-resources/xsd/complex_all.xsd";
+        super.setUp();
+    }
+
+
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/ComplexExtensionTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/ComplexExtensionTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/ComplexExtensionTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/ComplexExtensionTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,25 @@
+package org.apache.axis2.schema.compile;
+/*
+ * 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.
+ */
+
+public class ComplexExtensionTest extends AbstractSchemaCompilerTester{
+    protected void setUp() throws Exception {
+        this.fileName = "test-resources/xsd/complex_content_extension.xsd";
+        super.setUp();
+    }
+
+   
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/ImportTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/ImportTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/ImportTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/ImportTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,31 @@
+package org.apache.axis2.schema.compile;
+
+import org.apache.ws.commons.schema.XmlSchemaCollection;
+/*
+ * 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.
+ */
+
+public class ImportTest extends AbstractSchemaCompilerTester{
+    protected void setUp() throws Exception {
+        this.fileName = "test-resources/xsd/import.xsd";
+        super.setUp();
+    }
+
+    protected XmlSchemaCollection getSchemaReader() {
+        XmlSchemaCollection reader = new XmlSchemaCollection();
+        reader.setBaseUri("test-resources/xsd");
+        return reader;
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/RecursiveCompileTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/RecursiveCompileTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/RecursiveCompileTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/RecursiveCompileTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,27 @@
+package org.apache.axis2.schema.compile;
+
+import junit.framework.TestCase;
+/*
+ * 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.
+ */
+
+public class RecursiveCompileTest extends AbstractSchemaCompilerTester {
+      protected void setUp() throws Exception {
+         this.fileName = "test-resources/xsd/simple_recursive.xsd";
+        super.setUp();
+    }
+
+
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAnyAttribTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAnyAttribTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAnyAttribTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAnyAttribTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,24 @@
+package org.apache.axis2.schema.compile;
+
+/*
+ * 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.
+ */
+
+public class SimpleAnyAttribTest extends AbstractSchemaCompilerTester {
+      protected void setUp() throws Exception {
+         this.fileName = "test-resources/xsd/simple_any_attribute.xsd";
+        super.setUp();
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAnyTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAnyTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAnyTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAnyTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,24 @@
+package org.apache.axis2.schema.compile;
+
+/*
+ * 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.
+ */
+
+public class SimpleAnyTest extends AbstractSchemaCompilerTester {
+    protected void setUp() throws Exception {
+         this.fileName = "test-resources/xsd/simple_any.xsd";
+        super.setUp();
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAnyTypeTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAnyTypeTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAnyTypeTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAnyTypeTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,26 @@
+package org.apache.axis2.schema.compile;
+/*
+ * 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.
+ */
+
+public class SimpleAnyTypeTest extends AbstractSchemaCompilerTester {
+
+    protected void setUp() throws Exception {
+        this.fileName = "test-resources/xsd/simple_anytype.xsd";
+        super.setUp();
+    }
+
+  
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAttributeTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAttributeTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAttributeTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleAttributeTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,26 @@
+package org.apache.axis2.schema.compile;
+
+/*
+ * 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.
+ */
+
+public class SimpleAttributeTest extends AbstractSchemaCompilerTester {
+
+    protected void setUp() throws Exception {
+        this.fileName = "test-resources/xsd/simple_attrib.xsd";
+        super.setUp();
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleChoiceTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleChoiceTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleChoiceTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleChoiceTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,26 @@
+package org.apache.axis2.schema.compile;
+/*
+ * 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.
+ */
+
+public class SimpleChoiceTest extends AbstractSchemaCompilerTester {
+
+    protected void setUp() throws Exception {
+        this.fileName = "test-resources/xsd/simple_choice.xsd";
+        super.setUp();
+    }
+
+   
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleElementReferenceTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleElementReferenceTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleElementReferenceTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleElementReferenceTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,27 @@
+package org.apache.axis2.schema.compile;
+/*
+ * 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.
+ */
+
+public class SimpleElementReferenceTest extends AbstractSchemaCompilerTester {
+    protected void setUp() throws Exception {
+        this.fileName = "test-resources/xsd/simple_element_reference.xsd";
+        super.setUp();
+    }
+
+    protected void tearDown() throws Exception {
+        
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleElementTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleElementTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleElementTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/compile/SimpleElementTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,24 @@
+package org.apache.axis2.schema.compile;
+
+/*
+ * 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.
+ */
+
+public class SimpleElementTest extends AbstractSchemaCompilerTester {
+    protected void setUp() throws Exception {
+        this.fileName = "test-resources/xsd/simple_element.xsd";
+        super.setUp();
+    }
+}



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