@Dataformat(value="cbor")
public class CBORDataFormat
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.spi.DataFormat, org.apache.camel.spi.DataFormatName
| Constructor and Description |
|---|
CBORDataFormat()
Use the default CBOR Jackson
ObjectMapper and Object |
CBORDataFormat(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
Class<?> unmarshalType)
Use the default CBOR Jackson
ObjectMapper and with a custom unmarshal type |
| Modifier and Type | Method and Description |
|---|---|
void |
disableFeature(com.fasterxml.jackson.databind.DeserializationFeature feature) |
void |
disableFeature(com.fasterxml.jackson.databind.MapperFeature feature) |
void |
disableFeature(com.fasterxml.jackson.databind.SerializationFeature feature) |
protected void |
doInit() |
protected void |
doStop() |
void |
enableFeature(com.fasterxml.jackson.databind.DeserializationFeature feature) |
void |
enableFeature(com.fasterxml.jackson.databind.MapperFeature feature) |
void |
enableFeature(com.fasterxml.jackson.databind.SerializationFeature feature) |
org.apache.camel.CamelContext |
getCamelContext() |
Class<? extends Collection> |
getCollectionType() |
String |
getDataFormatName() |
String |
getDisableFeatures() |
String |
getEnableFeatures() |
com.fasterxml.jackson.databind.ObjectMapper |
getObjectMapper() |
Class<?> |
getUnmarshalType() |
boolean |
isAllowJmsType() |
boolean |
isAllowUnmarshallType() |
boolean |
isEnableJacksonTypeConverter() |
boolean |
isPrettyPrint() |
boolean |
isUseDefaultObjectMapper() |
boolean |
isUseList() |
void |
marshal(org.apache.camel.Exchange exchange,
Object graph,
OutputStream stream) |
void |
setAllowJmsType(boolean allowJmsType)
Allows jackson to use the JMSType header as an indicator what the classname is for unmarshaling json
content to POJO
By default this option is false.
|
void |
setAllowUnmarshallType(boolean allowUnmarshallType) |
void |
setCamelContext(org.apache.camel.CamelContext camelContext) |
void |
setCollectionType(Class<? extends Collection> collectionType) |
void |
setDisableFeatures(String disableFeatures)
Set of features to disable on the Jackson
ObjectMapper. |
void |
setEnableFeatures(String enableFeatures)
Set of features to enable on the Jackson
ObjectMapper. |
void |
setEnableJacksonTypeConverter(boolean enableJacksonTypeConverter)
If enabled then Jackson is allowed to attempt to be used during Camels
type converter as a
FallbackConverter that attempts to convert POJOs to/from Map/List types. |
void |
setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
void |
setPrettyPrint(boolean prettyPrint) |
void |
setUnmarshalType(Class<?> unmarshalType) |
void |
setUseDefaultObjectMapper(boolean useDefaultObjectMapper) |
void |
setUseList(boolean useList) |
Object |
unmarshal(org.apache.camel.Exchange exchange,
InputStream stream) |
void |
useList()
Uses
ArrayList when unmarshalling. |
void |
useMap()
Uses
HashMap when unmarshalling. |
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doStart, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic CBORDataFormat()
ObjectMapper and Objectpublic CBORDataFormat(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
Class<?> unmarshalType)
ObjectMapper and with a custom unmarshal typeunmarshalType - the custom unmarshal typepublic void marshal(org.apache.camel.Exchange exchange,
Object graph,
OutputStream stream)
throws Exception
marshal in interface org.apache.camel.spi.DataFormatExceptionpublic Object unmarshal(org.apache.camel.Exchange exchange, InputStream stream) throws Exception
unmarshal in interface org.apache.camel.spi.DataFormatExceptionpublic String getDataFormatName()
getDataFormatName in interface org.apache.camel.spi.DataFormatNamepublic org.apache.camel.CamelContext getCamelContext()
public void setCamelContext(org.apache.camel.CamelContext camelContext)
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
public Class<?> getUnmarshalType()
public void setUnmarshalType(Class<?> unmarshalType)
public boolean isAllowUnmarshallType()
public void setAllowUnmarshallType(boolean allowUnmarshallType)
public Class<? extends Collection> getCollectionType()
public void setCollectionType(Class<? extends Collection> collectionType)
public boolean isUseList()
public void setUseList(boolean useList)
public boolean isUseDefaultObjectMapper()
public void setUseDefaultObjectMapper(boolean useDefaultObjectMapper)
public void useList()
ArrayList when unmarshalling.public void useMap()
HashMap when unmarshalling.public boolean isPrettyPrint()
public void setPrettyPrint(boolean prettyPrint)
public void setAllowJmsType(boolean allowJmsType)
public boolean isAllowJmsType()
public String getEnableFeatures()
public boolean isEnableJacksonTypeConverter()
public void setEnableJacksonTypeConverter(boolean enableJacksonTypeConverter)
FallbackConverter that attempts to convert POJOs to/from Map/List types.
This should only be enabled when desired to be used.public void setEnableFeatures(String enableFeatures)
ObjectMapper. The features should be a name that matches a enum
from SerializationFeature, DeserializationFeature, or MapperFeature.public String getDisableFeatures()
public void setDisableFeatures(String disableFeatures)
ObjectMapper. The features should be a name that matches a enum
from SerializationFeature, DeserializationFeature, or MapperFeature.public void enableFeature(com.fasterxml.jackson.databind.SerializationFeature feature)
public void enableFeature(com.fasterxml.jackson.databind.DeserializationFeature feature)
public void enableFeature(com.fasterxml.jackson.databind.MapperFeature feature)
public void disableFeature(com.fasterxml.jackson.databind.SerializationFeature feature)
public void disableFeature(com.fasterxml.jackson.databind.DeserializationFeature feature)
public void disableFeature(com.fasterxml.jackson.databind.MapperFeature feature)
protected void doInit()
throws Exception
doInit in class org.apache.camel.support.service.BaseServiceExceptionApache Camel