axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r788202 - in /webservices/axis2/trunk/java/modules/adb-codegen: ./ src/org/apache/axis2/schema/ src/org/apache/axis2/schema/template/ src/org/apache/axis2/schema/writer/ test-resources/testsuite/
Date Wed, 24 Jun 2009 22:47:41 GMT
Author: veithen
Date: Wed Jun 24 22:47:40 2009
New Revision: 788202

URL: http://svn.apache.org/viewvc?rev=788202&view=rev
Log:
AXIS2-3851: Fixed adb-codegen to support ExtensionMapper in the default package (so that we
can process schemas without targetNamespace when no options are given).

Added:
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/nonamespace.xsd
Modified:
    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/template/ADBBeanTemplate.xsl
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
    webservices/axis2/trunk/java/modules/adb-codegen/sub-build.xml

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java?rev=788202&r1=788201&r2=788202&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
(original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
Wed Jun 24 22:47:40 2009
@@ -270,7 +270,7 @@
                         && (options.getNs2PackageMap().containsKey(nsp))) {
                     writer.registerExtensionMapperPackageName((String) options.getNs2PackageMap().get(nsp));
                 } else {
-                    writer.registerExtensionMapperPackageName(URLProcessor.makePackageName(nsp));
+                    writer.registerExtensionMapperPackageName(nsp == null ? null : URLProcessor.makePackageName(nsp));
                 }
             }
             // second round - call the schema compiler one by one
@@ -317,8 +317,8 @@
         if (!isPartofGroup) {
             //set a mapper package if not avaialable
             if (writer.getExtensionMapperPackageName() == null) {
-                writer.registerExtensionMapperPackageName(
-                        URLProcessor.makePackageName(schema.getTargetNamespace()));
+                String ns = schema.getTargetNamespace();
+                writer.registerExtensionMapperPackageName(ns == null ? null : URLProcessor.makePackageName(ns));
             }
         }
 

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl?rev=788202&r1=788201&r2=788202&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
Wed Jun 24 22:47:40 2009
@@ -6036,7 +6036,9 @@
  * by the Apache Axis2 version: #axisVersion# #today#
  */
 
+        <xsl:if test="string-length(normalize-space(@package)) > 0">
             package <xsl:value-of select="@package"/>;
+        </xsl:if>
             /**
             *  <xsl:value-of select="$name"/> class
             */

Modified: 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=788202&r1=788201&r2=788202&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
(original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
Wed Jun 24 22:47:40 2009
@@ -1354,7 +1354,7 @@
      * mapper class for the whole
      */
     private String getFullyQualifiedMapperClassName() {
-        if (wrapClasses || !writeClasses) {
+        if (wrapClasses || !writeClasses || mappingClassPackage == null) {
             return EXTENSION_MAPPER_CLASSNAME;
         } else {
             return mappingClassPackage + "." + EXTENSION_MAPPER_CLASSNAME;

Modified: webservices/axis2/trunk/java/modules/adb-codegen/sub-build.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/sub-build.xml?rev=788202&r1=788201&r2=788202&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/sub-build.xml (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/sub-build.xml Wed Jun 24 22:47:40 2009
@@ -81,6 +81,7 @@
 			<arg file="${testsuite.source.dir}/complexExtension.xsd"/>
 			<arg file="${testsuite.source.dir}/soapencoding.xsd"/>
 			<arg file="${testsuite.source.dir}/chameleon.xsd"/>
+			<arg file="${testsuite.source.dir}/nonamespace.xsd"/> <!-- compile only; no tests
-->
 			<arg file="${schema.generated.src.dir}"/>
 		</java>
     </target>

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/nonamespace.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/nonamespace.xsd?rev=788202&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/nonamespace.xsd
(added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/nonamespace.xsd
Wed Jun 24 22:47:40 2009
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements. See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership. The ASF licenses this file
+  ~ to you 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.
+  -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema">
+    <element name="TestElement">
+        <complexType>
+            <sequence>
+                <element name="param1" type="string"/>
+                <element name="param2" type="string"/>
+            </sequence>
+        </complexType>
+    </element>
+</schema>
\ No newline at end of file



Mime
View raw message