Class JacksonTypeConverters


  • @Converter(generateLoader=true)
    public final class JacksonTypeConverters
    extends Object
    Jackson TypeConverter that allows converting json to/from POJOs and other types.
    This implementation uses a fallback converter.

    The converter is disabled by default. To enable then set the property JacksonConstants.ENABLE_TYPE_CONVERTER to true on CamelContext.getGlobalOptions().
    The option JacksonConstants.TYPE_CONVERTER_TO_POJO can be used to allow converting to POJO types. By default the converter only attempts to convert to primitive types such as String and numbers. To convert to any kind, then enable this by setting JacksonConstants.TYPE_CONVERTER_TO_POJO to true on CamelContext.getGlobalOptions().

    • Constructor Detail

      • JacksonTypeConverters

        public JacksonTypeConverters()
    • Method Detail

      • convertTo

        @Converter(fallback=true)
        public <T> T convertTo​(Class<T> type,
                               org.apache.camel.Exchange exchange,
                               Object value,
                               org.apache.camel.spi.TypeConverterRegistry registry)
                        throws Exception
        Throws:
        Exception