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:35:21 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes f70694ad4 -> b1f55140e


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

Branch: refs/heads/3.0.x-fixes
Commit: b1f55140ed1679c0b11c247b85041c9438563327
Parents: f70694a
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:35:02 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/b1f55140/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 92f33fd..3a5128d 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
@@ -151,11 +151,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;
@@ -166,6 +165,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;
@@ -184,6 +188,8 @@ public class WadlGenerator implements ContainerRequestFilter {
     private List<DocumentationProvider> docProviders = new LinkedList<DocumentationProvider>();
     private ResourceIdGenerator idGenerator;     
     
+    
+    
     public WadlGenerator() {
     }
     
@@ -1147,7 +1153,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);
@@ -2162,6 +2168,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