Class JacksonConfigurationBundle

  • All Implemented Interfaces:
    io.dropwizard.ConfiguredBundle<io.dropwizard.Configuration>

    public class JacksonConfigurationBundle
    extends java.lang.Object
    implements io.dropwizard.ConfiguredBundle<io.dropwizard.Configuration>
    Configures the ObjectMapper to support HAL structures using Resource, Link and EmbeddedResource and field filtering on client request for resources annotated by EnableFieldFilter.

    The module registers itself when created in the run method of the application:

    
     public void run(SolutionServiceConfiguration configuration, Environment environment) {
       // ...
       JacksonConfigurationBundle.builder(environment).build();
       // ...
     }
    
     

    If Jacksons yaml provider is available in the classpath it will be registered as well so that the application is able to respond to "Accept application/yaml" requests. The JacksonYAMLProvider is available with com.fasterxml.jackson.jaxrs:jackson-jaxrs-yaml-provider:[jacksonVersion]. The class will be loaded dynamically to avoid a forced runtime dependency.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static JacksonConfigurationBundle.Builder builder()  
      void initialize​(io.dropwizard.setup.Bootstrap<?> bootstrap)
      Initializes the ObjectMapper as in the default Bootstrap but does not add the FuzzyEnumModule as it breaks enum features of Jackson.
      void run​(io.dropwizard.Configuration configuration, io.dropwizard.setup.Environment environment)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • initialize

        public void initialize​(io.dropwizard.setup.Bootstrap<?> bootstrap)
        Initializes the ObjectMapper as in the default Bootstrap but does not add the FuzzyEnumModule as it breaks enum features of Jackson.

        Specified by:
        initialize in interface io.dropwizard.ConfiguredBundle<io.dropwizard.Configuration>
      • run

        public void run​(io.dropwizard.Configuration configuration,
                        io.dropwizard.setup.Environment environment)
        Specified by:
        run in interface io.dropwizard.ConfiguredBundle<io.dropwizard.Configuration>