Class MapperConfiguratorBase<IMPL extends MapperConfiguratorBase<IMPL,MAPPER>,MAPPER extends tools.jackson.databind.ObjectMapper>

java.lang.Object
tools.jackson.jakarta.rs.cfg.MapperConfiguratorBase<IMPL,MAPPER>

public abstract class MapperConfiguratorBase<IMPL extends MapperConfiguratorBase<IMPL,MAPPER>,MAPPER extends tools.jackson.databind.ObjectMapper> extends Object
Helper class used to encapsulate details of configuring an ObjectMapper instance to be used for data binding, as well as accessing it.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected MAPPER
    If no mapper was specified when constructed, and no configuration calls are made, a default mapper is constructed.
    protected EnumMap<tools.jackson.databind.DeserializationFeature,Boolean>
    DeserializationFeatures to explicitly enable or disable
    protected tools.jackson.databind.AnnotationIntrospector
    AnnotationIntrospector to use as an override over default JacksonAnnotationIntrospector, if any.
    protected MAPPER
    Mapper provider was constructed with if any, or that was constructed due to a call to explicitly configure mapper.
    protected EnumMap<tools.jackson.databind.MapperFeature,Boolean>
    DeserializationFeatures to explicitly enable or disable
    protected EnumMap<tools.jackson.databind.SerializationFeature,Boolean>
    SerializationFeatures to explicitly enable or disable
  • Constructor Summary

    Constructors
    Constructor
    Description
    MapperConfiguratorBase(MAPPER mapper, tools.jackson.databind.AnnotationIntrospector instropectorOverride)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected tools.jackson.databind.cfg.MapperBuilder<?,?>
    _builderWithConfiguration(tools.jackson.databind.cfg.MapperBuilder<?,?> mapperBuilder)
    Overridable helper method that applies all configuration on given builder.
    protected MAPPER
    _mapperWithConfiguration(tools.jackson.databind.cfg.MapperBuilder<?,?> mapperBuilder)
    Helper method that will configure given builder using configured overrides.
    final void
    configure(tools.jackson.databind.DeserializationFeature f, boolean state)
     
    final void
    configure(tools.jackson.databind.SerializationFeature f, boolean state)
     
    Method that locates, configures and returns ObjectMapper to use
     
    protected MAPPER
    Helper method that will ensure that there is a configurable non-default mapper (constructing an instance if one didn't yet exit), and return that mapper.
    protected abstract tools.jackson.databind.cfg.MapperBuilder<?,?>
     
    final void
    setAnnotationIntrospector(tools.jackson.databind.AnnotationIntrospector aiOverride)
     
    final void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • _mapperFeatures

      protected EnumMap<tools.jackson.databind.MapperFeature,Boolean> _mapperFeatures
      DeserializationFeatures to explicitly enable or disable
    • _deserFeatures

      protected EnumMap<tools.jackson.databind.DeserializationFeature,Boolean> _deserFeatures
      DeserializationFeatures to explicitly enable or disable
    • _serFeatures

      protected EnumMap<tools.jackson.databind.SerializationFeature,Boolean> _serFeatures
      SerializationFeatures to explicitly enable or disable
    • _instropectorOverride

      protected tools.jackson.databind.AnnotationIntrospector _instropectorOverride
      AnnotationIntrospector to use as an override over default JacksonAnnotationIntrospector, if any.
      Since:
      3.0
    • _mapper

      protected MAPPER extends tools.jackson.databind.ObjectMapper _mapper
      Mapper provider was constructed with if any, or that was constructed due to a call to explicitly configure mapper. If defined (explicitly or implicitly) it will be used, instead of using provider-based lookup.
    • _defaultMapper

      protected MAPPER extends tools.jackson.databind.ObjectMapper _defaultMapper
      If no mapper was specified when constructed, and no configuration calls are made, a default mapper is constructed. The difference between default mapper and regular one is that default mapper is only used if no mapper is found via provider lookup.
  • Constructor Details

    • MapperConfiguratorBase

      public MapperConfiguratorBase(MAPPER mapper, tools.jackson.databind.AnnotationIntrospector instropectorOverride)
  • Method Details

    • getDefaultMapper

      public MAPPER getDefaultMapper()
    • mapper

      protected MAPPER mapper()
      Helper method that will ensure that there is a configurable non-default mapper (constructing an instance if one didn't yet exit), and return that mapper.
    • mapperBuilder

      protected abstract tools.jackson.databind.cfg.MapperBuilder<?,?> mapperBuilder()
      Since:
      3.0
    • getConfiguredMapper

      public MAPPER getConfiguredMapper()
      Method that locates, configures and returns ObjectMapper to use
    • setMapper

      public final void setMapper(MAPPER m)
    • setAnnotationIntrospector

      public final void setAnnotationIntrospector(tools.jackson.databind.AnnotationIntrospector aiOverride)
    • configure

      public final void configure(tools.jackson.databind.DeserializationFeature f, boolean state)
    • configure

      public final void configure(tools.jackson.databind.SerializationFeature f, boolean state)
    • _mapperWithConfiguration

      protected MAPPER _mapperWithConfiguration(tools.jackson.databind.cfg.MapperBuilder<?,?> mapperBuilder)
      Helper method that will configure given builder using configured overrides.
    • _builderWithConfiguration

      protected tools.jackson.databind.cfg.MapperBuilder<?,?> _builderWithConfiguration(tools.jackson.databind.cfg.MapperBuilder<?,?> mapperBuilder)
      Overridable helper method that applies all configuration on given builder.