axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r373470 - in /webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl: Java2WSDL.java codegen/Java2WSDLCodegenEngine.java i18n/resource.properties util/Java2WSDLOptionsValidator.java
Date Mon, 30 Jan 2006 08:39:45 GMT
Author: ajith
Date: Mon Jan 30 00:39:24 2006
New Revision: 373470

URL: http://svn.apache.org/viewcvs?rev=373470&view=rev
Log:
Added i18n support for java2wsdl tool

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/Java2WSDL.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/Java2WSDLCodegenEngine.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/util/Java2WSDLOptionsValidator.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/Java2WSDL.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/Java2WSDL.java?rev=373470&r1=373469&r2=373470&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/Java2WSDL.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/Java2WSDL.java
Mon Jan 30 00:39:24 2006
@@ -6,6 +6,7 @@
 import org.apache.axis2.wsdl.util.CommandLineOptionConstants;
 import org.apache.axis2.wsdl.codegen.Java2WSDLCodegenEngine;
 import org.apache.axis2.wsdl.codegen.CodeGenerationException;
+import org.apache.axis2.wsdl.i18n.CodegenMessages;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -32,21 +33,32 @@
         try {
             new Java2WSDLCodegenEngine(commandLineOptionParser.getAllOptions()).generate();
         } catch (CodeGenerationException e) {
-            e.printStackTrace();
-            System.out.println("An error occured during codegen");//todo i18n this
+            System.out.println(CodegenMessages.getMessage("java2wsdl.generalError") + e.getMessage());
         }
     }
 
     public static void printUsage(){
-        //todo fill this
+        System.out.println(CodegenMessages.getMessage("java2wsdl.arg1"));
+        System.out.println(CodegenMessages.getMessage("java2wsdl.arg2"));
+        System.out.println(CodegenMessages.getMessage("java2wsdl.arg3"));
+        System.out.println(CodegenMessages.getMessage("java2wsdl.arg4"));
+        System.out.println(CodegenMessages.getMessage("java2wsdl.arg5"));
+        System.out.println(CodegenMessages.getMessage("java2wsdl.arg6"));
+        System.out.println(CodegenMessages.getMessage("java2wsdl.arg7"));
+        System.out.println(CodegenMessages.getMessage("java2wsdl.arg8"));
+        System.out.println(CodegenMessages.getMessage("java2wsdl.arg9"));
+        System.out.println(CodegenMessages.getMessage("java2wsdl.arg10"));
+
+        System.exit(0);
     }
 
 
     private static void validateCommandLineOptions(
-               CommandLineOptionParser parser) {
-           if (parser.getInvalidOptions(new Java2WSDLOptionsValidator()).size() > 0)
-               printUsage();
+            CommandLineOptionParser parser) {
+        if (parser.getInvalidOptions(new Java2WSDLOptionsValidator()).size() > 0){
+            printUsage();
+        }
 
-       }
+    }
 
 }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/Java2WSDLCodegenEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/Java2WSDLCodegenEngine.java?rev=373470&r1=373469&r2=373470&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/Java2WSDLCodegenEngine.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/Java2WSDLCodegenEngine.java
Mon Jan 30 00:39:24 2006
@@ -3,6 +3,7 @@
 import org.apache.axis2.wsdl.builder.Java2WSDLBuilder;
 import org.apache.axis2.wsdl.util.CommandLineOptionConstants;
 import org.apache.axis2.wsdl.util.CommandLineOption;
+import org.apache.axis2.wsdl.i18n.CodegenMessages;
 
 import java.util.Map;
 import java.util.ArrayList;
