From 20bc738cb354b4c0c440cba7a31b5b7fca791285 Mon Sep 17 00:00:00 2001 From: Claus Ibsen Date: Thu, 12 Sep 2024 17:38:58 +0200 Subject: [PATCH] CAMEL-21199: camel-jackson - Add useWriter option to allow 2/4-bytes chars (such as japanese) to work with Jackson --- .../camel/catalog/dataformats/jackson.json | 33 +++++----- .../camel/catalog/dataformats/jacksonXml.json | 29 +++++---- .../camel/catalog/models/jacksonXml.json | 29 +++++---- .../org/apache/camel/catalog/models/json.json | 35 +++++----- .../camel/catalog/schemas/camel-spring.xsd | 20 ++++++ .../jackson/JacksonDataFormatConfigurer.java | 2 + .../camel/component/jackson/jackson.json | 33 +++++----- .../src/main/docs/jackson-dataformat.adoc | 6 ++ .../jackson/AbstractJacksonDataFormat.java | 18 ++++- .../jackson/JacksonMarshalUseWriterTest.java | 65 +++++++++++++++++++ .../JacksonXMLDataFormatConfigurer.java | 2 + .../component/jacksonxml/jacksonXml.json | 29 +++++---- .../src/main/docs/jacksonXml-dataformat.adoc | 6 ++ .../jacksonxml/JacksonXMLDataFormat.java | 18 ++++- .../protobuf/ProtobufDataFormat.java | 2 +- .../camel/model/dataformat/jacksonXml.json | 29 +++++---- .../apache/camel/model/dataformat/json.json | 35 +++++----- .../dataformat/JacksonXMLDataFormat.java | 38 +++++++++++ .../model/dataformat/JsonDataFormat.java | 38 +++++++++++ .../JacksonXMLDataFormatReifier.java | 1 + .../dataformat/JsonDataFormatReifier.java | 1 + .../org/apache/camel/xml/in/ModelParser.java | 2 + .../org/apache/camel/xml/out/ModelWriter.java | 2 + .../apache/camel/yaml/out/ModelWriter.java | 2 + .../deserializers/ModelDeserializers.java | 14 +++- .../resources/schema/camelYamlDsl.json | 10 +++ 26 files changed, 373 insertions(+), 126 deletions(-) create mode 100644 components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalUseWriterTest.java diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jackson.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jackson.json index 0f029aec69ab0..5a2cdec82b991 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jackson.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jackson.json @@ -21,21 +21,22 @@ "useDefaultObjectMapper": { "index": 2, "kind": "attribute", "displayName": "Use Default Object Mapper", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to lookup and use default Jackson ObjectMapper from the registry." }, "autoDiscoverObjectMapper": { "index": 3, "kind": "attribute", "displayName": "Auto Discover Object Mapper", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If set to true then Jackson will look for an objectMapper to use from the registry" }, "prettyPrint": { "index": 4, "kind": "attribute", "displayName": "Pretty Print", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To enable pretty printing output nicely formatted. Is by default false." }, - "unmarshalType": { "index": 5, "kind": "attribute", "displayName": "Unmarshal Type", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Class name of the java type to use when unmarshalling" }, - "jsonView": { "index": 6, "kind": "attribute", "displayName": "Json View", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations" }, - "include": { "index": 7, "kind": "attribute", "displayName": "Include", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL" }, - "allowJmsType": { "index": 8, "kind": "attribute", "displayName": "Allow Jms Type", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to." }, - "collectionType": { "index": 9, "kind": "attribute", "displayName": "Collection Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows using different collection types than java.util.Collection based as default." }, - "useList": { "index": 10, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." }, - "moduleClassNames": { "index": 11, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." }, - "moduleRefs": { "index": 12, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." }, - "enableFeatures": { "index": 13, "kind": "attribute", "displayName": "Enable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, - "disableFeatures": { "index": 14, "kind": "attribute", "displayName": "Disable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, - "allowUnmarshallType": { "index": 15, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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." }, - "timezone": { "index": 16, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling. This option will have no effect on the others Json DataFormat, like gson and fastjson." }, - "schemaResolver": { "index": 17, "kind": "attribute", "displayName": "Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.jackson.SchemaResolver", "deprecated": false, "autowired": false, "secret": false, "description": "Optional schema resolver used to lookup schemas for the data in transit." }, - "autoDiscoverSchemaResolver": { "index": 18, "kind": "attribute", "displayName": "Auto Discover Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "When not disabled, the SchemaResolver will be looked up into the registry" }, - "namingStrategy": { "index": 19, "kind": "attribute", "displayName": "Naming Strategy", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the the defined Property Naming Strategy.Possible values are: LOWER_CAMEL_CASE, LOWER_DOT_CASE, LOWER_CASE, KEBAB_CASE, SNAKE_CASE and UPPER_CAMEL_CASE" }, - "contentTypeHeader": { "index": 20, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshalling to JSON" } + "useWriter": { "index": 5, "kind": "attribute", "displayName": "Use Writer", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Force using generator that outputs JSON content using a java.io.Writer which handles character encoding. This should be preferred when using 2-byte\/4-byte characters such as Japanese." }, + "unmarshalType": { "index": 6, "kind": "attribute", "displayName": "Unmarshal Type", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Class name of the java type to use when unmarshalling" }, + "jsonView": { "index": 7, "kind": "attribute", "displayName": "Json View", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations" }, + "include": { "index": 8, "kind": "attribute", "displayName": "Include", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL" }, + "allowJmsType": { "index": 9, "kind": "attribute", "displayName": "Allow Jms Type", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to." }, + "collectionType": { "index": 10, "kind": "attribute", "displayName": "Collection Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows using different collection types than java.util.Collection based as default." }, + "useList": { "index": 11, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." }, + "moduleClassNames": { "index": 12, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." }, + "moduleRefs": { "index": 13, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." }, + "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, + "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, + "allowUnmarshallType": { "index": 16, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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." }, + "timezone": { "index": 17, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling. This option will have no effect on the others Json DataFormat, like gson and fastjson." }, + "schemaResolver": { "index": 18, "kind": "attribute", "displayName": "Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.jackson.SchemaResolver", "deprecated": false, "autowired": false, "secret": false, "description": "Optional schema resolver used to lookup schemas for the data in transit." }, + "autoDiscoverSchemaResolver": { "index": 19, "kind": "attribute", "displayName": "Auto Discover Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "When not disabled, the SchemaResolver will be looked up into the registry" }, + "namingStrategy": { "index": 20, "kind": "attribute", "displayName": "Naming Strategy", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the the defined Property Naming Strategy.Possible values are: LOWER_CAMEL_CASE, LOWER_DOT_CASE, LOWER_CASE, KEBAB_CASE, SNAKE_CASE and UPPER_CAMEL_CASE" }, + "contentTypeHeader": { "index": 21, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshalling to JSON" } } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jacksonXml.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jacksonXml.json index f77c64d4d59d3..49ccd095846af 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jacksonXml.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/jacksonXml.json @@ -19,19 +19,20 @@ "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }, "xmlMapper": { "index": 1, "kind": "attribute", "displayName": "Xml Mapper", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Lookup and use the existing XmlMapper with the given id." }, "prettyPrint": { "index": 2, "kind": "attribute", "displayName": "Pretty Print", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To enable pretty printing output nicely formatted. Is by default false." }, - "unmarshalType": { "index": 3, "kind": "attribute", "displayName": "Unmarshal Type", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Class name of the java type to use when unmarshalling" }, - "allowUnmarshallType": { "index": 4, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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." }, - "jsonView": { "index": 5, "kind": "attribute", "displayName": "Json View", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations" }, - "include": { "index": 6, "kind": "attribute", "displayName": "Include", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL" }, - "allowJmsType": { "index": 7, "kind": "attribute", "displayName": "Allow Jms Type", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to." }, - "collectionType": { "index": 8, "kind": "attribute", "displayName": "Collection Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows to use different collection types than java.util.Collection based as default." }, - "useList": { "index": 9, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." }, - "timezone": { "index": 10, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling." }, - "enableJaxbAnnotationModule": { "index": 11, "kind": "attribute", "displayName": "Enable Jaxb Annotation Module", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to enable the JAXB annotations module when using jackson. When enabled then JAXB annotations can be used by Jackson." }, - "moduleClassNames": { "index": 12, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." }, - "moduleRefs": { "index": 13, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." }, - "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, - "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, - "contentTypeHeader": { "index": 16, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshalling to JSON" } + "useWriter": { "index": 3, "kind": "attribute", "displayName": "Use Writer", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Force using generator that outputs XML content using a java.io.Writer which handles character encoding. This should be preferred when using 2-byte\/4-byte characters such as Japanese." }, + "unmarshalType": { "index": 4, "kind": "attribute", "displayName": "Unmarshal Type", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Class name of the java type to use when unmarshalling" }, + "allowUnmarshallType": { "index": 5, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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." }, + "jsonView": { "index": 6, "kind": "attribute", "displayName": "Json View", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations" }, + "include": { "index": 7, "kind": "attribute", "displayName": "Include", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL" }, + "allowJmsType": { "index": 8, "kind": "attribute", "displayName": "Allow Jms Type", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to." }, + "collectionType": { "index": 9, "kind": "attribute", "displayName": "Collection Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows to use different collection types than java.util.Collection based as default." }, + "useList": { "index": 10, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." }, + "timezone": { "index": 11, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling." }, + "enableJaxbAnnotationModule": { "index": 12, "kind": "attribute", "displayName": "Enable Jaxb Annotation Module", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to enable the JAXB annotations module when using jackson. When enabled then JAXB annotations can be used by Jackson." }, + "moduleClassNames": { "index": 13, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." }, + "moduleRefs": { "index": 14, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." }, + "enableFeatures": { "index": 15, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, + "disableFeatures": { "index": 16, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, + "contentTypeHeader": { "index": 17, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshalling to JSON" } } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/jacksonXml.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/jacksonXml.json index 0f22728a934f3..9943337f1b405 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/jacksonXml.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/jacksonXml.json @@ -16,19 +16,20 @@ "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }, "xmlMapper": { "index": 1, "kind": "attribute", "displayName": "Xml Mapper", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Lookup and use the existing XmlMapper with the given id." }, "prettyPrint": { "index": 2, "kind": "attribute", "displayName": "Pretty Print", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To enable pretty printing output nicely formatted. Is by default false." }, - "unmarshalType": { "index": 3, "kind": "attribute", "displayName": "Unmarshal Type", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Class name of the java type to use when unmarshalling" }, - "allowUnmarshallType": { "index": 4, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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." }, - "jsonView": { "index": 5, "kind": "attribute", "displayName": "Json View", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations" }, - "include": { "index": 6, "kind": "attribute", "displayName": "Include", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL" }, - "allowJmsType": { "index": 7, "kind": "attribute", "displayName": "Allow Jms Type", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to." }, - "collectionType": { "index": 8, "kind": "attribute", "displayName": "Collection Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows to use different collection types than java.util.Collection based as default." }, - "useList": { "index": 9, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." }, - "timezone": { "index": 10, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling." }, - "enableJaxbAnnotationModule": { "index": 11, "kind": "attribute", "displayName": "Enable Jaxb Annotation Module", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to enable the JAXB annotations module when using jackson. When enabled then JAXB annotations can be used by Jackson." }, - "moduleClassNames": { "index": 12, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." }, - "moduleRefs": { "index": 13, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." }, - "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, - "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, - "contentTypeHeader": { "index": 16, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshalling to JSON" } + "useWriter": { "index": 3, "kind": "attribute", "displayName": "Use Writer", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Force using generator that outputs XML content using a java.io.Writer which handles character encoding. This should be preferred when using 2-byte\/4-byte characters such as Japanese." }, + "unmarshalType": { "index": 4, "kind": "attribute", "displayName": "Unmarshal Type", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Class name of the java type to use when unmarshalling" }, + "allowUnmarshallType": { "index": 5, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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." }, + "jsonView": { "index": 6, "kind": "attribute", "displayName": "Json View", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations" }, + "include": { "index": 7, "kind": "attribute", "displayName": "Include", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL" }, + "allowJmsType": { "index": 8, "kind": "attribute", "displayName": "Allow Jms Type", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to." }, + "collectionType": { "index": 9, "kind": "attribute", "displayName": "Collection Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows to use different collection types than java.util.Collection based as default." }, + "useList": { "index": 10, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." }, + "timezone": { "index": 11, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling." }, + "enableJaxbAnnotationModule": { "index": 12, "kind": "attribute", "displayName": "Enable Jaxb Annotation Module", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to enable the JAXB annotations module when using jackson. When enabled then JAXB annotations can be used by Jackson." }, + "moduleClassNames": { "index": 13, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." }, + "moduleRefs": { "index": 14, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." }, + "enableFeatures": { "index": 15, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, + "disableFeatures": { "index": 16, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, + "contentTypeHeader": { "index": 17, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshalling to JSON" } } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/json.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/json.json index e36618cd12e5f..5d1b1fe56901e 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/json.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/json.json @@ -18,22 +18,23 @@ "autoDiscoverObjectMapper": { "index": 3, "kind": "attribute", "displayName": "Auto Discover Object Mapper", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If set to true then Jackson will look for an objectMapper to use from the registry" }, "prettyPrint": { "index": 4, "kind": "attribute", "displayName": "Pretty Print", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To enable pretty printing output nicely formatted. Is by default false." }, "library": { "index": 5, "kind": "attribute", "displayName": "Library", "group": "common", "required": false, "type": "enum", "javaType": "org.apache.camel.model.dataformat.JsonLibrary", "enum": [ "Fastjson", "Gson", "Jackson", "Johnzon", "Jsonb" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Jackson", "description": "Which json library to use." }, - "unmarshalType": { "index": 6, "kind": "attribute", "displayName": "Unmarshal Type", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Class name of the java type to use when unmarshalling" }, - "jsonView": { "index": 7, "kind": "attribute", "displayName": "Json View", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations" }, - "include": { "index": 8, "kind": "attribute", "displayName": "Include", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL" }, - "allowJmsType": { "index": 9, "kind": "attribute", "displayName": "Allow Jms Type", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to." }, - "collectionType": { "index": 10, "kind": "attribute", "displayName": "Collection Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows using different collection types than java.util.Collection based as default." }, - "useList": { "index": 11, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." }, - "moduleClassNames": { "index": 12, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." }, - "moduleRefs": { "index": 13, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." }, - "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, - "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, - "allowUnmarshallType": { "index": 16, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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." }, - "timezone": { "index": 17, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling. This option will have no effect on the others Json DataFormat, like gson and fastjson." }, - "schemaResolver": { "index": 18, "kind": "attribute", "displayName": "Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.jackson.SchemaResolver", "deprecated": false, "autowired": false, "secret": false, "description": "Optional schema resolver used to lookup schemas for the data in transit." }, - "autoDiscoverSchemaResolver": { "index": 19, "kind": "attribute", "displayName": "Auto Discover Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "When not disabled, the SchemaResolver will be looked up into the registry" }, - "namingStrategy": { "index": 20, "kind": "attribute", "displayName": "Naming Strategy", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the the defined Property Naming Strategy.Possible values are: LOWER_CAMEL_CASE, LOWER_DOT_CASE, LOWER_CASE, KEBAB_CASE, SNAKE_CASE and UPPER_CAMEL_CASE" }, - "contentTypeHeader": { "index": 21, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshalling to JSON" }, - "dateFormatPattern": { "index": 22, "kind": "attribute", "displayName": "Date Format Pattern", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To configure the date format while marshall or unmarshall Date fields in JSON using Gson" } + "useWriter": { "index": 6, "kind": "attribute", "displayName": "Use Writer", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Force using generator that outputs JSON content using a java.io.Writer which handles character encoding. This should be preferred when using 2-byte\/4-byte characters such as Japanese." }, + "unmarshalType": { "index": 7, "kind": "attribute", "displayName": "Unmarshal Type", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Class name of the java type to use when unmarshalling" }, + "jsonView": { "index": 8, "kind": "attribute", "displayName": "Json View", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations" }, + "include": { "index": 9, "kind": "attribute", "displayName": "Include", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL" }, + "allowJmsType": { "index": 10, "kind": "attribute", "displayName": "Allow Jms Type", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to." }, + "collectionType": { "index": 11, "kind": "attribute", "displayName": "Collection Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows using different collection types than java.util.Collection based as default." }, + "useList": { "index": 12, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." }, + "moduleClassNames": { "index": 13, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." }, + "moduleRefs": { "index": 14, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." }, + "enableFeatures": { "index": 15, "kind": "attribute", "displayName": "Enable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, + "disableFeatures": { "index": 16, "kind": "attribute", "displayName": "Disable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, + "allowUnmarshallType": { "index": 17, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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." }, + "timezone": { "index": 18, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling. This option will have no effect on the others Json DataFormat, like gson and fastjson." }, + "schemaResolver": { "index": 19, "kind": "attribute", "displayName": "Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.jackson.SchemaResolver", "deprecated": false, "autowired": false, "secret": false, "description": "Optional schema resolver used to lookup schemas for the data in transit." }, + "autoDiscoverSchemaResolver": { "index": 20, "kind": "attribute", "displayName": "Auto Discover Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "When not disabled, the SchemaResolver will be looked up into the registry" }, + "namingStrategy": { "index": 21, "kind": "attribute", "displayName": "Naming Strategy", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the the defined Property Naming Strategy.Possible values are: LOWER_CAMEL_CASE, LOWER_DOT_CASE, LOWER_CASE, KEBAB_CASE, SNAKE_CASE and UPPER_CAMEL_CASE" }, + "contentTypeHeader": { "index": 22, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshalling to JSON" }, + "dateFormatPattern": { "index": 23, "kind": "attribute", "displayName": "Date Format Pattern", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To configure the date format while marshall or unmarshall Date fields in JSON using Gson" } } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd index 74160e680a532..56ef280c647a9 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd @@ -8736,6 +8736,16 @@ Lookup and use the existing XmlMapper with the given id. + + + + + + + @@ -9133,6 +9143,16 @@ To enable pretty printing output nicely formatted. Is by default false. Default + + + + + + + diff --git a/components/camel-jackson/src/generated/java/org/apache/camel/component/jackson/JacksonDataFormatConfigurer.java b/components/camel-jackson/src/generated/java/org/apache/camel/component/jackson/JacksonDataFormatConfigurer.java index 1939b3ead7871..0914711e7f31e 100644 --- a/components/camel-jackson/src/generated/java/org/apache/camel/component/jackson/JacksonDataFormatConfigurer.java +++ b/components/camel-jackson/src/generated/java/org/apache/camel/component/jackson/JacksonDataFormatConfigurer.java @@ -24,6 +24,8 @@ public boolean configure(CamelContext camelContext, Object target, String name, case "objectMapper": dataformat.setObjectMapper(property(camelContext, com.fasterxml.jackson.databind.ObjectMapper.class, value)); return true; case "usedefaultobjectmapper": case "useDefaultObjectMapper": dataformat.setUseDefaultObjectMapper(property(camelContext, boolean.class, value)); return true; + case "usewriter": + case "useWriter": dataformat.setUseWriter(property(camelContext, boolean.class, value)); return true; case "collectiontype": case "collectionType": dataformat.setCollectionType(property(camelContext, java.lang.Class.class, value)); return true; case "moduleclassnames": diff --git a/components/camel-jackson/src/generated/resources/META-INF/org/apache/camel/component/jackson/jackson.json b/components/camel-jackson/src/generated/resources/META-INF/org/apache/camel/component/jackson/jackson.json index 0f029aec69ab0..5a2cdec82b991 100644 --- a/components/camel-jackson/src/generated/resources/META-INF/org/apache/camel/component/jackson/jackson.json +++ b/components/camel-jackson/src/generated/resources/META-INF/org/apache/camel/component/jackson/jackson.json @@ -21,21 +21,22 @@ "useDefaultObjectMapper": { "index": 2, "kind": "attribute", "displayName": "Use Default Object Mapper", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to lookup and use default Jackson ObjectMapper from the registry." }, "autoDiscoverObjectMapper": { "index": 3, "kind": "attribute", "displayName": "Auto Discover Object Mapper", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If set to true then Jackson will look for an objectMapper to use from the registry" }, "prettyPrint": { "index": 4, "kind": "attribute", "displayName": "Pretty Print", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To enable pretty printing output nicely formatted. Is by default false." }, - "unmarshalType": { "index": 5, "kind": "attribute", "displayName": "Unmarshal Type", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Class name of the java type to use when unmarshalling" }, - "jsonView": { "index": 6, "kind": "attribute", "displayName": "Json View", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations" }, - "include": { "index": 7, "kind": "attribute", "displayName": "Include", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL" }, - "allowJmsType": { "index": 8, "kind": "attribute", "displayName": "Allow Jms Type", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to." }, - "collectionType": { "index": 9, "kind": "attribute", "displayName": "Collection Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows using different collection types than java.util.Collection based as default." }, - "useList": { "index": 10, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." }, - "moduleClassNames": { "index": 11, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." }, - "moduleRefs": { "index": 12, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." }, - "enableFeatures": { "index": 13, "kind": "attribute", "displayName": "Enable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, - "disableFeatures": { "index": 14, "kind": "attribute", "displayName": "Disable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, - "allowUnmarshallType": { "index": 15, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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." }, - "timezone": { "index": 16, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling. This option will have no effect on the others Json DataFormat, like gson and fastjson." }, - "schemaResolver": { "index": 17, "kind": "attribute", "displayName": "Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.jackson.SchemaResolver", "deprecated": false, "autowired": false, "secret": false, "description": "Optional schema resolver used to lookup schemas for the data in transit." }, - "autoDiscoverSchemaResolver": { "index": 18, "kind": "attribute", "displayName": "Auto Discover Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "When not disabled, the SchemaResolver will be looked up into the registry" }, - "namingStrategy": { "index": 19, "kind": "attribute", "displayName": "Naming Strategy", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the the defined Property Naming Strategy.Possible values are: LOWER_CAMEL_CASE, LOWER_DOT_CASE, LOWER_CASE, KEBAB_CASE, SNAKE_CASE and UPPER_CAMEL_CASE" }, - "contentTypeHeader": { "index": 20, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshalling to JSON" } + "useWriter": { "index": 5, "kind": "attribute", "displayName": "Use Writer", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Force using generator that outputs JSON content using a java.io.Writer which handles character encoding. This should be preferred when using 2-byte\/4-byte characters such as Japanese." }, + "unmarshalType": { "index": 6, "kind": "attribute", "displayName": "Unmarshal Type", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Class name of the java type to use when unmarshalling" }, + "jsonView": { "index": 7, "kind": "attribute", "displayName": "Json View", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations" }, + "include": { "index": 8, "kind": "attribute", "displayName": "Include", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL" }, + "allowJmsType": { "index": 9, "kind": "attribute", "displayName": "Allow Jms Type", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to." }, + "collectionType": { "index": 10, "kind": "attribute", "displayName": "Collection Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows using different collection types than java.util.Collection based as default." }, + "useList": { "index": 11, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." }, + "moduleClassNames": { "index": 12, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." }, + "moduleRefs": { "index": 13, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." }, + "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, + "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, + "allowUnmarshallType": { "index": 16, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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." }, + "timezone": { "index": 17, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling. This option will have no effect on the others Json DataFormat, like gson and fastjson." }, + "schemaResolver": { "index": 18, "kind": "attribute", "displayName": "Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.jackson.SchemaResolver", "deprecated": false, "autowired": false, "secret": false, "description": "Optional schema resolver used to lookup schemas for the data in transit." }, + "autoDiscoverSchemaResolver": { "index": 19, "kind": "attribute", "displayName": "Auto Discover Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "When not disabled, the SchemaResolver will be looked up into the registry" }, + "namingStrategy": { "index": 20, "kind": "attribute", "displayName": "Naming Strategy", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the the defined Property Naming Strategy.Possible values are: LOWER_CAMEL_CASE, LOWER_DOT_CASE, LOWER_CASE, KEBAB_CASE, SNAKE_CASE and UPPER_CAMEL_CASE" }, + "contentTypeHeader": { "index": 21, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshalling to JSON" } } } diff --git a/components/camel-jackson/src/main/docs/jackson-dataformat.adoc b/components/camel-jackson/src/main/docs/jackson-dataformat.adoc index e8815fe4d6e15..180155358f86d 100644 --- a/components/camel-jackson/src/main/docs/jackson-dataformat.adoc +++ b/components/camel-jackson/src/main/docs/jackson-dataformat.adoc @@ -31,6 +31,12 @@ include::partial$dataformat-options.adoc[] == Usage +=== 2 and 4 bytes characters + +Jackson will default work with UTF-8 using an optimized JSon generator that only supports UTF-8. +For users that need 2-bytes or 4-bytes (such as Japanese) would need to turn on `useWriter=true` +in the Camel dataformat, to use another JSon generator that lets `java.io.Writer` handle character encodings. + === Using custom ObjectMapper You can configure `JacksonDataFormat` to use a custom `ObjectMapper` in case you need more control of the mapping configuration. diff --git a/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/AbstractJacksonDataFormat.java b/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/AbstractJacksonDataFormat.java index b58764477ac97..acccb8e258e4d 100644 --- a/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/AbstractJacksonDataFormat.java +++ b/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/AbstractJacksonDataFormat.java @@ -19,6 +19,7 @@ import java.io.File; import java.io.InputStream; import java.io.OutputStream; +import java.io.OutputStreamWriter; import java.io.Reader; import java.util.ArrayList; import java.util.Collection; @@ -65,6 +66,7 @@ public abstract class AbstractJacksonDataFormat extends ServiceSupport private CamelContext camelContext; private ObjectMapper objectMapper; private boolean useDefaultObjectMapper = true; + private boolean useWriter; private String collectionTypeName; private Class collectionType; private List modules; @@ -157,7 +159,13 @@ public void marshal(Exchange exchange, Object graph, OutputStream stream) throws if (this.schemaResolver != null) { schema = this.schemaResolver.resolve(exchange); } - this.objectMapper.writerWithView(jsonView).with(schema).writeValue(stream, graph); + if (useWriter) { + try (OutputStreamWriter writer = new OutputStreamWriter(stream)) { + this.objectMapper.writerWithView(jsonView).with(schema).writeValue(writer, graph); + } + } else { + this.objectMapper.writerWithView(jsonView).with(schema).writeValue(stream, graph); + } if (contentTypeHeader) { exchange.getMessage().setHeader(Exchange.CONTENT_TYPE, getDefaultContentType()); @@ -255,6 +263,14 @@ public void setUnmarshalTypeName(String unmarshalTypeName) { this.unmarshalTypeName = unmarshalTypeName; } + public boolean isUseWriter() { + return useWriter; + } + + public void setUseWriter(boolean useWriter) { + this.useWriter = useWriter; + } + public Class getCollectionType() { return collectionType; } diff --git a/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalUseWriterTest.java b/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalUseWriterTest.java new file mode 100644 index 0000000000000..227bcc2a7b8dc --- /dev/null +++ b/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalUseWriterTest.java @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.jackson; + +import java.util.HashMap; +import java.util.Map; + +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.junit5.CamelTestSupport; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class JacksonMarshalUseWriterTest extends CamelTestSupport { + + @Test + public void testUseWriter() throws Exception { + Map in = new HashMap<>(); + in.put("name", "Camel"); + + MockEndpoint mock = getMockEndpoint("mock:reverse"); + mock.expectedMessageCount(1); + mock.message(0).body().isInstanceOf(Map.class); + mock.message(0).body().isEqualTo(in); + + Object marshalled = template.requestBody("direct:in", in); + String marshalledAsString = context.getTypeConverter().convertTo(String.class, marshalled); + assertEquals("{\"name\":\"Camel\"}", marshalledAsString); + + template.sendBody("direct:back", marshalled); + + mock.assertIsSatisfied(); + } + + @Override + protected RouteBuilder createRouteBuilder() { + return new RouteBuilder() { + + @Override + public void configure() { + JacksonDataFormat format = new JacksonDataFormat(); + format.setUseWriter(true); + + from("direct:in").marshal(format); + from("direct:back").unmarshal(format).to("mock:reverse"); + } + }; + } + +} diff --git a/components/camel-jacksonxml/src/generated/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormatConfigurer.java b/components/camel-jacksonxml/src/generated/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormatConfigurer.java index f9c8d7bcf37f0..b6a25acab96bd 100644 --- a/components/camel-jacksonxml/src/generated/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormatConfigurer.java +++ b/components/camel-jacksonxml/src/generated/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormatConfigurer.java @@ -22,6 +22,8 @@ public boolean configure(CamelContext camelContext, Object target, String name, switch (ignoreCase ? name.toLowerCase() : name) { case "xmlmapper": case "xmlMapper": dataformat.setXmlMapper(property(camelContext, com.fasterxml.jackson.dataformat.xml.XmlMapper.class, value)); return true; + case "usewriter": + case "useWriter": dataformat.setUseWriter(property(camelContext, boolean.class, value)); return true; case "collectiontype": case "collectionType": dataformat.setCollectionType(property(camelContext, java.lang.Class.class, value)); return true; case "moduleclassnames": diff --git a/components/camel-jacksonxml/src/generated/resources/META-INF/org/apache/camel/component/jacksonxml/jacksonXml.json b/components/camel-jacksonxml/src/generated/resources/META-INF/org/apache/camel/component/jacksonxml/jacksonXml.json index f77c64d4d59d3..49ccd095846af 100644 --- a/components/camel-jacksonxml/src/generated/resources/META-INF/org/apache/camel/component/jacksonxml/jacksonXml.json +++ b/components/camel-jacksonxml/src/generated/resources/META-INF/org/apache/camel/component/jacksonxml/jacksonXml.json @@ -19,19 +19,20 @@ "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }, "xmlMapper": { "index": 1, "kind": "attribute", "displayName": "Xml Mapper", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Lookup and use the existing XmlMapper with the given id." }, "prettyPrint": { "index": 2, "kind": "attribute", "displayName": "Pretty Print", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To enable pretty printing output nicely formatted. Is by default false." }, - "unmarshalType": { "index": 3, "kind": "attribute", "displayName": "Unmarshal Type", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Class name of the java type to use when unmarshalling" }, - "allowUnmarshallType": { "index": 4, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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." }, - "jsonView": { "index": 5, "kind": "attribute", "displayName": "Json View", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations" }, - "include": { "index": 6, "kind": "attribute", "displayName": "Include", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL" }, - "allowJmsType": { "index": 7, "kind": "attribute", "displayName": "Allow Jms Type", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to." }, - "collectionType": { "index": 8, "kind": "attribute", "displayName": "Collection Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows to use different collection types than java.util.Collection based as default." }, - "useList": { "index": 9, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." }, - "timezone": { "index": 10, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling." }, - "enableJaxbAnnotationModule": { "index": 11, "kind": "attribute", "displayName": "Enable Jaxb Annotation Module", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to enable the JAXB annotations module when using jackson. When enabled then JAXB annotations can be used by Jackson." }, - "moduleClassNames": { "index": 12, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." }, - "moduleRefs": { "index": 13, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." }, - "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, - "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, - "contentTypeHeader": { "index": 16, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshalling to JSON" } + "useWriter": { "index": 3, "kind": "attribute", "displayName": "Use Writer", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Force using generator that outputs XML content using a java.io.Writer which handles character encoding. This should be preferred when using 2-byte\/4-byte characters such as Japanese." }, + "unmarshalType": { "index": 4, "kind": "attribute", "displayName": "Unmarshal Type", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Class name of the java type to use when unmarshalling" }, + "allowUnmarshallType": { "index": 5, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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." }, + "jsonView": { "index": 6, "kind": "attribute", "displayName": "Json View", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations" }, + "include": { "index": 7, "kind": "attribute", "displayName": "Include", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL" }, + "allowJmsType": { "index": 8, "kind": "attribute", "displayName": "Allow Jms Type", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to." }, + "collectionType": { "index": 9, "kind": "attribute", "displayName": "Collection Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows to use different collection types than java.util.Collection based as default." }, + "useList": { "index": 10, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." }, + "timezone": { "index": 11, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling." }, + "enableJaxbAnnotationModule": { "index": 12, "kind": "attribute", "displayName": "Enable Jaxb Annotation Module", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to enable the JAXB annotations module when using jackson. When enabled then JAXB annotations can be used by Jackson." }, + "moduleClassNames": { "index": 13, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." }, + "moduleRefs": { "index": 14, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." }, + "enableFeatures": { "index": 15, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, + "disableFeatures": { "index": 16, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, + "contentTypeHeader": { "index": 17, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshalling to JSON" } } } diff --git a/components/camel-jacksonxml/src/main/docs/jacksonXml-dataformat.adoc b/components/camel-jacksonxml/src/main/docs/jacksonXml-dataformat.adoc index 0c753ed98b170..638e2819803c9 100644 --- a/components/camel-jacksonxml/src/main/docs/jacksonXml-dataformat.adoc +++ b/components/camel-jacksonxml/src/main/docs/jacksonXml-dataformat.adoc @@ -49,6 +49,12 @@ include::partial$dataformat-options.adoc[] == Usage +=== 2 and 4 bytes characters + +Jackson will default work with UTF-8 using an optimized generator that only supports UTF-8. +For users that need 2-bytes or 4-bytes (such as Japanese) would need to turn on `useWriter=true` +in the Camel dataformat, to use another generator that lets `java.io.Writer` handle character encodings. + === Using Jackson XML in Spring DSL When using Data Format in Spring DSL, you need to diff --git a/components/camel-jacksonxml/src/main/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormat.java b/components/camel-jacksonxml/src/main/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormat.java index 4ec59b5bf8f14..e52c7e9733f53 100644 --- a/components/camel-jacksonxml/src/main/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormat.java +++ b/components/camel-jacksonxml/src/main/java/org/apache/camel/component/jacksonxml/JacksonXMLDataFormat.java @@ -19,6 +19,7 @@ import java.io.File; import java.io.InputStream; import java.io.OutputStream; +import java.io.OutputStreamWriter; import java.io.Reader; import java.util.ArrayList; import java.util.Collection; @@ -66,6 +67,7 @@ public class JacksonXMLDataFormat extends ServiceSupport private CamelContext camelContext; private XmlMapper xmlMapper; + private boolean useWriter; private String collectionTypeName; private Class collectionType; private List modules; @@ -169,7 +171,13 @@ public void setCamelContext(CamelContext camelContext) { @Override public void marshal(Exchange exchange, Object graph, OutputStream stream) throws Exception { - this.xmlMapper.writerWithView(jsonView).writeValue(stream, graph); + if (useWriter) { + try (OutputStreamWriter writer = new OutputStreamWriter(stream)) { + this.xmlMapper.writerWithView(jsonView).writeValue(writer, graph); + } + } else { + this.xmlMapper.writerWithView(jsonView).writeValue(stream, graph); + } if (contentTypeHeader) { exchange.getMessage().setHeader(Exchange.CONTENT_TYPE, "application/xml"); @@ -255,6 +263,14 @@ public void setUnmarshalType(Class unmarshalType) { this.unmarshalType = unmarshalType; } + public boolean isUseWriter() { + return useWriter; + } + + public void setUseWriter(boolean useWriter) { + this.useWriter = useWriter; + } + public String getCollectionTypeName() { return collectionTypeName; } diff --git a/components/camel-protobuf/src/main/java/org/apache/camel/dataformat/protobuf/ProtobufDataFormat.java b/components/camel-protobuf/src/main/java/org/apache/camel/dataformat/protobuf/ProtobufDataFormat.java index d79ce28489d10..9a91132a1d9dd 100644 --- a/components/camel-protobuf/src/main/java/org/apache/camel/dataformat/protobuf/ProtobufDataFormat.java +++ b/components/camel-protobuf/src/main/java/org/apache/camel/dataformat/protobuf/ProtobufDataFormat.java @@ -44,7 +44,7 @@ @Dataformat("protobuf") @Metadata(excludeProperties = "library,objectMapper,useDefaultObjectMapper,jsonViewTypeName,jsonView,include,allowJmsType," + - "collectionTypeName,collectionType,useList,moduleClassNames,moduleRefs,enableFeatures," + + "collectionTypeName,collectionType,useList,useWriter,moduleClassNames,moduleRefs,enableFeatures," + "disableFeatures,allowUnmarshallType,timezone,autoDiscoverObjectMapper," + "schemaResolver,autoDiscoverSchemaResolver,unmarshalType,unmarshalTypeName") public class ProtobufDataFormat extends ServiceSupport diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/jacksonXml.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/jacksonXml.json index 0f22728a934f3..9943337f1b405 100644 --- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/jacksonXml.json +++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/jacksonXml.json @@ -16,19 +16,20 @@ "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }, "xmlMapper": { "index": 1, "kind": "attribute", "displayName": "Xml Mapper", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Lookup and use the existing XmlMapper with the given id." }, "prettyPrint": { "index": 2, "kind": "attribute", "displayName": "Pretty Print", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To enable pretty printing output nicely formatted. Is by default false." }, - "unmarshalType": { "index": 3, "kind": "attribute", "displayName": "Unmarshal Type", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Class name of the java type to use when unmarshalling" }, - "allowUnmarshallType": { "index": 4, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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." }, - "jsonView": { "index": 5, "kind": "attribute", "displayName": "Json View", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations" }, - "include": { "index": 6, "kind": "attribute", "displayName": "Include", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL" }, - "allowJmsType": { "index": 7, "kind": "attribute", "displayName": "Allow Jms Type", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to." }, - "collectionType": { "index": 8, "kind": "attribute", "displayName": "Collection Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows to use different collection types than java.util.Collection based as default." }, - "useList": { "index": 9, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." }, - "timezone": { "index": 10, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling." }, - "enableJaxbAnnotationModule": { "index": 11, "kind": "attribute", "displayName": "Enable Jaxb Annotation Module", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to enable the JAXB annotations module when using jackson. When enabled then JAXB annotations can be used by Jackson." }, - "moduleClassNames": { "index": 12, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." }, - "moduleRefs": { "index": 13, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." }, - "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, - "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, - "contentTypeHeader": { "index": 16, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshalling to JSON" } + "useWriter": { "index": 3, "kind": "attribute", "displayName": "Use Writer", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Force using generator that outputs XML content using a java.io.Writer which handles character encoding. This should be preferred when using 2-byte\/4-byte characters such as Japanese." }, + "unmarshalType": { "index": 4, "kind": "attribute", "displayName": "Unmarshal Type", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Class name of the java type to use when unmarshalling" }, + "allowUnmarshallType": { "index": 5, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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." }, + "jsonView": { "index": 6, "kind": "attribute", "displayName": "Json View", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations" }, + "include": { "index": 7, "kind": "attribute", "displayName": "Include", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL" }, + "allowJmsType": { "index": 8, "kind": "attribute", "displayName": "Allow Jms Type", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to." }, + "collectionType": { "index": 9, "kind": "attribute", "displayName": "Collection Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows to use different collection types than java.util.Collection based as default." }, + "useList": { "index": 10, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." }, + "timezone": { "index": 11, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling." }, + "enableJaxbAnnotationModule": { "index": 12, "kind": "attribute", "displayName": "Enable Jaxb Annotation Module", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to enable the JAXB annotations module when using jackson. When enabled then JAXB annotations can be used by Jackson." }, + "moduleClassNames": { "index": 13, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." }, + "moduleRefs": { "index": 14, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." }, + "enableFeatures": { "index": 15, "kind": "attribute", "displayName": "Enable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, + "disableFeatures": { "index": 16, "kind": "attribute", "displayName": "Disable Features", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, + "contentTypeHeader": { "index": 17, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshalling to JSON" } } } diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/json.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/json.json index e36618cd12e5f..5d1b1fe56901e 100644 --- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/json.json +++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/dataformat/json.json @@ -18,22 +18,23 @@ "autoDiscoverObjectMapper": { "index": 3, "kind": "attribute", "displayName": "Auto Discover Object Mapper", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If set to true then Jackson will look for an objectMapper to use from the registry" }, "prettyPrint": { "index": 4, "kind": "attribute", "displayName": "Pretty Print", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To enable pretty printing output nicely formatted. Is by default false." }, "library": { "index": 5, "kind": "attribute", "displayName": "Library", "group": "common", "required": false, "type": "enum", "javaType": "org.apache.camel.model.dataformat.JsonLibrary", "enum": [ "Fastjson", "Gson", "Jackson", "Johnzon", "Jsonb" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Jackson", "description": "Which json library to use." }, - "unmarshalType": { "index": 6, "kind": "attribute", "displayName": "Unmarshal Type", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Class name of the java type to use when unmarshalling" }, - "jsonView": { "index": 7, "kind": "attribute", "displayName": "Json View", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations" }, - "include": { "index": 8, "kind": "attribute", "displayName": "Include", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL" }, - "allowJmsType": { "index": 9, "kind": "attribute", "displayName": "Allow Jms Type", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to." }, - "collectionType": { "index": 10, "kind": "attribute", "displayName": "Collection Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows using different collection types than java.util.Collection based as default." }, - "useList": { "index": 11, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." }, - "moduleClassNames": { "index": 12, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." }, - "moduleRefs": { "index": 13, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." }, - "enableFeatures": { "index": 14, "kind": "attribute", "displayName": "Enable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, - "disableFeatures": { "index": 15, "kind": "attribute", "displayName": "Disable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, - "allowUnmarshallType": { "index": 16, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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." }, - "timezone": { "index": 17, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling. This option will have no effect on the others Json DataFormat, like gson and fastjson." }, - "schemaResolver": { "index": 18, "kind": "attribute", "displayName": "Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.jackson.SchemaResolver", "deprecated": false, "autowired": false, "secret": false, "description": "Optional schema resolver used to lookup schemas for the data in transit." }, - "autoDiscoverSchemaResolver": { "index": 19, "kind": "attribute", "displayName": "Auto Discover Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "When not disabled, the SchemaResolver will be looked up into the registry" }, - "namingStrategy": { "index": 20, "kind": "attribute", "displayName": "Naming Strategy", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the the defined Property Naming Strategy.Possible values are: LOWER_CAMEL_CASE, LOWER_DOT_CASE, LOWER_CASE, KEBAB_CASE, SNAKE_CASE and UPPER_CAMEL_CASE" }, - "contentTypeHeader": { "index": 21, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshalling to JSON" }, - "dateFormatPattern": { "index": 22, "kind": "attribute", "displayName": "Date Format Pattern", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To configure the date format while marshall or unmarshall Date fields in JSON using Gson" } + "useWriter": { "index": 6, "kind": "attribute", "displayName": "Use Writer", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Force using generator that outputs JSON content using a java.io.Writer which handles character encoding. This should be preferred when using 2-byte\/4-byte characters such as Japanese." }, + "unmarshalType": { "index": 7, "kind": "attribute", "displayName": "Unmarshal Type", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Class name of the java type to use when unmarshalling" }, + "jsonView": { "index": 8, "kind": "attribute", "displayName": "Json View", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations" }, + "include": { "index": 9, "kind": "attribute", "displayName": "Include", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If you want to marshal a pojo to JSON, and the pojo has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL" }, + "allowJmsType": { "index": 10, "kind": "attribute", "displayName": "Allow Jms Type", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to." }, + "collectionType": { "index": 11, "kind": "attribute", "displayName": "Collection Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows using different collection types than java.util.Collection based as default." }, + "useList": { "index": 12, "kind": "attribute", "displayName": "Use List", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To unmarshal to a List of Map or a List of Pojo." }, + "moduleClassNames": { "index": 13, "kind": "attribute", "displayName": "Module Class Names", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma." }, + "moduleRefs": { "index": 14, "kind": "attribute", "displayName": "Module Refs", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma." }, + "enableFeatures": { "index": 15, "kind": "attribute", "displayName": "Enable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, + "disableFeatures": { "index": 16, "kind": "attribute", "displayName": "Disable Features", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. The features should be a name that matches a enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature Multiple features can be separated by comma" }, + "allowUnmarshallType": { "index": 17, "kind": "attribute", "displayName": "Allow Unmarshall Type", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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." }, + "timezone": { "index": 18, "kind": "attribute", "displayName": "Timezone", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the Timezone when marshalling\/unmarshalling. This option will have no effect on the others Json DataFormat, like gson and fastjson." }, + "schemaResolver": { "index": 19, "kind": "attribute", "displayName": "Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.jackson.SchemaResolver", "deprecated": false, "autowired": false, "secret": false, "description": "Optional schema resolver used to lookup schemas for the data in transit." }, + "autoDiscoverSchemaResolver": { "index": 20, "kind": "attribute", "displayName": "Auto Discover Schema Resolver", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "When not disabled, the SchemaResolver will be looked up into the registry" }, + "namingStrategy": { "index": 21, "kind": "attribute", "displayName": "Naming Strategy", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If set then Jackson will use the the defined Property Naming Strategy.Possible values are: LOWER_CAMEL_CASE, LOWER_DOT_CASE, LOWER_CASE, KEBAB_CASE, SNAKE_CASE and UPPER_CAMEL_CASE" }, + "contentTypeHeader": { "index": 22, "kind": "attribute", "displayName": "Content Type Header", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the data format should set the Content-Type header with the type from the data format. For example application\/xml for data formats marshalling to XML, or application\/json for data formats marshalling to JSON" }, + "dateFormatPattern": { "index": 23, "kind": "attribute", "displayName": "Date Format Pattern", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To configure the date format while marshall or unmarshall Date fields in JSON using Gson" } } } diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JacksonXMLDataFormat.java b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JacksonXMLDataFormat.java index 429817b657a57..a2ed069370449 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JacksonXMLDataFormat.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JacksonXMLDataFormat.java @@ -47,6 +47,11 @@ public class JacksonXMLDataFormat extends DataFormatDefinition implements Conten @XmlAttribute @Metadata(javaType = "java.lang.Boolean") private String prettyPrint; + @XmlAttribute + @Metadata(javaType = "java.lang.Boolean", + description = "Force using generator that outputs XML content using a java.io.Writer which handles character encoding." + + " This should be preferred when using 2-byte/4-byte characters such as Japanese.") + private String useWriter; @XmlAttribute(name = "unmarshalType") private String unmarshalTypeName; @XmlAttribute @@ -98,6 +103,7 @@ protected JacksonXMLDataFormat(JacksonXMLDataFormat builder) { this.collectionType = builder.collectionType; this.xmlMapper = builder.xmlMapper; this.prettyPrint = builder.prettyPrint; + this.useWriter = builder.useWriter; this.unmarshalTypeName = builder.unmarshalTypeName; this.allowUnmarshallType = builder.allowUnmarshallType; this.jsonViewTypeName = builder.jsonViewTypeName; @@ -121,6 +127,7 @@ private JacksonXMLDataFormat(Builder builder) { this.collectionType = builder.collectionType; this.xmlMapper = builder.xmlMapper; this.prettyPrint = builder.prettyPrint; + this.useWriter = builder.useWriter; this.unmarshalTypeName = builder.unmarshalTypeName; this.allowUnmarshallType = builder.allowUnmarshallType; this.jsonViewTypeName = builder.jsonViewTypeName; @@ -153,6 +160,18 @@ public void setXmlMapper(String xmlMapper) { this.xmlMapper = xmlMapper; } + public String getUseWriter() { + return useWriter; + } + + /** + * Force using generator that outputs XML content using a java.io.Writer which handles character encoding. + + This should be preferred when using 2-byte/4-byte characters such as Japanese. + */ + public void setUseWriter(String useWriter) { + this.useWriter = useWriter; + } + public String getPrettyPrint() { return prettyPrint; } @@ -382,6 +401,7 @@ public static class Builder implements DataFormatBuilder { private Class collectionType; private String xmlMapper; private String prettyPrint; + private String useWriter; private String unmarshalTypeName; private String allowUnmarshallType; private String jsonViewTypeName; @@ -425,6 +445,24 @@ public Builder prettyPrint(boolean prettyPrint) { return this; } + /** + * Force using generator that outputs JSON content using a java.io.Writer which handles character encoding. + * This should be preferred when using 2-byte/4-byte characters such as Japanese. + */ + public Builder useWriter(boolean useWriter) { + this.useWriter = Boolean.toString(useWriter); + return this; + } + + /** + * Force using generator that outputs JSON content using a java.io.Writer which handles character encoding. + * This should be preferred when using 2-byte/4-byte characters such as Japanese. + */ + public Builder useWriter(String useWriter) { + this.useWriter = useWriter; + return this; + } + /** * Class name of the java type to use when unmarshalling */ diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java index 5f53443d2c39c..774893ffb566a 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java @@ -48,6 +48,11 @@ public class JsonDataFormat extends DataFormatDefinition implements ContentTypeH @XmlAttribute @Metadata(defaultValue = "Jackson") private JsonLibrary library = JsonLibrary.Jackson; + @XmlAttribute + @Metadata(javaType = "java.lang.Boolean", + description = "Force using generator that outputs JSON content using a java.io.Writer which handles character encoding." + + " This should be preferred when using 2-byte/4-byte characters such as Japanese.") + private String useWriter; @XmlAttribute(name = "unmarshalType") private String unmarshalTypeName; @XmlTransient @@ -124,6 +129,7 @@ protected JsonDataFormat(JsonDataFormat source) { this.autoDiscoverObjectMapper = source.autoDiscoverObjectMapper; this.prettyPrint = source.prettyPrint; this.library = source.library; + this.useWriter = source.useWriter; this.unmarshalTypeName = source.unmarshalTypeName; this.unmarshalType = source.unmarshalType; this.jsonViewTypeName = source.jsonViewTypeName; @@ -153,6 +159,7 @@ private JsonDataFormat(Builder builder) { this.autoDiscoverObjectMapper = builder.autoDiscoverObjectMapper; this.prettyPrint = builder.prettyPrint; this.library = builder.library; + this.useWriter = builder.useWriter; this.unmarshalTypeName = builder.unmarshalTypeName; this.unmarshalType = builder.unmarshalType; this.jsonViewTypeName = builder.jsonViewTypeName; @@ -237,6 +244,18 @@ public void setPrettyPrint(String prettyPrint) { this.prettyPrint = prettyPrint; } + public String getUseWriter() { + return useWriter; + } + + /** + * Force using generator that outputs JSON content using a java.io.Writer which handles character encoding. + * This should be preferred when using 2-byte/4-byte characters such as Japanese. + */ + public void setUseWriter(String useWriter) { + this.useWriter = useWriter; + } + public String getUnmarshalTypeName() { return unmarshalTypeName; } @@ -618,6 +637,7 @@ public static class Builder implements DataFormatBuilder { private String autoDiscoverObjectMapper; private String prettyPrint; private JsonLibrary library = JsonLibrary.Jackson; + private String useWriter; private String unmarshalTypeName; private Class unmarshalType; private String jsonViewTypeName; @@ -733,6 +753,24 @@ public Builder library(JsonLibrary library) { return this; } + /** + * Force using generator that outputs JSON content using a java.io.Writer which handles character encoding. + * This should be preferred when using 2-byte/4-byte characters such as Japanese. + */ + public Builder useWriter(boolean useWriter) { + this.useWriter = Boolean.toString(useWriter); + return this; + } + + /** + * Force using generator that outputs JSON content using a java.io.Writer which handles character encoding. + * This should be preferred when using 2-byte/4-byte characters such as Japanese. + */ + public Builder useWriter(String useWriter) { + this.useWriter = useWriter; + return this; + } + /** * When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson * you can use JSON views to accomplish this. This option is to refer to the class which has @JsonView diff --git a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/JacksonXMLDataFormatReifier.java b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/JacksonXMLDataFormatReifier.java index 6241e65c3f893..108ffcaa1925d 100644 --- a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/JacksonXMLDataFormatReifier.java +++ b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/JacksonXMLDataFormatReifier.java @@ -34,6 +34,7 @@ protected void prepareDataFormatConfig(Map properties) { properties.put("unmarshalType", or(definition.getUnmarshalType(), definition.getUnmarshalTypeName())); properties.put("jsonView", or(definition.getJsonView(), definition.getJsonViewTypeName())); properties.put("prettyPrint", definition.getPrettyPrint()); + properties.put("useWriter", definition.getUseWriter()); properties.put("include", definition.getInclude()); properties.put("allowJmsType", definition.getAllowJmsType()); properties.put("collectionType", or(definition.getCollectionType(), definition.getCollectionTypeName())); diff --git a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/JsonDataFormatReifier.java b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/JsonDataFormatReifier.java index 891a770a57452..59d8c7a521955 100644 --- a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/JsonDataFormatReifier.java +++ b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/JsonDataFormatReifier.java @@ -50,6 +50,7 @@ protected void prepareDataFormatConfig(Map properties) { properties.put("allowJmsType", definition.getAllowJmsType()); properties.put("collectionType", or(definition.getCollectionType(), definition.getCollectionTypeName())); properties.put("useList", definition.getUseList()); + properties.put("useWriter", definition.getUseWriter()); properties.put("moduleClassNames", definition.getModuleClassNames()); properties.put("moduleRefs", definition.getModuleRefs()); properties.put("enableFeatures", definition.getEnableFeatures()); diff --git a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java index 35451c52a9ffb..c9f5b5c45f3ce 100644 --- a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java +++ b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java @@ -1868,6 +1868,7 @@ protected JacksonXMLDataFormat doParseJacksonXMLDataFormat() throws IOException, case "timezone": def.setTimezone(val); yield true; case "unmarshalType": def.setUnmarshalTypeName(val); yield true; case "useList": def.setUseList(val); yield true; + case "useWriter": def.setUseWriter(val); yield true; case "xmlMapper": def.setXmlMapper(val); yield true; default: yield identifiedTypeAttributeHandler().accept(def, key, val); }, noElementHandler(), noValueHandler()); @@ -1928,6 +1929,7 @@ protected JsonDataFormat doParseJsonDataFormat() throws IOException, XmlPullPars case "unmarshalType": def.setUnmarshalTypeName(val); yield true; case "useDefaultObjectMapper": def.setUseDefaultObjectMapper(val); yield true; case "useList": def.setUseList(val); yield true; + case "useWriter": def.setUseWriter(val); yield true; default: yield identifiedTypeAttributeHandler().accept(def, key, val); }, noElementHandler(), noValueHandler()); } diff --git a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java index 9b09a333e2c06..ee62f2e8d449e 100644 --- a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java +++ b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java @@ -2550,6 +2550,7 @@ protected void doWriteJacksonXMLDataFormat(String name, JacksonXMLDataFormat def doWriteAttribute("moduleClassNames", def.getModuleClassNames()); doWriteAttribute("collectionType", def.getCollectionTypeName()); doWriteAttribute("allowJmsType", def.getAllowJmsType()); + doWriteAttribute("useWriter", def.getUseWriter()); doWriteAttribute("jsonView", def.getJsonViewTypeName()); doWriteAttribute("enableFeatures", def.getEnableFeatures()); doWriteAttribute("useList", def.getUseList()); @@ -2609,6 +2610,7 @@ protected void doWriteJsonDataFormat(String name, JsonDataFormat def) throws IOE doWriteAttribute("prettyPrint", def.getPrettyPrint()); doWriteAttribute("unmarshalType", def.getUnmarshalTypeName()); doWriteAttribute("autoDiscoverSchemaResolver", def.getAutoDiscoverSchemaResolver()); + doWriteAttribute("useWriter", def.getUseWriter()); doWriteAttribute("useList", def.getUseList()); doWriteAttribute("disableFeatures", def.getDisableFeatures()); doWriteAttribute("moduleRefs", def.getModuleRefs()); diff --git a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java index 458601ad9ab79..82a4938581df8 100644 --- a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java +++ b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java @@ -2550,6 +2550,7 @@ protected void doWriteJacksonXMLDataFormat(String name, JacksonXMLDataFormat def doWriteAttribute("moduleClassNames", def.getModuleClassNames()); doWriteAttribute("collectionType", def.getCollectionTypeName()); doWriteAttribute("allowJmsType", def.getAllowJmsType()); + doWriteAttribute("useWriter", def.getUseWriter()); doWriteAttribute("jsonView", def.getJsonViewTypeName()); doWriteAttribute("enableFeatures", def.getEnableFeatures()); doWriteAttribute("useList", def.getUseList()); @@ -2609,6 +2610,7 @@ protected void doWriteJsonDataFormat(String name, JsonDataFormat def) throws IOE doWriteAttribute("prettyPrint", def.getPrettyPrint()); doWriteAttribute("unmarshalType", def.getUnmarshalTypeName()); doWriteAttribute("autoDiscoverSchemaResolver", def.getAutoDiscoverSchemaResolver()); + doWriteAttribute("useWriter", def.getUseWriter()); doWriteAttribute("useList", def.getUseList()); doWriteAttribute("disableFeatures", def.getDisableFeatures()); doWriteAttribute("moduleRefs", def.getModuleRefs()); diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java index ab98b777ff5ac..2de7a0d5c41e8 100644 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java @@ -7554,6 +7554,7 @@ protected boolean setProperty(InterceptSendToEndpointDefinition target, String p @YamlProperty(name = "timezone", type = "string", description = "If set then Jackson will use the Timezone when marshalling/unmarshalling.", displayName = "Timezone"), @YamlProperty(name = "unmarshalType", type = "string", description = "Class name of the java type to use when unmarshalling", displayName = "Unmarshal Type"), @YamlProperty(name = "useList", type = "boolean", description = "To unmarshal to a List of Map or a List of Pojo.", displayName = "Use List"), + @YamlProperty(name = "useWriter", type = "boolean", description = "Force using generator that outputs XML content using a java.io.Writer which handles character encoding. This should be preferred when using 2-byte/4-byte characters such as Japanese.", displayName = "Use Writer"), @YamlProperty(name = "xmlMapper", type = "string", description = "Lookup and use the existing XmlMapper with the given id.", displayName = "Xml Mapper") } ) @@ -7652,6 +7653,11 @@ protected boolean setProperty(JacksonXMLDataFormat target, String propertyKey, target.setUseList(val); break; } + case "useWriter": { + String val = asText(node); + target.setUseWriter(val); + break; + } case "xmlMapper": { String val = asText(node); target.setXmlMapper(val); @@ -8226,7 +8232,8 @@ protected boolean setProperty(JsonApiDataFormat target, String propertyKey, @YamlProperty(name = "timezone", type = "string", description = "If set then Jackson will use the Timezone when marshalling/unmarshalling. This option will have no effect on the others Json DataFormat, like gson and fastjson.", displayName = "Timezone"), @YamlProperty(name = "unmarshalType", type = "string", description = "Class name of the java type to use when unmarshalling", displayName = "Unmarshal Type"), @YamlProperty(name = "useDefaultObjectMapper", type = "boolean", description = "Whether to lookup and use default Jackson ObjectMapper from the registry.", displayName = "Use Default Object Mapper"), - @YamlProperty(name = "useList", type = "boolean", description = "To unmarshal to a List of Map or a List of Pojo.", displayName = "Use List") + @YamlProperty(name = "useList", type = "boolean", description = "To unmarshal to a List of Map or a List of Pojo.", displayName = "Use List"), + @YamlProperty(name = "useWriter", type = "boolean", description = "Force using generator that outputs JSON content using a java.io.Writer which handles character encoding. This should be preferred when using 2-byte/4-byte characters such as Japanese.", displayName = "Use Writer") } ) public static class JsonDataFormatDeserializer extends YamlDeserializerBase { @@ -8358,6 +8365,11 @@ protected boolean setProperty(JsonDataFormat target, String propertyKey, target.setUseList(val); break; } + case "useWriter": { + String val = asText(node); + target.setUseWriter(val); + break; + } default: { return false; } diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json index 40d4cf9c8cda4..be3ab70468447 100644 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json @@ -10985,6 +10985,11 @@ "title" : "Use List", "description" : "To unmarshal to a List of Map or a List of Pojo." }, + "useWriter" : { + "type" : "boolean", + "title" : "Use Writer", + "description" : "Force using generator that outputs XML content using a java.io.Writer which handles character encoding. This should be preferred when using 2-byte/4-byte characters such as Japanese." + }, "xmlMapper" : { "type" : "string", "title" : "Xml Mapper", @@ -11254,6 +11259,11 @@ "type" : "boolean", "title" : "Use List", "description" : "To unmarshal to a List of Map or a List of Pojo." + }, + "useWriter" : { + "type" : "boolean", + "title" : "Use Writer", + "description" : "Force using generator that outputs JSON content using a java.io.Writer which handles character encoding. This should be preferred when using 2-byte/4-byte characters such as Japanese." } } },