cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6566] Adding a boolean convertResourcesToDOM property enabled by default
Date Thu, 27 Aug 2015 14:33:00 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 20bb7bafb -> 269dd5f95


[CXF-6566] Adding a boolean convertResourcesToDOM property enabled by default


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

Branch: refs/heads/master
Commit: 269dd5f9504087dc4a0fe243feae6f46cccc7ea5
Parents: 20bb7ba
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Thu Aug 27 15:32:46 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Thu Aug 27 15:32:46 2015 +0100

----------------------------------------------------------------------
 .../apache/cxf/jaxrs/model/wadl/WadlGenerator.java  | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/269dd5f9/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 b3163c5..462c77f 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
@@ -150,11 +150,10 @@ public class WadlGenerator implements ContainerRequestFilter {
     }
     
     private String wadlNamespace;
-    private boolean ignoreMessageWriters = true;
+    
     private boolean singleResourceMultipleMethods = true;
     private boolean useSingleSlashResource;
     private boolean ignoreForwardSlash;
-    private boolean ignoreRequests;
     private boolean linkAnyMediaTypeToXmlSchema;
     private boolean useJaxbContextForQnames = true;
     private boolean supportCollections = true;
@@ -165,6 +164,11 @@ public class WadlGenerator implements ContainerRequestFilter {
     private boolean keepRelativeDocLinks;
     private boolean usePathParamsToCompareOperations = true;
     
+    
+    private boolean ignoreMessageWriters = true;
+    private boolean ignoreRequests;
+    private boolean convertResourcesToDOM = true;
+    
     private List<String> externalSchemasCache;
     private List<URI> externalSchemaLinks;
     private Map<String, List<String>> externalQnamesMap;
@@ -183,6 +187,8 @@ public class WadlGenerator implements ContainerRequestFilter {
     private List<DocumentationProvider> docProviders = new LinkedList<DocumentationProvider>();
     private ResourceIdGenerator idGenerator;     
     
+    
+    
     public WadlGenerator() {
     }
     
@@ -1146,7 +1152,7 @@ public class WadlGenerator implements ContainerRequestFilter {
                 try {
                     InputStream is = ResourceUtils.getResourceStream(loc, (Bus)ep.get(Bus.class.getName()));
                     if (is != null) {
-                        if (isJson(mt)) {
+                        if (!convertResourcesToDOM || isJson(mt)) {
                             return Response.ok(is, mt).build();
                         }
                         Document wadlDoc = StaxUtils.read(is);
@@ -2161,6 +2167,10 @@ public class WadlGenerator implements ContainerRequestFilter {
         this.usePathParamsToCompareOperations = usePathParamsToCompareOperations;
     }
 
+    public void setConvertResourcesToDOM(boolean convertResourcesToDOM) {
+        this.convertResourcesToDOM = convertResourcesToDOM;
+    }
+
     private static class SchemaConverter extends DelegatingXMLStreamWriter {
         private static final String SCHEMA_LOCATION = "schemaLocation";
         private Map<String, String> locsMap;


Mime
View raw message