Class GsonCodecAutoConfiguration

java.lang.Object
org.jwcarman.codec.autoconfigure.GsonCodecAutoConfiguration

@AutoConfiguration(after={JacksonCodecAutoConfiguration.class,Jackson2CodecAutoConfiguration.class}) @ConditionalOnClass({com.google.gson.Gson.class,GsonCodecFactory.class}) public class GsonCodecAutoConfiguration extends Object
Auto-configures a GsonCodecFactory when the Gson backend is on the classpath and no other CodecFactory bean exists. Yields to both Jackson backends.
  • Constructor Details

    • GsonCodecAutoConfiguration

      public GsonCodecAutoConfiguration()
      Creates the auto-configuration.
  • Method Details

    • gsonCodecFactory

      @Bean @ConditionalOnMissingBean(CodecFactory.class) public GsonCodecFactory gsonCodecFactory(org.springframework.beans.factory.ObjectProvider<com.google.gson.Gson> gson)
      Creates the factory, reusing the application's Gson bean when one exists.
      Parameters:
      gson - provider of the application's Gson instance, if any
      Returns:
      the codec factory