Package tools.jackson.jakarta.rs.cfg
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
FieldsModifier and TypeFieldDescriptionprotected MAPPERIf no mapper was specified when constructed, and no configuration calls are made, a default mapper is constructed.DeserializationFeatures to explicitly enable or disableprotected tools.jackson.databind.AnnotationIntrospectorAnnotationIntrospectorto use as an override over defaultJacksonAnnotationIntrospector, if any.protected MAPPERMapper provider was constructed with if any, or that was constructed due to a call to explicitly configure mapper.DeserializationFeatures to explicitly enable or disableSerializationFeatures to explicitly enable or disable -
Constructor Summary
ConstructorsConstructorDescriptionMapperConfiguratorBase(MAPPER mapper, tools.jackson.databind.AnnotationIntrospector instropectorOverride) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 voidconfigure(tools.jackson.databind.DeserializationFeature f, boolean state) final voidconfigure(tools.jackson.databind.SerializationFeature f, boolean state) Method that locates, configures and returnsObjectMapperto useprotected MAPPERmapper()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 voidsetAnnotationIntrospector(tools.jackson.databind.AnnotationIntrospector aiOverride) final void
-
Field Details
-
_mapperFeatures
DeserializationFeatures to explicitly enable or disable -
_deserFeatures
DeserializationFeatures to explicitly enable or disable -
_serFeatures
SerializationFeatures to explicitly enable or disable -
_instropectorOverride
protected tools.jackson.databind.AnnotationIntrospector _instropectorOverrideAnnotationIntrospectorto use as an override over defaultJacksonAnnotationIntrospector, if any.- Since:
- 3.0
-
_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
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
-
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
Method that locates, configures and returnsObjectMapperto use -
setMapper
-
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.
-