axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r397764 - /webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java
Date Fri, 28 Apr 2006 05:29:13 GMT
Author: dims
Date: Thu Apr 27 22:29:11 2006
New Revision: 397764

URL: http://svn.apache.org/viewcvs?rev=397764&view=rev
Log:
Allow people to set command line option for namespace/pkg mapping as shown below:

org.apache.axis2.wsdl.WSDL2Java -uri EchoService.wsdl -ns2p "http://axis2.apache.org=org.apache.axis2.echo"

If there are more than one mapping they can be specified using a comma separator

"ns1=pkg1,ns2=pkg2"


Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java?rev=397764&r1=397763&r2=397764&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
Thu Apr 27 22:29:11 2006
@@ -109,15 +109,16 @@
             String value = ns2packageOption.getOptionValue();
             if (value != null) {
                 String valuepairs[] = value.split(",");
-                if (valuepairs.length > 0 && valuepairs.length % 2 == 0) {
+                if (valuepairs.length > 0) {
                     //put them in the hash map
                     HashMap map = new HashMap(valuepairs.length);
-                    for (int i = 0; i < valuepairs.length; i = i + 2) {
-                        map.put(valuepairs[i], valuepairs[i + 1]);
+                    for (int i = 0; i < valuepairs.length; i++) {
+                        String values[] = valuepairs[i].split("=");
+                        if(values.length == 2) {
+                            map.put(values[0], values[1]);
+                        }
                     }
                     config.setUri2PackageNameMap(map);
-                } else {
-                    //todo throw an exception here
                 }
             }
         }



Mime
View raw message