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] Checking the property on the currrent context too
Date Thu, 27 Aug 2015 14:44:05 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes b1f55140e -> dbfbbbbf2


[CXF-6566] Checking the property on the currrent context too


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

Branch: refs/heads/3.0.x-fixes
Commit: dbfbbbbf29732ecae4588200177fc596f1fefa1b
Parents: b1f5514
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Thu Aug 27 15:42:50 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Thu Aug 27 15:43:51 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/dbfbbbbf/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 3a5128d..b33a696 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
@@ -92,6 +92,7 @@ import org.apache.cxf.common.jaxb.JAXBContextProxy;
 import org.apache.cxf.common.jaxb.JAXBUtils;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.PackageUtils;
+import org.apache.cxf.common.util.PropertyUtils;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.common.util.XmlSchemaPrimitiveUtils;
 import org.apache.cxf.common.xmlschema.SchemaCollection;
@@ -135,6 +136,7 @@ public class WadlGenerator implements ContainerRequestFilter {
     public static final String WADL_NS = "http://wadl.dev.java.net/2009/02";
 
     private static final Logger LOG = LogUtils.getL7dLogger(WadlGenerator.class);
+    private static final String CONVERT_WADL_RESOURCES_TO_DOM = "convert.wadl.resources.to.dom";
     private static final String XLS_NS = "http://www.w3.org/1999/XSL/Transform";
     private static final String JAXB_DEFAULT_NAMESPACE = "##default";
     private static final String JAXB_DEFAULT_NAME = "##default";
@@ -1153,7 +1155,10 @@ public class WadlGenerator implements ContainerRequestFilter {
                 try {
                     InputStream is = ResourceUtils.getResourceStream(loc, (Bus)ep.get(Bus.class.getName()));
                     if (is != null) {
-                        if (!convertResourcesToDOM || isJson(mt)) {
+                        Object contextProp = m.getContextualProperty(CONVERT_WADL_RESOURCES_TO_DOM);
+                        boolean doConvertResourcesToDOM = contextProp == null 
+                            ? convertResourcesToDOM : PropertyUtils.isTrue(contextProp);

+                        if (!doConvertResourcesToDOM || isJson(mt)) {
                             return Response.ok(is, mt).build();
                         }
                         Document wadlDoc = StaxUtils.read(is);


Mime
View raw message