@@ -46,14 +47,14 @@
         if (!outputFolder.exists()){
             outputFolder.mkdir();
         }else  if(!outputFolder.isDirectory()){
-            throw new CodeGenerationException(""); //todo put the messages here - not a folder
+            throw new CodeGenerationException(CodegenMessages.getMessage("java2wsdl.notAFolder",outputFolderName));
         }
 
         option = loadOption(Java2WSDLConstants.CLASSNAME_OPTION,Java2WSDLConstants.CLASSNAME_OPTION_LONG,optionsMap);
         String className =option==null?null:option.getOptionValue();
 
         if (className==null || className.equals("")){
-            throw new CodeGenerationException(""); //todo put the messages here - a class
is a must
+            throw new CodeGenerationException(CodegenMessages.getMessage("java2wsdl.classIsMust"));
         }
 
         option = loadOption(Java2WSDLConstants.OUTPUT_FILENAME_OPTION,

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties?rev=373470&r1=373469&r2=373470&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 Jan 30 00:39:24 2006
@@ -61,10 +61,10 @@
 emitter.cannotFindBinding=Cannot find a binding!!
 emitter.logEntryInterface1=Interface mode is selected.The following items will not be generated
 emitter.logEntryInterface2=1. Message Receiver
-emitter.logEntryInterface3=1. Stub
-emitter.logEntryInterface4=2. CallbackHandler
-emitter.logEntryInterface5=3. Test Classes
-emitter.logEntryInterface6=4. Databinding Supporters
+emitter.logEntryInterface3=2. Stub
+emitter.logEntryInterface4=3. CallbackHandler
+emitter.logEntryInterface5=4. Test Classes
+emitter.logEntryInterface6=5. Databinding Supporters
 emitter.coreclassNameError=Cannot form the core class name
 emitter.serviceNotFoundError=specified service {0} not found
 emitter.endpointNotFoundError=specified end point {0} not found
@@ -73,4 +73,20 @@
 emitter.warningMultipleEndpoints=Warning - Multiple endpoints found - picking the first endpoint!
 emitter.switchingMessages=Warning -No services found - switched to the interface mode!
 emitter.warningMultiplePorttypes=Warning - Found multiple porttypes - picking the first
+
+##################### java2WSDL
+java2wsdl.arg1=Usage java2wsdl -cn <fully qualified class name> : class file name
+java2wsdl.arg2=-o <output Location> : output file location
+java2wsdl.arg3=-cp <class path uri> : list of classpath entries - (urls)
+java2wsdl.arg4=-tn <target namespace> : target namespace
+java2wsdl.arg5=-tp <target namespace prefix> : target namespace prefix
+java2wsdl.arg6=-stn <schema target namespace> : target namespace for schema
+java2wsdl.arg7=-stp <schema target namespace prefix> : target namespace prefix for
schema
+java2wsdl.arg8=-sn <service name> : service name
+java2wsdl.arg9=-of <output file name> : output file name for the WSDL
+
+java2wsdl.generalError=An error occured while generating code
+java2wsdl.notAFolder=The specivied location {0} is not a folder
+java2wsdl.classIsMust=class name must be present!
+
 

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/Java2WSDLOptionsValidator.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/Java2WSDLOptionsValidator.java?rev=373470&r1=373469&r2=373470&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/Java2WSDLOptionsValidator.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/Java2WSDLOptionsValidator.java
Mon Jan 30 00:39:24 2006
@@ -26,7 +26,6 @@
         } else{
             invalid = !((Java2WSDLConstants.CLASSNAME_OPTION).equalsIgnoreCase(optionType)
||
                        Java2WSDLConstants.OUTPUT_LOCATION_OPTION.equalsIgnoreCase(optionType)
||
-                       Java2WSDLConstants.CLASSNAME_OPTION.equalsIgnoreCase(optionType) ||
                        Java2WSDLConstants.CLASSPATH_OPTION.equalsIgnoreCase(optionType) ||
                        Java2WSDLConstants.TARGET_NAMESPACE_OPTION.equalsIgnoreCase(optionType)
||
                        Java2WSDLConstants.TARGET_NAMESPACE_PREFIX_OPTION.equalsIgnoreCase(optionType)
||



Mime
View raw message