Class JacksonDataFormat
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.component.jackson.AbstractJacksonDataFormat
-
- org.apache.camel.component.jackson.JacksonDataFormat
-
- 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.DataFormatContentTypeHeader,org.apache.camel.spi.DataFormatName,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
- Direct Known Subclasses:
ListJacksonDataFormat
@Dataformat("jackson") @Metadata(excludeProperties="library,permissions,dropRootNode") public class JacksonDataFormat extends AbstractJacksonDataFormatMarshal POJOs to JSON and back using Jackson
-
-
Constructor Summary
Constructors Constructor Description JacksonDataFormat()Use the default JacksonObjectMapperandObjectJacksonDataFormat(com.fasterxml.jackson.databind.ObjectMapper mapper, Class<?> unmarshalType)Use a custom Jackson mapper and and unmarshal typeJacksonDataFormat(com.fasterxml.jackson.databind.ObjectMapper mapper, Class<?> unmarshalType, Class<?> jsonView)Use a custom Jackson mapper, unmarshal type and JSON viewJacksonDataFormat(Class<?> unmarshalType)Use the default JacksonObjectMapperand with a custom unmarshal typeJacksonDataFormat(Class<?> unmarshalType, Class<?> jsonView)Use the default JacksonObjectMapperand with a custom unmarshal type and JSON view
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.fasterxml.jackson.databind.ObjectMappercreateNewObjectMapper()StringgetDataFormatName()protected StringgetDefaultContentType()protected Class<? extends com.fasterxml.jackson.databind.ObjectMapper>getObjectMapperClass()-
Methods inherited from class org.apache.camel.component.jackson.AbstractJacksonDataFormat
addModule, disableFeature, disableFeature, disableFeature, doInit, doStart, doStop, enableFeature, enableFeature, enableFeature, getCamelContext, getCollectionType, getCollectionTypeName, getDisableFeatures, getEnableFeatures, getInclude, getJsonView, getJsonViewTypeName, getModuleClassNames, getModuleRefs, getModules, getNamingStrategy, getObjectMapper, getSchemaResolver, getTimezone, getUnmarshalType, getUnmarshalTypeName, isAllowJmsType, isAllowUnmarshallType, isAutoDiscoverObjectMapper, isAutoDiscoverSchemaResolver, isContentTypeHeader, isEnableJacksonTypeConverter, isPrettyPrint, isUseDefaultObjectMapper, isUseList, marshal, setAllowJmsType, setAllowUnmarshallType, setAutoDiscoverObjectMapper, setAutoDiscoverSchemaResolver, setCamelContext, setCollectionType, setCollectionTypeName, setContentTypeHeader, setDisableFeatures, setEnableFeatures, setEnableJacksonTypeConverter, setInclude, setJsonView, setJsonViewTypeName, setModuleClassNames, setModuleRefs, setModules, setNamingStrategy, setObjectMapper, setPrettyPrint, setSchemaResolver, setTimezone, setUnmarshalType, setUnmarshalTypeName, setUseDefaultObjectMapper, setUseList, unmarshal, useList, useMap
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
JacksonDataFormat
public JacksonDataFormat()
Use the default JacksonObjectMapperandObject
-
JacksonDataFormat
public JacksonDataFormat(Class<?> unmarshalType)
Use the default JacksonObjectMapperand with a custom unmarshal type- Parameters:
unmarshalType- the custom unmarshal type
-
JacksonDataFormat
public JacksonDataFormat(Class<?> unmarshalType, Class<?> jsonView)
Use the default JacksonObjectMapperand with a custom unmarshal type and JSON view- Parameters:
unmarshalType- the custom unmarshal typejsonView- marker class to specify properties to be included during marshalling. See also
-
JacksonDataFormat
public JacksonDataFormat(com.fasterxml.jackson.databind.ObjectMapper mapper, Class<?> unmarshalType)Use a custom Jackson mapper and and unmarshal type- Parameters:
mapper- the custom mapperunmarshalType- the custom unmarshal type
-
JacksonDataFormat
public JacksonDataFormat(com.fasterxml.jackson.databind.ObjectMapper mapper, Class<?> unmarshalType, Class<?> jsonView)Use a custom Jackson mapper, unmarshal type and JSON view- Parameters:
mapper- the custom mapperunmarshalType- the custom unmarshal typejsonView- marker class to specify properties to be included during marshalling. See also
-
-
Method Detail
-
getDataFormatName
public String getDataFormatName()
- Specified by:
getDataFormatNamein interfaceorg.apache.camel.spi.DataFormatName- Specified by:
getDataFormatNamein classAbstractJacksonDataFormat
-
createNewObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper createNewObjectMapper()
- Specified by:
createNewObjectMapperin classAbstractJacksonDataFormat
-
getObjectMapperClass
protected Class<? extends com.fasterxml.jackson.databind.ObjectMapper> getObjectMapperClass()
- Specified by:
getObjectMapperClassin classAbstractJacksonDataFormat
-
getDefaultContentType
protected String getDefaultContentType()
- Specified by:
getDefaultContentTypein classAbstractJacksonDataFormat
-
-