Package org.apache.camel.component.cbor
Class CBORDataFormat
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.component.cbor.CBORDataFormat
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.CamelContextAware,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.DataFormat,org.apache.camel.spi.DataFormatName,org.apache.camel.spi.HasCamelContext,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
@Dataformat("cbor")
public class CBORDataFormat
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.spi.DataFormat, org.apache.camel.spi.DataFormatName, org.apache.camel.CamelContextAware
-
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING -
Constructor Summary
ConstructorsConstructorDescriptionUse the default CBOR JacksonObjectMapperandObjectCBORDataFormat(com.fasterxml.jackson.databind.ObjectMapper objectMapper, Class<?> unmarshalType) Use the default CBOR JacksonObjectMapperand with a custom unmarshal type -
Method Summary
Modifier and TypeMethodDescriptionvoiddisableFeature(com.fasterxml.jackson.databind.DeserializationFeature feature) voiddisableFeature(com.fasterxml.jackson.databind.MapperFeature feature) voiddisableFeature(com.fasterxml.jackson.databind.SerializationFeature feature) protected voiddoInit()protected voiddoStop()voidenableFeature(com.fasterxml.jackson.databind.DeserializationFeature feature) voidenableFeature(com.fasterxml.jackson.databind.MapperFeature feature) voidenableFeature(com.fasterxml.jackson.databind.SerializationFeature feature) org.apache.camel.CamelContextClass<? extends Collection> com.fasterxml.jackson.databind.ObjectMapperClass<?> booleanbooleanbooleanbooleanbooleanbooleanvoidmarshal(org.apache.camel.Exchange exchange, Object graph, OutputStream stream) voidsetAllowJmsType(boolean allowJmsType) Allows jackson to use the JMSType header as an indicator what the classname is for unmarshaling json content to POJOvoidsetAllowUnmarshallType(boolean allowUnmarshallType) voidsetCamelContext(org.apache.camel.CamelContext camelContext) voidsetCollectionType(Class<? extends Collection> collectionType) voidsetCollectionTypeName(String collectionTypeName) voidsetDisableFeatures(String disableFeatures) Set of features to disable on the JacksonObjectMapper.voidsetEnableFeatures(String enableFeatures) Set of features to enable on the JacksonObjectMapper.voidsetEnableJacksonTypeConverter(boolean enableJacksonTypeConverter) If enabled then Jackson is allowed to attempt to be used during Camels type converter as athat attempts to convert POJOs to/frominvalid reference
org.apache.camel.FallbackConverterMap/Listtypes.voidsetObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) voidsetPrettyPrint(boolean prettyPrint) voidsetUnmarshalType(Class<?> unmarshalType) voidsetUnmarshalTypeName(String unmarshalTypeName) voidsetUseDefaultObjectMapper(boolean useDefaultObjectMapper) voidsetUseList(boolean useList) unmarshal(org.apache.camel.Exchange exchange, InputStream stream) voiduseList()UsesArrayListwhen unmarshalling.voiduseMap()UsesHashMapwhen unmarshalling.Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doStart, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
CBORDataFormat
public CBORDataFormat()Use the default CBOR JacksonObjectMapperandObject -
CBORDataFormat
public CBORDataFormat(com.fasterxml.jackson.databind.ObjectMapper objectMapper, Class<?> unmarshalType) Use the default CBOR JacksonObjectMapperand with a custom unmarshal type- Parameters:
unmarshalType- the custom unmarshal type
-
-
Method Details
-
marshal
public void marshal(org.apache.camel.Exchange exchange, Object graph, OutputStream stream) throws Exception - Specified by:
marshalin interfaceorg.apache.camel.spi.DataFormat- Throws:
Exception
-
unmarshal
- Specified by:
unmarshalin interfaceorg.apache.camel.spi.DataFormat- Throws:
Exception
-
unmarshal
- Specified by:
unmarshalin interfaceorg.apache.camel.spi.DataFormat- Throws:
Exception
-
getDataFormatName
- Specified by:
getDataFormatNamein interfaceorg.apache.camel.spi.DataFormatName
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()- Specified by:
getCamelContextin interfaceorg.apache.camel.spi.HasCamelContext
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext) - Specified by:
setCamelContextin interfaceorg.apache.camel.CamelContextAware
-
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
setObjectMapper
public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
getUnmarshalTypeName
-
setUnmarshalTypeName
-
getUnmarshalType
-
setUnmarshalType
-
isAllowUnmarshallType
public boolean isAllowUnmarshallType() -
setAllowUnmarshallType
public void setAllowUnmarshallType(boolean allowUnmarshallType) -
getCollectionTypeName
-
setCollectionTypeName
-
getCollectionType
-
setCollectionType
-
isUseList
public boolean isUseList() -
setUseList
public void setUseList(boolean useList) -
isUseDefaultObjectMapper
public boolean isUseDefaultObjectMapper() -
setUseDefaultObjectMapper
public void setUseDefaultObjectMapper(boolean useDefaultObjectMapper) -
useList
public void useList()UsesArrayListwhen unmarshalling. -
useMap
public void useMap()UsesHashMapwhen unmarshalling. -
isPrettyPrint
public boolean isPrettyPrint() -
setPrettyPrint
public void setPrettyPrint(boolean prettyPrint) -
setAllowJmsType
public 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. -
isAllowJmsType
public boolean isAllowJmsType() -
getEnableFeatures
-
isEnableJacksonTypeConverter
public boolean isEnableJacksonTypeConverter() -
setEnableJacksonTypeConverter
public void setEnableJacksonTypeConverter(boolean enableJacksonTypeConverter) If enabled then Jackson is allowed to attempt to be used during Camels type converter as athat attempts to convert POJOs to/frominvalid reference
org.apache.camel.FallbackConverterMap/Listtypes. This should only be enabled when desired to be used. -
setEnableFeatures
Set of features to enable on the JacksonObjectMapper. The features should be a name that matches a enum fromSerializationFeature,DeserializationFeature, orMapperFeature. -
getDisableFeatures
-
setDisableFeatures
Set of features to disable on the JacksonObjectMapper. The features should be a name that matches a enum fromSerializationFeature,DeserializationFeature, orMapperFeature. -
enableFeature
public void enableFeature(com.fasterxml.jackson.databind.SerializationFeature feature) -
enableFeature
public void enableFeature(com.fasterxml.jackson.databind.DeserializationFeature feature) -
enableFeature
public void enableFeature(com.fasterxml.jackson.databind.MapperFeature feature) -
disableFeature
public void disableFeature(com.fasterxml.jackson.databind.SerializationFeature feature) -
disableFeature
public void disableFeature(com.fasterxml.jackson.databind.DeserializationFeature feature) -
disableFeature
public void disableFeature(com.fasterxml.jackson.databind.MapperFeature feature) -
doInit
- Overrides:
doInitin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doStop
- Overrides:
doStopin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-