cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-5757] Adding WADlGenerator linkAnyMediaTypeToXmlSchema, deprecating linkJsonToXmlSchema
Date Wed, 21 May 2014 12:15:16 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 7553e8420 -> ffc3fb9a8


[CXF-5757] Adding WADlGenerator linkAnyMediaTypeToXmlSchema, deprecating linkJsonToXmlSchema


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/ffc3fb9a
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/ffc3fb9a
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/ffc3fb9a

Branch: refs/heads/master
Commit: ffc3fb9a865eccd2e3e3e8904c040631058224ce
Parents: 7553e84
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Wed May 21 13:14:54 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Wed May 21 13:14:54 2014 +0100

----------------------------------------------------------------------
 .../apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java   | 4 ++--
 .../java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java | 9 +++++++--
 2 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/ffc3fb9a/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java
----------------------------------------------------------------------
diff --git a/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java
b/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java
index 985525f..5ec4025 100644
--- a/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java
+++ b/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java
@@ -144,7 +144,7 @@ public class Java2WADLMojo extends AbstractMojo {
     /**
      * @parameter default-value="false"
      */
-    private boolean linkJsonToXmlSchema;
+    private boolean linkAnyMediaTypeToXmlSchema;
     
     /**
      * @parameter default-value="false"
@@ -188,7 +188,7 @@ public class Java2WADLMojo extends AbstractMojo {
         wg.setUseSingleSlashResource(useSingleSlashResource);
         wg.setIgnoreForwardSlash(ignoreForwardSlash);
         wg.setAddResourceAndMethodIds(addResourceAndMethodIds);
-        wg.setLinkJsonToXmlSchema(linkJsonToXmlSchema);
+        wg.setLinkAnyMediaTypeToXmlSchema(linkAnyMediaTypeToXmlSchema);
         wg.setCheckAbsolutePathSlash(checkAbsolutePathSlash);
          
         if (applicationTitle != null) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/ffc3fb9a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
----------------------------------------------------------------------
diff --git a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
index c72af89..af12984 100644
--- a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
+++ b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
@@ -135,6 +135,7 @@ public class WadlGenerator implements ContainerRequestFilter {
     private boolean addResourceAndMethodIds;
     private boolean ignoreRequests;
     private boolean linkJsonToXmlSchema;
+    private boolean linkAnyMediaTypeToXmlSchema;
     private boolean useJaxbContextForQnames = true;
     private boolean supportCollections = true;
     private boolean supportJaxbXmlType = true;
@@ -861,8 +862,8 @@ public class WadlGenerator implements ContainerRequestFilter {
                 if (isJson) {
                     sb.append(" element=\"").append(theActualType.getSimpleName()).append("\"");
                 } else if (qnameResolver != null
-                           && (mt.getSubtype().contains("xml") || linkJsonToXmlSchema
-                                                                  && mt.getSubtype().contains("json"))
+                           && (mt.getSubtype().contains("xml") || linkAnyMediaTypeToXmlSchema
+                               || linkJsonToXmlSchema && mt.getSubtype().contains("json"))
                            && jaxbTypes.contains(theActualType)) {
                     generateQName(sb, qnameResolver, clsMap, theActualType, isCollection,
                                   getBodyAnnotations(ori, inbound));
@@ -1534,9 +1535,13 @@ public class WadlGenerator implements ContainerRequestFilter {
         this.useSingleSlashResource = useSingleSlashResource;
     }
 
+    @Deprecated
     public void setLinkJsonToXmlSchema(boolean link) {
         linkJsonToXmlSchema = link;
     }
+    public void setLinkAnyMediaTypeToXmlSchema(boolean link) {
+        linkAnyMediaTypeToXmlSchema = link;
+    }
 
     public void setSchemaLocations(List<String> locations) {
 


Mime
View raw message