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:24:01 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 4f3d9d8b8 -> 9132cb69d


[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/9132cb69
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/9132cb69
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/9132cb69

Branch: refs/heads/2.7.x-fixes
Commit: 9132cb69d0fa73637eec3b9e0bad17033e132660
Parents: 4f3d9d8
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:23:35 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/9132cb69/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 de3383a..dc787d4 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
@@ -139,7 +139,7 @@ public class Java2WADLMojo extends AbstractMojo {
     /**
      * @parameter default-value="false"
      */
-    private boolean linkJsonToXmlSchema;
+    private boolean linkAnyMediaTypeToXmlSchema;
     
     /**
      * @parameter
@@ -165,7 +165,7 @@ public class Java2WADLMojo extends AbstractMojo {
         wg.setUseSingleSlashResource(useSingleSlashResource);
         wg.setIgnoreForwardSlash(ignoreForwardSlash);
         wg.setAddResourceAndMethodIds(addResourceAndMethodIds);
-        wg.setLinkJsonToXmlSchema(linkJsonToXmlSchema);
+        wg.setLinkAnyMediaTypeToXmlSchema(linkAnyMediaTypeToXmlSchema);
          
         if (applicationTitle != null) {
             wg.setApplicationTitle(applicationTitle);

http://git-wip-us.apache.org/repos/asf/cxf/blob/9132cb69/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
index dd5d512..216cf11 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
@@ -135,6 +135,7 @@ public class WadlGenerator implements RequestHandler {
     private boolean addResourceAndMethodIds;
     private boolean ignoreRequests;
     private boolean linkJsonToXmlSchema;
+    private boolean linkAnyMediaTypeToXmlSchema;
     private boolean useJaxbContextForQnames = true;
     private boolean supportCollections = true;
     private boolean supportJaxbXmlType = true;
@@ -799,8 +800,8 @@ public class WadlGenerator implements RequestHandler {
                 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));
@@ -1418,6 +1419,10 @@ public class WadlGenerator implements RequestHandler {
         linkJsonToXmlSchema = link;
     }
 
+    public void setLinkAnyMediaTypeToXmlSchema(boolean link) {
+        linkAnyMediaTypeToXmlSchema = link;
+    }
+
     public void setSchemaLocations(List<String> locations) {
 
         externalQnamesMap = new HashMap<String, List<String>>();


Mime
View raw message