Class JacksonXMLDataFormat
java.lang.Object
org.apache.camel.model.IdentifiedType
org.apache.camel.model.DataFormatDefinition
org.apache.camel.model.dataformat.JacksonXMLDataFormat
- All Implemented Interfaces:
ContentTypeHeaderAware
@Metadata(firstVersion="2.16.0",
label="dataformat,transformation,xml",
title="Jackson XML")
public class JacksonXMLDataFormat
extends DataFormatDefinition
implements ContentTypeHeaderAware
Unmarshal an XML payloads to POJOs and back using XMLMapper extension of Jackson.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilderis a specific builder forJacksonXMLDataFormat. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<?>Whether the data format should set the Content-Type header with the type from the data format.Class<?>Class<?>voidsetAllowJmsType(String allowJmsType) Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to.voidsetAllowUnmarshallType(String allowUnmarshallType) If enabled then Jackson is allowed to attempt to use the CamelJacksonUnmarshalType header during the unmarshalling.voidsetCollectionType(Class<?> collectionType) voidsetCollectionTypeName(String collectionTypeName) Refers to a custom collection type to lookup in the registry to use.voidsetContentTypeHeader(String contentTypeHeader) Whether the data format should set the Content-Type header with the type from the data format.voidsetDisableFeatures(String disableFeatures) Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper.voidsetEnableFeatures(String enableFeatures) Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper.voidsetEnableJaxbAnnotationModule(String enableJaxbAnnotationModule) Whether to enable the JAXB annotations module when using jackson.voidsetInclude(String include) If you want to marshal a pojo to JSON, and the pojo has some fields with null values.voidsetJsonView(Class<?> jsonView) When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output.voidsetJsonViewTypeName(String jsonViewTypeName) When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output.voidsetModuleClassNames(String moduleClassNames) To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names.voidsetModuleRefs(String moduleRefs) To use custom Jackson modules referred from the Camel registry.voidsetPrettyPrint(String prettyPrint) To enable pretty printing output nicely formatted.voidsetTimezone(String timezone) If set then Jackson will use the Timezone when marshalling/unmarshalling.voidsetUnmarshalType(Class<?> unmarshalType) Class of the java type to use when unmarshallingvoidsetUnmarshalTypeName(String unmarshalTypeName) Class name of the java type to use when unmarshallingvoidsetUseList(String useList) To unmarshal to a List of Map or a List of Pojo.voidsetXmlMapper(String xmlMapper) Lookup and use the existing XmlMapper with the given id.Methods inherited from class org.apache.camel.model.DataFormatDefinition
getDataFormat, getDataFormatName, getShortName, setDataFormat, setDataFormatNameMethods inherited from class org.apache.camel.model.IdentifiedType
getId, setId
-
Constructor Details
-
JacksonXMLDataFormat
public JacksonXMLDataFormat()
-
-
Method Details
-
getXmlMapper
-
setXmlMapper
Lookup and use the existing XmlMapper with the given id. -
getPrettyPrint
-
setPrettyPrint
To enable pretty printing output nicely formatted. Is by default false. -
getUnmarshalTypeName
-
setUnmarshalTypeName
Class name of the java type to use when unmarshalling -
getUnmarshalType
-
setUnmarshalType
Class of the java type to use when unmarshalling -
getJsonViewTypeName
-
setJsonViewTypeName
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 -
getJsonView
-
setJsonView
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 -
getInclude
-
setInclude
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 -
getAllowJmsType
-
setAllowJmsType
Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to. -
getCollectionTypeName
-
setCollectionTypeName
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. -
getCollectionType
-
setCollectionType
-
getUseList
-
setUseList
To unmarshal to a List of Map or a List of Pojo. -
getEnableJaxbAnnotationModule
-
setEnableJaxbAnnotationModule
Whether to enable the JAXB annotations module when using jackson. When enabled then JAXB annotations can be used by Jackson. -
getModuleClassNames
-
setModuleClassNames
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. -
getModuleRefs
-
setModuleRefs
To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma. -
getEnableFeatures
-
setEnableFeatures
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 -
getDisableFeatures
-
setDisableFeatures
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 -
getAllowUnmarshallType
-
setAllowUnmarshallType
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. -
getContentTypeHeader
Description copied from interface:ContentTypeHeaderAwareWhether 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 etc.- Specified by:
getContentTypeHeaderin interfaceContentTypeHeaderAware
-
setContentTypeHeader
Description copied from interface:ContentTypeHeaderAwareWhether 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 etc.- Specified by:
setContentTypeHeaderin interfaceContentTypeHeaderAware
-
getTimezone
-
setTimezone
If set then Jackson will use the Timezone when marshalling/unmarshalling.
-