axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r693005 - in /webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl: ./ codegen/ codegen/emitter/ i18n/ template/java/ util/
Date Mon, 08 Sep 2008 07:27:46 GMT
Author: amilas
Date: Mon Sep  8 00:27:44 2008
New Revision: 693005

URL: http://svn.apache.org/viewvc?rev=693005&view=rev
Log:
Added an option to set the exception base class name instead of java.lang.Exception

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/ExceptionTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java?rev=693005&r1=693004&r2=693005&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java
Mon Sep  8 00:27:44 2008
@@ -42,7 +42,7 @@
 
         System.out.println(CodegenMessages.getMessage("wsdl2code.arg"));
         System.out.println(CodegenMessages.getMessage("wsdl2code.arg1"));
-        for (int i = 2; i <= 47; i++) {
+        for (int i = 2; i <= 48; i++) {
             System.out.println("  " + CodegenMessages.getMessage("wsdl2code.arg" + i));
         }
     }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java?rev=693005&r1=693004&r2=693005&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
Mon Sep  8 00:27:44 2008
@@ -621,4 +621,14 @@
         this.overrideAbsoluteAddress = overrideAbsoluteAddress;
     }
 
+    private String exceptionBaseClassName;
+
+    public String getExceptionBaseClassName() {
+        return exceptionBaseClassName;
+    }
+
+    public void setExceptionBaseClassName(String exceptionBaseClassName) {
+        this.exceptionBaseClassName = exceptionBaseClassName;
+    }
+
 }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java?rev=693005&r1=693004&r2=693005&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java
Mon Sep  8 00:27:44 2008
@@ -290,6 +290,12 @@
             config.setSkeltonClassName(commandLineOption.getOptionValue());
         }
 
+        commandLineOption = loadOption(WSDL2JavaConstants.EXCEPTION_BASE_CLASS_OPTION,
+                WSDL2JavaConstants.EXCEPTION_BASE_CLASS_OPTION_LONG, optionMap);
+        if (commandLineOption != null){
+            config.setExceptionBaseClassName(commandLineOption.getOptionValue());
+        }
+
         // setting the overrid and all ports options
         config.setAllPorts(loadOption(WSDL2JavaConstants.All_PORTS_OPTION,
                                       WSDL2JavaConstants.All_PORTS_OPTION_LONG,

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?rev=693005&r1=693004&r2=693005&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
Mon Sep  8 00:27:44 2008
@@ -1051,6 +1051,14 @@
                     (String) faultClassNameMap.get(key),
                     faultElement);
 
+            //added the base exception class name
+            if (this.codeGenConfiguration.getExceptionBaseClassName() != null) {
+                addAttribute(doc, "exceptionBaseClass",
+                        this.codeGenConfiguration.getExceptionBaseClassName(), faultElement);
+            } else {
+                addAttribute(doc, "exceptionBaseClass", Exception.class.getName(), faultElement);
+            }
+
             //the type represents the type that will be wrapped by this
             //name
             String typeMapping =

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties?rev=693005&r1=693004&r2=693005&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
Mon Sep  8 00:27:44 2008
@@ -82,6 +82,7 @@
 wsdl2code.arg45=  -scn <class-name>        Skeleton class name - used to specify a
name for skeleton class other than the default one
 wsdl2code.arg46=                           \t\t\t   -EbindingFileName <path>      
        (for jaxbri) - specify the file path for the episode file
 wsdl2code.arg47=  -oaa <override-absolute-address>  -change the absolute http addresses
to local file addresses generated by wsdl2java tool
+wsdl2code.arg48=  -ebc <exception-base-class>  -generated Exceptions are inherited
from this exception rather than the java.lang.Exception class
 
 ################## prop file loader #################################
 propfileload.frameworkMismatch=Number of frameworks and extension names do not match!

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/ExceptionTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/ExceptionTemplate.xsl?rev=693005&r1=693004&r2=693005&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/ExceptionTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/ExceptionTemplate.xsl
Mon Sep  8 00:27:44 2008
@@ -29,7 +29,7 @@
 
 package <xsl:value-of select="@package"/>;
 
-public class <xsl:value-of select="@shortName"/> extends java.lang.Exception{
+public class <xsl:value-of select="@shortName"/> extends <xsl:value-of select="@exceptionBaseClass"/>{
     
     private <xsl:value-of select="@type"/> faultMessage;
     

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java?rev=693005&r1=693004&r2=693005&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java
Mon Sep  8 00:27:44 2008
@@ -63,6 +63,8 @@
                     WSDL2JavaConstants.OUTPUT_LOCATION_OPTION_LONG.equalsIgnoreCase(optionType)
||
                     WSDL2JavaConstants.OVERRIDE_OPTION.equalsIgnoreCase(optionType) ||
                     WSDL2JavaConstants.OVERRIDE_OPTION_LONG.equalsIgnoreCase(optionType)
||
+                    WSDL2JavaConstants.EXCEPTION_BASE_CLASS_OPTION.equalsIgnoreCase(optionType)
||
+                    WSDL2JavaConstants.EXCEPTION_BASE_CLASS_OPTION_LONG.equalsIgnoreCase(optionType)
||
                     WSDL2JavaConstants.OVERRIDE_ABSOLUTE_ADDRESS_OPTION.equalsIgnoreCase(optionType)
||
                     WSDL2JavaConstants.OVERRIDE_ABSOLUTE_ADDRESS_OPTION_LONG.equalsIgnoreCase(optionType)
||
                     WSDL2JavaConstants.PACKAGE_OPTION.equalsIgnoreCase(optionType) ||



Mime
View raw message