Class AvroDataFormat
- java.lang.Object
-
- org.apache.camel.model.IdentifiedType
-
- org.apache.camel.model.DataFormatDefinition
-
- org.apache.camel.model.dataformat.AvroDataFormat
-
@Metadata(firstVersion="2.14.0", label="dataformat,transformation", title="Avro") public class AvroDataFormat extends DataFormatDefinitionSerialize and deserialize messages using Apache Avro binary data format.
-
-
Constructor Summary
Constructors Constructor Description AvroDataFormat()AvroDataFormat(String instanceClassName)AvroDataFormat(AvroLibrary library)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AvroDataFormatallowUnmarshallType(boolean allowUnmarshallType)AvroDataFormatallowUnmarshallType(String allowUnmarshallType)AvroDataFormatautoDiscoverObjectMapper(boolean autoDiscoverObjectMapper)AvroDataFormatautoDiscoverObjectMapper(String autoDiscoverObjectMapper)AvroDataFormatcollectionType(Class<?> collectionType)AvroDataFormatcollectionType(String collectionType)AvroDataFormatdisableFeatures(String disableFeatures)AvroDataFormatenableFeatures(String enableFeatures)StringgetAllowJmsType()StringgetAllowUnmarshallType()StringgetAutoDiscoverObjectMapper()StringgetAutoDiscoverSchemaResolver()Class<?>getCollectionType()StringgetCollectionTypeName()StringgetContentTypeHeader()StringgetDataFormatName()StringgetDisableFeatures()StringgetEnableFeatures()StringgetInclude()StringgetInstanceClassName()Class<?>getJsonView()StringgetJsonViewTypeName()AvroLibrarygetLibrary()StringgetModuleClassNames()StringgetModuleRefs()StringgetObjectMapper()ObjectgetSchema()StringgetSchemaResolver()StringgetTimezone()Class<?>getUnmarshalType()StringgetUnmarshalTypeName()StringgetUseDefaultObjectMapper()StringgetUseList()AvroDataFormatinclude(String include)AvroDataFormatjsonView(Class<?> jsonView)AvroDataFormatmoduleClassNames(String moduleClassNames)AvroDataFormatmoduleRefs(String moduleRefs)AvroDataFormatobjectMapper(String objectMapper)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.voidsetAutoDiscoverObjectMapper(String autoDiscoverObjectMapper)If set to true then Jackson will lookup for an objectMapper into the registryvoidsetAutoDiscoverSchemaResolver(String autoDiscoverSchemaResolver)When not disabled, the SchemaResolver will be looked up into the registryvoidsetCollectionType(Class<?> collectionType)voidsetCollectionTypeName(String collectionTypeName)Refers to a custom collection type to lookup in the registry to use.voidsetContentTypeHeader(String contentTypeHeader)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.voidsetInclude(String include)If you want to marshal a pojo to JSON, and the pojo has some fields with null values.voidsetInstanceClassName(String instanceClassName)Class name to use for marshal and unmarshallingvoidsetJsonView(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.voidsetLibrary(AvroLibrary library)Which Avro library to use.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.voidsetObjectMapper(String objectMapper)Lookup and use the existing ObjectMapper with the given id when using Jackson.voidsetSchema(Object schema)voidsetSchemaResolver(String schemaResolver)Optional schema resolver used to lookup schemas for the data in transit.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 unmarshallingvoidsetUseDefaultObjectMapper(String useDefaultObjectMapper)Whether to lookup and use default Jackson ObjectMapper from the registry.voidsetUseList(String useList)To unmarshal to a List of Map or a List of Pojo.AvroDataFormatunmarshalType(Class<?> unmarshalType)AvroDataFormatunmarshalType(String unmarshalType)AvroDataFormatuseDefaultObjectMapper(boolean useDefaultObjectMapper)AvroDataFormatuseDefaultObjectMapper(String useDefaultObjectMapper)AvroDataFormatuseList(boolean useList)AvroDataFormatuseList(String useList)-
Methods inherited from class org.apache.camel.model.DataFormatDefinition
getDataFormat, getShortName, setDataFormat, setDataFormatName
-
Methods inherited from class org.apache.camel.model.IdentifiedType
getId, setId
-
-
-
-
Constructor Detail
-
AvroDataFormat
public AvroDataFormat()
-
AvroDataFormat
public AvroDataFormat(AvroLibrary library)
-
AvroDataFormat
public AvroDataFormat(String instanceClassName)
-
-
Method Detail
-
getInstanceClassName
public String getInstanceClassName()
-
setInstanceClassName
public void setInstanceClassName(String instanceClassName)
Class name to use for marshal and unmarshalling
-
getSchema
public Object getSchema()
-
setSchema
public void setSchema(Object schema)
-
getLibrary
public AvroLibrary getLibrary()
-
setLibrary
public void setLibrary(AvroLibrary library)
Which Avro library to use.
-
getContentTypeHeader
public String getContentTypeHeader()
-
setContentTypeHeader
public void setContentTypeHeader(String contentTypeHeader)
-
getObjectMapper
public String getObjectMapper()
-
setObjectMapper
public void setObjectMapper(String objectMapper)
Lookup and use the existing ObjectMapper with the given id when using Jackson.
-
getUseDefaultObjectMapper
public String getUseDefaultObjectMapper()
-
setUseDefaultObjectMapper
public void setUseDefaultObjectMapper(String useDefaultObjectMapper)
Whether to lookup and use default Jackson ObjectMapper from the registry.
-
getUnmarshalTypeName
public String getUnmarshalTypeName()
-
setUnmarshalTypeName
public void setUnmarshalTypeName(String unmarshalTypeName)
Class name of the java type to use when unmarshalling
-
getUnmarshalType
public Class<?> getUnmarshalType()
-
setUnmarshalType
public void setUnmarshalType(Class<?> unmarshalType)
Class of the java type to use when unmarshalling
-
getJsonViewTypeName
public String getJsonViewTypeName()
-
setJsonViewTypeName
public void setJsonViewTypeName(String jsonViewTypeName)
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
public Class<?> getJsonView()
-
setJsonView
public void setJsonView(Class<?> jsonView)
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
public String getInclude()
-
setInclude
public void setInclude(String include)
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
public String getAllowJmsType()
-
setAllowJmsType
public void setAllowJmsType(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.
-
getCollectionTypeName
public String getCollectionTypeName()
-
setCollectionTypeName
public void setCollectionTypeName(String collectionTypeName)
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
public Class<?> getCollectionType()
-
setCollectionType
public void setCollectionType(Class<?> collectionType)
-
getUseList
public String getUseList()
-
setUseList
public void setUseList(String useList)
To unmarshal to a List of Map or a List of Pojo.
-
getModuleClassNames
public String getModuleClassNames()
-
setModuleClassNames
public void setModuleClassNames(String moduleClassNames)
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
public String getModuleRefs()
-
setModuleRefs
public void setModuleRefs(String moduleRefs)
To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma.
-
getEnableFeatures
public String getEnableFeatures()
-
setEnableFeatures
public void setEnableFeatures(String enableFeatures)
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
public String getDisableFeatures()
-
setDisableFeatures
public void setDisableFeatures(String disableFeatures)
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
public String getAllowUnmarshallType()
-
setAllowUnmarshallType
public void setAllowUnmarshallType(String allowUnmarshallType)
If enabled then Jackson is allowed to attempt to use the CamelJacksonUnmarshalType header during the unmarshalling. This should only be enabled when desired to be used.
-
getTimezone
public String getTimezone()
-
setTimezone
public void setTimezone(String timezone)
If set then Jackson will use the Timezone when marshalling/unmarshalling.
-
getAutoDiscoverObjectMapper
public String getAutoDiscoverObjectMapper()
-
setAutoDiscoverObjectMapper
public void setAutoDiscoverObjectMapper(String autoDiscoverObjectMapper)
If set to true then Jackson will lookup for an objectMapper into the registry
-
getDataFormatName
public String getDataFormatName()
- Overrides:
getDataFormatNamein classDataFormatDefinition
-
setSchemaResolver
public void setSchemaResolver(String schemaResolver)
Optional schema resolver used to lookup schemas for the data in transit.
-
getSchemaResolver
public String getSchemaResolver()
-
getAutoDiscoverSchemaResolver
public String getAutoDiscoverSchemaResolver()
-
setAutoDiscoverSchemaResolver
public void setAutoDiscoverSchemaResolver(String autoDiscoverSchemaResolver)
When not disabled, the SchemaResolver will be looked up into the registry
-
objectMapper
public AvroDataFormat objectMapper(String objectMapper)
-
useDefaultObjectMapper
public AvroDataFormat useDefaultObjectMapper(boolean useDefaultObjectMapper)
-
useDefaultObjectMapper
public AvroDataFormat useDefaultObjectMapper(String useDefaultObjectMapper)
-
unmarshalType
public AvroDataFormat unmarshalType(String unmarshalType)
-
unmarshalType
public AvroDataFormat unmarshalType(Class<?> unmarshalType)
-
jsonView
public AvroDataFormat jsonView(Class<?> jsonView)
-
include
public AvroDataFormat include(String include)
-
collectionType
public AvroDataFormat collectionType(String collectionType)
-
collectionType
public AvroDataFormat collectionType(Class<?> collectionType)
-
useList
public AvroDataFormat useList(boolean useList)
-
useList
public AvroDataFormat useList(String useList)
-
moduleClassNames
public AvroDataFormat moduleClassNames(String moduleClassNames)
-
moduleRefs
public AvroDataFormat moduleRefs(String moduleRefs)
-
enableFeatures
public AvroDataFormat enableFeatures(String enableFeatures)
-
disableFeatures
public AvroDataFormat disableFeatures(String disableFeatures)
-
allowUnmarshallType
public AvroDataFormat allowUnmarshallType(boolean allowUnmarshallType)
-
allowUnmarshallType
public AvroDataFormat allowUnmarshallType(String allowUnmarshallType)
-
autoDiscoverObjectMapper
public AvroDataFormat autoDiscoverObjectMapper(boolean autoDiscoverObjectMapper)
-
autoDiscoverObjectMapper
public AvroDataFormat autoDiscoverObjectMapper(String autoDiscoverObjectMapper)
-
-