Class MapperConfiguratorBase<IMPL extends MapperConfiguratorBase<IMPL,MAPPER>,MAPPER extends com.fasterxml.jackson.databind.ObjectMapper>
java.lang.Object
org.glassfish.jersey.jackson.internal.jackson.jaxrs.cfg.MapperConfiguratorBase<IMPL,MAPPER>
- Direct Known Subclasses:
JsonMapperConfigurator
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 an
ObjectMapper
instance to be used for data binding, as
well as accessing it.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Annotations[]
Annotations set to use by default; overridden by explicit call tosetAnnotationsToUse(org.glassfish.jersey.jackson.internal.jackson.jaxrs.cfg.Annotations[])
.protected MAPPER
If no mapper was specified when constructed, and no configuration calls are made, a default mapper is constructed.protected Class<? extends com.fasterxml.jackson.databind.AnnotationIntrospector>
To support optional dependency to Jackson JAXB annotations module (needed iff JAXB annotations are used for configuration)protected MAPPER
Mapper provider was constructed with if any, or that was constructed due to a call to explicitly configure mapper. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract com.fasterxml.jackson.databind.AnnotationIntrospector
_resolveIntrospectors
(Annotations[] annotationsToUse) protected final void
_setAnnotations
(com.fasterxml.jackson.databind.ObjectMapper mapper, Annotations[] annotationsToUse) final void
configure
(com.fasterxml.jackson.core.JsonGenerator.Feature f, boolean state) final void
configure
(com.fasterxml.jackson.core.JsonParser.Feature f, boolean state) final void
configure
(com.fasterxml.jackson.databind.DeserializationFeature f, boolean state) final void
configure
(com.fasterxml.jackson.databind.SerializationFeature f, boolean state) abstract MAPPER
Method that locates, configures and returnsObjectMapper
to useabstract 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.final void
setAnnotationsToUse
(Annotations[] annotationsToUse) final void
-
Field Details
-
_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. -
_defaultAnnotationsToUse
Annotations set to use by default; overridden by explicit call tosetAnnotationsToUse(org.glassfish.jersey.jackson.internal.jackson.jaxrs.cfg.Annotations[])
. Marked final in v2.17.1. -
_jaxbIntrospectorClass
protected Class<? extends com.fasterxml.jackson.databind.AnnotationIntrospector> _jaxbIntrospectorClassTo support optional dependency to Jackson JAXB annotations module (needed iff JAXB annotations are used for configuration)
-
-
Constructor Details
-
MapperConfiguratorBase
-
-
Method Details
-
getConfiguredMapper
Method that locates, configures and returnsObjectMapper
to use -
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. -
_resolveIntrospectors
protected abstract com.fasterxml.jackson.databind.AnnotationIntrospector _resolveIntrospectors(Annotations[] annotationsToUse) -
setMapper
-
setAnnotationsToUse
-
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)
-