You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2016/12/09 10:32:53 UTC

[4/4] camel git commit: CAMEL-10567: Camel-Jackson: Add an option to allow the UnmarshallType header use

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/97e3928d
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/97e3928d
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/97e3928d

Branch: refs/heads/camel-2.18.x
Commit: 97e3928de57c45235cade4b185e4cf2d59f87c28
Parents: 83fef71
Author: Andrea Cosentino <an...@gmail.com>
Authored: Thu Dec 8 09:59:44 2016 +0100
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Fri Dec 9 11:11:11 2016 +0100

----------------------------------------------------------------------
 .../camel/model/dataformat/JsonDataFormat.java    | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/97e3928d/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.
+     * <p/>
+     * 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();