You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by am...@apache.org on 2009/02/06 15:18:35 UTC

svn commit: r741572 - in /webservices/axis2/branches/java/1_5/modules: codegen/src/org/apache/axis2/wsdl/codegen/ codegen/src/org/apache/axis2/wsdl/codegen/emitter/ codegen/src/org/apache/axis2/wsdl/i18n/ codegen/src/org/apache/axis2/wsdl/template/java...

Author: amilas
Date: Fri Feb  6 14:18:33 2009
New Revision: 741572

URL: http://svn.apache.org/viewvc?rev=741572&view=rev
Log:
adding uom option to branch

Modified:
    webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
    webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java
    webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
    webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
    webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl
    webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java
    webservices/axis2/branches/java/1_5/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java

Modified: webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java?rev=741572&r1=741571&r2=741572&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java (original)
+++ webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java Fri Feb  6 14:18:33 2009
@@ -630,4 +630,14 @@
     public void setExceptionBaseClassName(String exceptionBaseClassName) {
         this.exceptionBaseClassName = exceptionBaseClassName;
     }
+
+    private boolean isUseOperationName;
+
+    public boolean isUseOperationName() {
+        return isUseOperationName;
+    }
+
+    public void setUseOperationName(boolean useOperationName) {
+        isUseOperationName = useOperationName;
+    }
 }

