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 03520200BD9 for ; Fri, 9 Dec 2016 11:32:52 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id F413A160B1C; Fri, 9 Dec 2016 10:32:51 +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 25D75160B2A for ; Fri, 9 Dec 2016 11:32:50 +0100 (CET) Received: (qmail 48468 invoked by uid 500); 9 Dec 2016 10:32:50 -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 48368 invoked by uid 99); 9 Dec 2016 10:32:50 -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; Fri, 09 Dec 2016 10:32:50 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1C1F4E108E; Fri, 9 Dec 2016 10:32:50 +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: Fri, 09 Dec 2016 10:32:51 -0000 Message-Id: <0989637fcc29403abf49dfa80ad444fc@git.apache.org> In-Reply-To: <284b1e61341d4151a397f787d679f4b7@git.apache.org> References: <284b1e61341d4151a397f787d679f4b7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/4] camel git commit: CAMEL-10567: Camel-Jackson: Add an option to allow the UnmarshallType header use archived-at: Fri, 09 Dec 2016 10:32:52 -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/83fef710 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/83fef710 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/83fef710 Branch: refs/heads/camel-2.18.x Commit: 83fef7108456eeac1506853d194cd1360851c4fe Parents: abb45b2 Author: Andrea Cosentino Authored: Thu Dec 8 09:51:19 2016 +0100 Committer: Andrea Cosentino Committed: Fri Dec 9 11:11:11 2016 +0100 ---------------------------------------------------------------------- .../camel/component/jackson/JacksonDataFormat.java | 12 ++++++------ .../jackson/JacksonMarshalUnmarshalTypeHeaderTest.java | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/83fef710/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/JacksonDataFormat.java ---------------------------------------------------------------------- diff --git a/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/JacksonDataFormat.java b/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/JacksonDataFormat.java index 4772619..ec7073f 100644 --- a/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/JacksonDataFormat.java +++ b/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/JacksonDataFormat.java @@ -68,7 +68,7 @@ public class JacksonDataFormat extends ServiceSupport implements DataFormat, Dat private String enableFeatures; private String disableFeatures; private boolean enableJacksonTypeConverter; - private boolean allowJacksonUnmarshallType; + private boolean allowUnmarshallType; /** * Use the default Jackson {@link ObjectMapper} and {@link Object} @@ -160,7 +160,7 @@ public class JacksonDataFormat extends ServiceSupport implements DataFormat, Dat // is there a header with the unmarshal type? Class clazz = unmarshalType; String type = null; - if (allowJacksonUnmarshallType) { + if (allowUnmarshallType) { type = exchange.getIn().getHeader(JacksonConstants.UNMARSHAL_TYPE, String.class); } if (type == null && isAllowJmsType()) { @@ -331,8 +331,8 @@ public class JacksonDataFormat extends ServiceSupport implements DataFormat, Dat this.enableJacksonTypeConverter = enableJacksonTypeConverter; } - public boolean isAllowJacksonUnmarshallType() { - return allowJacksonUnmarshallType; + public boolean isAllowUnmarshallType() { + return allowUnmarshallType; } /** @@ -340,8 +340,8 @@ public class JacksonDataFormat extends ServiceSupport implements DataFormat, Dat *

* This should only be enabled when desired to be used. */ - public void setAllowJacksonUnmarshallType(boolean allowJacksonUnmarshallType) { - this.allowJacksonUnmarshallType = allowJacksonUnmarshallType; + public void setAllowUnmarshallType(boolean allowJacksonUnmarshallType) { + this.allowUnmarshallType = allowJacksonUnmarshallType; } public String getEnableFeatures() { http://git-wip-us.apache.org/repos/asf/camel/blob/83fef710/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalUnmarshalTypeHeaderTest.java ---------------------------------------------------------------------- diff --git a/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalUnmarshalTypeHeaderTest.java b/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalUnmarshalTypeHeaderTest.java index 623b32e..775e7ea 100644 --- a/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalUnmarshalTypeHeaderTest.java +++ b/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalUnmarshalTypeHeaderTest.java @@ -46,7 +46,7 @@ public class JacksonMarshalUnmarshalTypeHeaderTest extends CamelTestSupport { @Override public void configure() throws Exception { JacksonDataFormat format = new JacksonDataFormat(); - format.setAllowJacksonUnmarshallType(true); + format.setAllowUnmarshallType(true); from("direct:backPojo").unmarshal(format).to("mock:reversePojo");