cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1188134 - in /cxf/branches/2.4.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml
Date Mon, 24 Oct 2011 12:53:42 GMT
Author: sergeyb
Date: Mon Oct 24 12:53:42 2011
New Revision: 1188134

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

........
  r1188131 | sergeyb | 2011-10-24 13:52:09 +0100 (Mon, 24 Oct 2011) | 1 line
  
  [CXF-3875] Checking type and default attributes better
........

Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java
    cxf/branches/2.4.x-fixes/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct 24 12:53:42 2011
@@ -1 +1 @@
-/cxf/trunk:1187370,1187376,1187390,1187401,1188080,1188096
+/cxf/trunk:1187370,1187376,1187390,1187401,1188080,1188096,1188131

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

Modified: cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java?rev=1188134&r1=1188133&r2=1188134&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java
Mon Oct 24 12:53:42 2011
@@ -43,6 +43,7 @@ import java.util.logging.Logger;
 
 import javax.ws.rs.Consumes;
 import javax.ws.rs.DELETE;
+import javax.ws.rs.DefaultValue;
 import javax.ws.rs.FormParam;
 import javax.ws.rs.GET;
 import javax.ws.rs.HEAD;
@@ -803,6 +804,11 @@ public class SourceGenerator {
             if (writeAnnotations(info.isInterfaceGenerated())) {
                 writeAnnotation(sbCode, imports, paramAnn, name, false, false);
                 sbCode.append(" ");
+                String defaultVal = paramEl.getAttribute("default");
+                if (defaultVal.length() > 0) {
+                    writeAnnotation(sbCode, imports, DefaultValue.class, defaultVal, false,
false);
+                    sbCode.append(" ");    
+                }
             }
             boolean isRepeating = Boolean.valueOf(paramEl.getAttribute("repeating"));
             String type = getPrimitiveType(paramEl);
@@ -868,7 +874,7 @@ public class SourceGenerator {
     
     private String getPrimitiveType(Element paramEl) {
         String type = paramEl.getAttribute("type");
-        if (type == null) {
+        if (type.length() == 0) {
             return "String";
         }
         String[] pair = type.split(":");

Modified: cxf/branches/2.4.x-fixes/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml?rev=1188134&r1=1188133&r2=1188134&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml (original)
+++ cxf/branches/2.4.x-fixes/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml Mon
Oct 24 12:53:42 2011
@@ -56,6 +56,11 @@
         <param name="c.a" style="query" type="xs:int"/>
         <param name="c.b" style="query" type="xs:int"/>
         <param name="c.d.a" style="query" type="xs:int"/>
+        <param name="option"  default="A" style="query"
+required="true">
+     <option value="A"/>
+     <option value="B"/>
+   </param> 
       </request>
       <response>
        <representation mediaType="text/plain">



Mime
View raw message