Modified: webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java?rev=741572&r1=741571&r2=741572&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java (original)
+++ webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java Fri Feb  6 14:18:33 2009
@@ -153,8 +153,10 @@
                                                  optionMap) != null);
 
         config.setGenerateAll(loadOption(WSDL2JavaConstants.GENERATE_ALL_OPTION,
-                                         WSDL2JavaConstants.GENERATE_ALL_OPTION_LONG, optionMap) !=
-                null);
+                                         WSDL2JavaConstants.GENERATE_ALL_OPTION_LONG, optionMap) != null);
+
+        config.setUseOperationName(loadOption(WSDL2JavaConstants.USE_OPERATION_NAME,
+                                     WSDL2JavaConstants.USE_OPERATION_NAME_LONG, optionMap) != null);
 
         //populate the external mapping
         commandLineOption = loadOption(

Modified: webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?rev=741572&r1=741571&r2=741572&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java (original)
+++ webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java Fri Feb  6 14:18:33 2009
@@ -1585,6 +1585,12 @@
 
         addAttribute(doc, "name", localPart + mepToSuffixMap.get(mep), rootElement);
 
+        // here set the isLowerCaseMethodName variable to have the negative on useOperationName to
+        // make it easier to handle in Message receiver template.
+        if (!this.codeGenConfiguration.isUseOperationName()) {
+            addAttribute(doc, "isLowerCaseMethodName", "true", rootElement);
+        }
+
         //add backwordcompatibility attribute
         addAttribute(doc, "isbackcompatible",
                 String.valueOf(codeGenConfiguration.isBackwordCompatibilityMode()),
@@ -2253,7 +2259,13 @@
         List soapHeaderOutputParameterList = new ArrayList();
         methodElement = doc.createElement("method");
         String localPart = axisOperation.getName().getLocalPart();
-        addAttribute(doc, "name", JavaUtils.xmlNameToJavaIdentifier(localPart), methodElement);
+
+        if (this.codeGenConfiguration.isUseOperationName()) {
+            addAttribute(doc, "name", JavaUtils.xmlNameToJava(localPart), methodElement);
+        } else {
+            addAttribute(doc, "name", JavaUtils.xmlNameToJavaIdentifier(localPart), methodElement);
+        }
+
         addAttribute(doc, "originalName", localPart, methodElement);
         addAttribute(doc, "namespace", axisOperation.getName().getNamespaceURI(), methodElement);
         addAttribute(doc, "style", (String) getBindingPropertyFromOperation(

Modified: webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties?rev=741572&r1=741571&r2=741572&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties (original)
+++ webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties Fri Feb  6 14:18:33 2009
@@ -83,7 +83,7 @@
 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
-wsdl2code.arg49=  -lcmn <lower-case-method-name>  -normally generated method names for operation is same as operation name. This option make first letter lower case 
+wsdl2code.arg49=  -uom <use-operation-name>  -by default the first letter of the generated method name changeed to lowercase. This option stops that and make it same as operation name
 
 ################## prop file loader #################################
 propfileload.frameworkMismatch=Number of frameworks and extension names do not match!

Modified: webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl?rev=741572&r1=741571&r2=741572&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl (original)
+++ webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl Fri Feb  6 14:18:33 2009
@@ -67,7 +67,7 @@
         }
 
         java.lang.String methodName;
-        if((op.getName() != null) &amp;&amp; ((methodName = org.apache.axis2.util.JavaUtils.xmlNameToJavaIdentifier(op.getName().getLocalPart())) != null)){
+        if((op.getName() != null) &amp;&amp; ((methodName = org.apache.axis2.util.JavaUtils.xmlNameToJava<xsl:if test="@isLowerCaseMethodName">Identifier</xsl:if>(op.getName().getLocalPart())) != null)){
 
         <xsl:for-each select="method">
             <xsl:if test="position() > 1">} else </xsl:if>
@@ -358,7 +358,7 @@
         }
 
         java.lang.String methodName;
-        if((op.getName() != null) &amp;&amp; ((methodName = org.apache.axis2.util.JavaUtils.xmlNameToJavaIdentifier(op.getName().getLocalPart())) != null)){
+        if((op.getName() != null) &amp;&amp; ((methodName = org.apache.axis2.util.JavaUtils.xmlNameToJava<xsl:if test="@isLowerCaseMethodName">Identifier</xsl:if>(op.getName().getLocalPart())) != null)){
 
         <xsl:for-each select="method">
 
@@ -496,7 +496,7 @@
         }
 
         java.lang.String methodName;
-        if((op.getName() != null) &amp;&amp; ((methodName = org.apache.axis2.util.JavaUtils.xmlNameToJavaIdentifier(op.getName().getLocalPart())) != null)){
+        if((op.getName() != null) &amp;&amp; ((methodName = org.apache.axis2.util.JavaUtils.xmlNameToJava<xsl:if test="@isLowerCaseMethodName">Identifier</xsl:if>(op.getName().getLocalPart())) != null)){
 
         <xsl:for-each select="method">
             <xsl:if test="position() > 1">} else </xsl:if>

Modified: webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java?rev=741572&r1=741571&r2=741572&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java (original)
+++ webservices/axis2/branches/java/1_5/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java Fri Feb  6 14:18:33 2009
@@ -102,6 +102,8 @@
                     WSDL2JavaConstants.SKELTON_INTERFACE_NAME_OPTION_LONG.equalsIgnoreCase(optionType) ||
                     WSDL2JavaConstants.SKELTON_CLASS_NAME_OPTION.equalsIgnoreCase(optionType) ||
                     WSDL2JavaConstants.SKELTON_CLASS_NAME_OPTION_LONG.equalsIgnoreCase(optionType) ||
+                    WSDL2JavaConstants.USE_OPERATION_NAME.equalsIgnoreCase(optionType) ||
+                    WSDL2JavaConstants.USE_OPERATION_NAME_LONG.equalsIgnoreCase(optionType) ||
                     XMLBeansExtension.XSDCONFIG_OPTION.equalsIgnoreCase(optionType) ||
                     XMLBeansExtension.XSDCONFIG_OPTION_LONG.equalsIgnoreCase(optionType)
             );

Modified: webservices/axis2/branches/java/1_5/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java?rev=741572&r1=741571&r2=741572&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java (original)
+++ webservices/axis2/branches/java/1_5/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java Fri Feb  6 14:18:33 2009
@@ -88,6 +88,8 @@
         String EXCLUDE_PAKAGES_OPTION_LONG = "exclude-packages";
         String SKELTON_INTERFACE_NAME_OPTION = "sin";
         String SKELTON_INTERFACE_NAME_OPTION_LONG = "skelton-interface-name";
+        String USE_OPERATION_NAME = "uom";
+        String USE_OPERATION_NAME_LONG = "use-operation-name";
         String SKELTON_CLASS_NAME_OPTION = "scn";
         String SKELTON_CLASS_NAME_OPTION_LONG = "skelton-class-name";