Class MapperConfiguratorBase<IMPL extends MapperConfiguratorBase<IMPL,MAPPER>,MAPPER extends com.fasterxml.jackson.databind.ObjectMapper>
- java.lang.Object
-
- com.fasterxml.jackson.jakarta.rs.cfg.MapperConfiguratorBase<IMPL,MAPPER>
-
- Direct Known Subclasses:
CBORMapperConfigurator
,JsonMapperConfigurator
,SmileMapperConfigurator
,XMLMapperConfigurator
,YAMLMapperConfigurator
public abstract class MapperConfiguratorBase<IMPL extends MapperConfiguratorBase<IMPL,MAPPER>,MAPPER extends com.fasterxml.jackson.databind.ObjectMapper> extends Object
Helper class used to encapsulate details of configuring anObjectMapper
instance to be used for data binding, as well as accessing it.
-
-
Field Summary
Fields Modifier and Type Field Description protected Annotations[]
_defaultAnnotationsToUse
Annotations set to use by default; overridden by explicit call tosetAnnotationsToUse(com.fasterxml.jackson.jakarta.rs.cfg.Annotations[])
protected MAPPER
_defaultMapper
If no mapper was specified when constructed, and no configuration calls are made, a default mapper is constructed.protected MAPPER
_mapper
Mapper provider was constructed with if any, or that was constructed due to a call to explicitly configure mapper.protected Class<? extends com.fasterxml.jackson.databind.AnnotationIntrospector>
_xmlBindIntrospectorClass
To support optional dependency to Jackson Jakarta XmlBind annotations module (needed iff Jakarta XmlBind annotations are used for configuration)
-
Constructor Summary
Constructors Constructor Description MapperConfiguratorBase(MAPPER mapper, Annotations[] defaultAnnotations)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract com.fasterxml.jackson.databind.AnnotationIntrospector
_resolveIntrospectors(Annotations[] annotationsToUse)
protected void
_setAnnotations(com.fasterxml.jackson.databind.ObjectMapper mapper, Annotations[] annotationsToUse)
void
configure(com.fasterxml.jackson.core.JsonGenerator.Feature f, boolean state)
void
configure(com.fasterxml.jackson.core.JsonParser.Feature f, boolean state)
void
configure(com.fasterxml.jackson.databind.DeserializationFeature f, boolean state)
void
configure(com.fasterxml.jackson.databind.SerializationFeature f, boolean state)
abstract MAPPER
getConfiguredMapper()
Method that locates, configures and returnsObjectMapper
to useabstract MAPPER
getDefaultMapper()
protected abstract 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.void
setAnnotationsToUse(Annotations[] annotationsToUse)
void
setMapper(MAPPER m)
-
-
-
Field Detail
-
_mapper
protected MAPPER extends com.fasterxml.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 com.fasterxml.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.
-
_defaultAnnotationsToUse
protected Annotations[] _defaultAnnotationsToUse
Annotations set to use by default; overridden by explicit call tosetAnnotationsToUse(com.fasterxml.jackson.jakarta.rs.cfg.Annotations[])
-
_xmlBindIntrospectorClass
protected Class<? extends com.fasterxml.jackson.databind.AnnotationIntrospector> _xmlBindIntrospectorClass
To support optional dependency to Jackson Jakarta XmlBind annotations module (needed iff Jakarta XmlBind annotations are used for configuration)
-
-
Constructor Detail
-
MapperConfiguratorBase
public MapperConfiguratorBase(MAPPER mapper, Annotations[] defaultAnnotations)
-
-
Method Detail
-
getConfiguredMapper
public abstract MAPPER getConfiguredMapper()
Method that locates, configures and returnsObjectMapper
to use
-
getDefaultMapper
public abstract MAPPER getDefaultMapper()
-
mapper
protected abstract 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.
-
_resolveIntrospectors
protected abstract com.fasterxml.jackson.databind.AnnotationIntrospector _resolveIntrospectors(Annotations[] annotationsToUse)
-
setMapper
public final void setMapper(MAPPER m)
-
setAnnotationsToUse
public final void setAnnotationsToUse(Annotations[] annotationsToUse)
-
configure
public final void configure(com.fasterxml.jackson.databind.DeserializationFeature f, boolean state)
-
configure
public final void configure(com.fasterxml.jackson.databind.SerializationFeature f, boolean state)
-
configure
public final void configure(com.fasterxml.jackson.core.JsonParser.Feature f, boolean state)
-
configure
public final void configure(com.fasterxml.jackson.core.JsonGenerator.Feature f, boolean state)
-
_setAnnotations
protected final void _setAnnotations(com.fasterxml.jackson.databind.ObjectMapper mapper, Annotations[] annotationsToUse)
-
-