Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9F431200BD5 for ; Thu, 8 Dec 2016 10:30:25 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 9DE68160B2C; Thu, 8 Dec 2016 09:30:25 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E7BD5160B1E for ; Thu, 8 Dec 2016 10:30:24 +0100 (CET) Received: (qmail 79383 invoked by uid 500); 8 Dec 2016 09:30:24 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 79368 invoked by uid 99); 8 Dec 2016 09:30:23 -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, 08 Dec 2016 09:30:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C198DED225; Thu, 8 Dec 2016 09:30:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: acosentino@apache.org To: commits@camel.apache.org Date: Thu, 08 Dec 2016 09:30:24 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/3] camel git commit: CAMEL-10567: Camel-Jackson: Add an option to allow the UnmarshallType header use archived-at: Thu, 08 Dec 2016 09:30:25 -0000 CAMEL-10567: Camel-Jackson: Add an option to allow the UnmarshallType header use Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/02270ab9 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/02270ab9 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/02270ab9 Branch: refs/heads/master Commit: 02270ab9c90ac0d59b85dbd59fb9c1007eb44a1b Parents: 2b0e961 Author: Andrea Cosentino Authored: Thu Dec 8 09:59:44 2016 +0100 Committer: Andrea Cosentino Committed: Thu Dec 8 09:59:44 2016 +0100 ---------------------------------------------------------------------- .../camel/model/dataformat/JsonDataFormat.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/02270ab9/camel-core/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java b/camel-core/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java index 4ee2413..c275b2a 100644 --- a/camel-core/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java +++ b/camel-core/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java @@ -73,6 +73,8 @@ public class JsonDataFormat extends DataFormatDefinition { private String disableFeatures; @XmlAttribute private String permissions; + @XmlAttribute + private Boolean allowUnmarshallType; public JsonDataFormat() { super("json"); @@ -303,6 +305,19 @@ public class JsonDataFormat extends DataFormatDefinition { setPermissions(csb.toString()); } + public Boolean getAllowUnmarshallType() { + return allowUnmarshallType; + } + + /** + * If enabled then Jackson is allowed to attempt to use the CamelJacksonUnmarshalType header during the unmarshalling. + *

+ * This should only be enabled when desired to be used. + */ + public void setAllowUnmarshallType(Boolean allowUnmarshallType) { + this.allowUnmarshallType = allowUnmarshallType; + } + @Override public String getDataFormatName() { // json data format is special as the name can be from different bundles @@ -385,6 +400,9 @@ public class JsonDataFormat extends DataFormatDefinition { if (permissions != null) { setProperty(camelContext, dataFormat, "permissions", permissions); } + if (allowUnmarshallType != null) { + setProperty(camelContext, dataFormat, "allowUnmarshallType", allowUnmarshallType); + } // if we have the unmarshal type, but no permission set, then use it to be allowed if (permissions == null && unmarshalType != null) { String allow = "+" + unmarshalType.getName();