Class JacksonAvroDataFormat

  • 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

    @Dataformat("avro-jackson")
    @Metadata(firstVersion="3.10.0",
              title="Avro Jackson",
              excludeProperties="library,instanceClassName,schema")
    public class JacksonAvroDataFormat
    extends org.apache.camel.component.jackson.AbstractJacksonDataFormat
    Marshal POJOs to Avro and back using Jackson.
    • 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

      Constructors 
      Constructor Description
      JacksonAvroDataFormat()
      Use the default Jackson AvroMapper and Object
      JacksonAvroDataFormat​(com.fasterxml.jackson.dataformat.avro.AvroMapper mapper, Class<?> unmarshalType)
      Use a custom Jackson AvroMapper and and unmarshal type
      JacksonAvroDataFormat​(com.fasterxml.jackson.dataformat.avro.AvroMapper mapper, Class<?> unmarshalType, Class<?> jsonView)
      Use a custom Jackson AvroMapper, unmarshal type and JSON view
      JacksonAvroDataFormat​(Class<?> unmarshalType)
      Use the default Jackson AvroMapper and with a custom unmarshal type
      JacksonAvroDataFormat​(Class<?> unmarshalType, Class<?> jsonView)
      Use the default Jackson AvroMapper and 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.dataformat.avro.AvroMapper createNewObjectMapper()  
      String getDataFormatName()  
      protected String getDefaultContentType()  
      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, 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, 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 interface org.apache.camel.Service

        build, close, init, start, stop
      • Methods inherited from interface org.apache.camel.ShutdownableService

        shutdown
      • Methods inherited from interface org.apache.camel.StatefulService

        getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
      • Methods inherited from interface org.apache.camel.SuspendableService

        isSuspended, resume, suspend
    • Constructor Detail

      • JacksonAvroDataFormat

        public JacksonAvroDataFormat()
        Use the default Jackson AvroMapper and Object
      • JacksonAvroDataFormat

        public JacksonAvroDataFormat​(Class<?> unmarshalType)
        Use the default Jackson AvroMapper and with a custom unmarshal type
        Parameters:
        unmarshalType - the custom unmarshal type
      • JacksonAvroDataFormat

        public JacksonAvroDataFormat​(Class<?> unmarshalType,
                                     Class<?> jsonView)
        Use the default Jackson AvroMapper and with a custom unmarshal type and JSON view
        Parameters:
        unmarshalType - the custom unmarshal type
        jsonView - marker class to specify properties to be included during marshalling. See also
      • JacksonAvroDataFormat

        public JacksonAvroDataFormat​(com.fasterxml.jackson.dataformat.avro.AvroMapper mapper,
                                     Class<?> unmarshalType)
        Use a custom Jackson AvroMapper and and unmarshal type
        Parameters:
        mapper - the custom mapper
        unmarshalType - the custom unmarshal type
      • JacksonAvroDataFormat

        public JacksonAvroDataFormat​(com.fasterxml.jackson.dataformat.avro.AvroMapper mapper,
                                     Class<?> unmarshalType,
                                     Class<?> jsonView)
        Use a custom Jackson AvroMapper, unmarshal type and JSON view
        Parameters:
        mapper - the custom mapper
        unmarshalType - the custom unmarshal type
        jsonView - marker class to specify properties to be included during marshalling. See also
    • Method Detail

      • getDataFormatName

        public String getDataFormatName()
        Specified by:
        getDataFormatName in interface org.apache.camel.spi.DataFormatName
        Specified by:
        getDataFormatName in class org.apache.camel.component.jackson.AbstractJacksonDataFormat
      • getDefaultContentType

        protected String getDefaultContentType()
        Specified by:
        getDefaultContentType in class org.apache.camel.component.jackson.AbstractJacksonDataFormat
      • createNewObjectMapper

        protected com.fasterxml.jackson.dataformat.avro.AvroMapper createNewObjectMapper()
        Specified by:
        createNewObjectMapper in class org.apache.camel.component.jackson.AbstractJacksonDataFormat
      • getObjectMapperClass

        protected Class<? extends com.fasterxml.jackson.databind.ObjectMapper> getObjectMapperClass()
        Specified by:
        getObjectMapperClass in class org.apache.camel.component.jackson.AbstractJacksonDataFormat