cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1079811 - in /cxf/branches/2.3.x-fixes: ./ api/src/main/java/org/apache/cxf/tools/common/ maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/ tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/ tools/wsdlto/fro...
Date Wed, 09 Mar 2011 14:14:38 GMT
Author: ningjiang
Date: Wed Mar  9 14:14:38 2011
New Revision: 1079811

URL: http://svn.apache.org/viewvc?rev=1079811&view=rev
Log:
Merged revisions 1079780 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1079780 | ningjiang | 2011-03-09 20:54:15 +0800 (Wed, 09 Mar 2011) | 1 line
  
  CXF-3385 Add a new option in WSD2Java to skip the generate the type classes from schema
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
    cxf/branches/2.3.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Option.java
    cxf/branches/2.3.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WsdlOption.java
    cxf/branches/2.3.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
    cxf/branches/2.3.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/wsdlto.xml
    cxf/branches/2.3.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml
    cxf/branches/2.3.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
    svn:mergeinfo = /cxf/trunk:1079780

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.3.x-fixes/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java?rev=1079811&r1=1079810&r2=1079811&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
(original)
+++ cxf/branches/2.3.x-fixes/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
Wed Mar  9 14:14:38 2011
@@ -63,6 +63,7 @@ public final class ToolConstants {
     public static final String CFG_EXTRA_SOAPHEADER = "exsoapheader";
     public static final String CFG_DEFAULT_NS = "defaultns";
     public static final String CFG_DEFAULT_EX = "defaultex";
+    public static final String CXF_GENERATE_TYPES = "generatetypes";
     public static final String CFG_XJC_ARGS = "xjc";
     public static final String CFG_CATALOG = "catalog";
     public static final String CFG_DEFAULT_VALUES = "defaultValues";

Modified: cxf/branches/2.3.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Option.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Option.java?rev=1079811&r1=1079810&r2=1079811&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Option.java
(original)
+++ cxf/branches/2.3.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Option.java
Wed Mar  9 14:14:38 2011
@@ -134,6 +134,12 @@ public class Option {
      * Enables validating the WSDL before generating the code. 
      */
     Boolean validateWsdl;
+    
+    
+    /**
+     * Enables or disables generation of the type classes. Default value is true.
+     */
+    Boolean generateTypes;
 
     /**
      * Enables generation of fault Exception's SUID based on hash of classname.
@@ -314,6 +320,14 @@ public class Option {
     public void setValidateWsdl(boolean validateWsdl) {
         this.validateWsdl = validateWsdl;
     }
+    
+    public boolean isGenerateTypes() {
+        return generateTypes == null ? true : generateTypes;
+    }
+    
+    public void setGenerateTypes(boolean generateTypes) {
+        this.generateTypes = generateTypes;
+    }
 
     public boolean isUseFQCNForFaultSerialVersionUID() {
         return useFQCNForFaultSerialVersionUID == null ? false : useFQCNForFaultSerialVersionUID;
@@ -398,6 +412,7 @@ public class Option {
         destination.setPackagenames(getPackagenames());
         destination.setServiceName(getServiceName());
         destination.setValidateWsdl(isValidateWsdl());
+        destination.setGenerateTypes(isGenerateTypes());
         destination.setUseFQCNForFaultSerialVersionUID(isUseFQCNForFaultSerialVersionUID());
         destination.setMarkGenerated(isMarkGenerated());
         destination.setAllowElementRefs(isAllowElementRefs());
@@ -417,6 +432,7 @@ public class Option {
     public void merge(Option defaultOptions) {
         wsdlList = setIfNull(wsdlList, defaultOptions.wsdlList);
         extendedSoapHeaders = setIfNull(extendedSoapHeaders, defaultOptions.extendedSoapHeaders);
+        generateTypes = setIfNull(generateTypes, defaultOptions.generateTypes);
         validateWsdl = setIfNull(validateWsdl, defaultOptions.validateWsdl);
         useFQCNForFaultSerialVersionUID = setIfNull(useFQCNForFaultSerialVersionUID,
             defaultOptions.useFQCNForFaultSerialVersionUID);

Modified: cxf/branches/2.3.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WsdlOption.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WsdlOption.java?rev=1079811&r1=1079810&r2=1079811&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WsdlOption.java
(original)
+++ cxf/branches/2.3.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WsdlOption.java
Wed Mar  9 14:14:38 2011
@@ -148,6 +148,10 @@ public class WsdlOption extends Option {
             list.add("-exsh");
             list.add("true");
         }
+        if (!isGenerateTypes()) {
+            list.add("-gt");
+            list.add("false");
+        }
         addIfTrue(list, isAllowElementRefs(), "-allowElementRefs");
         addIfTrue(list, isValidateWsdl(), "-validate");
         addIfTrue(list, isUseFQCNForFaultSerialVersionUID(), "-useFQCNForFaultSerialVersionUID");

Modified: cxf/branches/2.3.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java?rev=1079811&r1=1079810&r2=1079811&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
(original)
+++ cxf/branches/2.3.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
Wed Mar  9 14:14:38 2011
@@ -237,6 +237,13 @@ public class WSDLToJavaContainer extends
                 context.put(ServiceInfo.class, null);
             }
         }
+        
+        if (!context.getBooleanValue(ToolConstants.CXF_GENERATE_TYPES, "true")) {
+            context.remove(ToolConstants.CFG_TYPES);
+            context.remove(ToolConstants.CFG_ALL);
+            context.remove(ToolConstants.CFG_COMPILE);
+        }
+        
         generateTypes();
 
         for (ServiceInfo service : serviceList) {
@@ -573,6 +580,9 @@ public class WSDLToJavaContainer extends
             || context.optionSet(ToolConstants.CFG_GEN_FAULT)) {
             return true;
         }
+        if (!context.getBooleanValue(ToolConstants.CXF_GENERATE_TYPES, "true")) {
+            return true;
+        }
         return false;
     }
 

Modified: cxf/branches/2.3.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/wsdlto.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/wsdlto.xml?rev=1079811&r1=1079810&r2=1079811&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/wsdlto.xml
(original)
+++ cxf/branches/2.3.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/wsdlto.xml
Wed Mar  9 14:14:38 2011
@@ -173,6 +173,16 @@ under the License.
                     <valueenum>true|false</valueenum>
                 </associatedArgument>
             </option>
+            
+            <option id="generatetypes" maxOccurs="1">
+                <annotation>Enables the processing of generating the type class from
schema. The default is true.
+                </annotation>
+                <switch>gt</switch>
+                <associatedArgument placement="afterSpace">
+                    <annotation>(true, false)</annotation>
+                    <valueenum>true|false</valueenum>
+                </associatedArgument>
+            </option>
 
             <option id="validate" maxOccurs="1">
                 <annotation>

Modified: cxf/branches/2.3.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml?rev=1079811&r1=1079810&r2=1079811&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml
(original)
+++ cxf/branches/2.3.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml
Wed Mar  9 14:14:38 2011
@@ -235,6 +235,16 @@ Examples:
                     <valueenum>true|false</valueenum>
                 </associatedArgument>
             </option>
+            
+            <option id="generatetypes" maxOccurs="1">
+                <annotation>Enables the processing of generating the type class from
schema. The default is true.
+                </annotation>
+                <switch>gt</switch>
+                <associatedArgument placement="afterSpace">
+                    <annotation>(true, false)</annotation>
+                    <valueenum>true|false</valueenum>
+                </associatedArgument>
+            </option>
 
             <option id="defaultns" maxOccurs="1">
                 <annotation>

Modified: cxf/branches/2.3.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java?rev=1079811&r1=1079810&r2=1079811&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
(original)
+++ cxf/branches/2.3.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
Wed Mar  9 14:14:38 2011
@@ -45,6 +45,7 @@ import org.apache.cxf.tools.common.ToolC
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.util.AnnotationUtil;
 import org.apache.cxf.tools.wsdlto.AbstractCodeGenTest;
+
 import org.junit.Test;
 
 public class CodeGenTest extends AbstractCodeGenTest {
@@ -1332,6 +1333,14 @@ public class CodeGenTest extends Abstrac
         WebParam wp = (WebParam)m[0].getParameterAnnotations()[1][0];
         assertTrue(wp.header());
     }
+    
+    @Test
+    public void testCXFNotType() throws Exception {
+        env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
+        env.put(ToolConstants.CXF_GENERATE_TYPES, "false");
+        processor.setContext(env);
+        processor.execute();
+    }
 
     @Test
     public void testCXF2808() throws Exception {



Mime
View raw message