Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1AC2810E25 for ; Thu, 27 Aug 2015 14:44:06 +0000 (UTC) Received: (qmail 37387 invoked by uid 500); 27 Aug 2015 14:44:06 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 37343 invoked by uid 500); 27 Aug 2015 14:44:06 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 37334 invoked by uid 99); 27 Aug 2015 14:44:05 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Aug 2015 14:44:05 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BD7D6DFF78; Thu, 27 Aug 2015 14:44:05 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergeyb@apache.org To: commits@cxf.apache.org Message-Id: <9ee49dde0e32425f98a6acc4c9db8517@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: cxf git commit: [CXF-6566] Checking the property on the currrent context too Date: Thu, 27 Aug 2015 14:44:05 +0000 (UTC) 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 Authored: Thu Aug 27 15:42:50 2015 +0100 Committer: Sergey Beryozkin 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);