Package org.codehaus.jackson.jaxrs
Class MapperConfigurator
- java.lang.Object
-
- org.codehaus.jackson.jaxrs.MapperConfigurator
-
public class MapperConfigurator extends java.lang.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(org.codehaus.jackson.jaxrs.Annotations[])
protected ObjectMapper
_defaultMapper
If no mapper was specified when constructed, and no configuration calls are made, a default mapper is constructed.protected java.lang.Class<? extends AnnotationIntrospector>
_jaxbIntrospectorClass
To support optional dependency to Jackson-XC module (needed if and when JAXB annotations are used for configuration)protected ObjectMapper
_mapper
Mapper provider was constructed with if any, or that was constructed due to a call to explicitly configure mapper.
-
Constructor Summary
Constructors Constructor Description MapperConfigurator(ObjectMapper mapper, Annotations[] defAnnotations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AnnotationIntrospector
_resolveIntrospector(Annotations ann)
protected AnnotationIntrospector
_resolveIntrospectors(Annotations[] annotationsToUse)
protected void
_setAnnotations(ObjectMapper mapper, Annotations[] annotationsToUse)
void
configure(JsonGenerator.Feature f, boolean state)
void
configure(JsonParser.Feature f, boolean state)
void
configure(DeserializationConfig.Feature f, boolean state)
void
configure(SerializationConfig.Feature f, boolean state)
ObjectMapper
getConfiguredMapper()
Method that locates, configures and returnsObjectMapper
to useObjectMapper
getDefaultMapper()
protected ObjectMapper
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(ObjectMapper m)
-
-
-
Field Detail
-
_mapper
protected 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 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(org.codehaus.jackson.jaxrs.Annotations[])
-
_jaxbIntrospectorClass
protected java.lang.Class<? extends AnnotationIntrospector> _jaxbIntrospectorClass
To support optional dependency to Jackson-XC module (needed if and when JAXB annotations are used for configuration)
-
-
Constructor Detail
-
MapperConfigurator
public MapperConfigurator(ObjectMapper mapper, Annotations[] defAnnotations)
-
-
Method Detail
-
getConfiguredMapper
public ObjectMapper getConfiguredMapper()
Method that locates, configures and returnsObjectMapper
to use
-
getDefaultMapper
public ObjectMapper getDefaultMapper()
-
setMapper
public void setMapper(ObjectMapper m)
-
setAnnotationsToUse
public void setAnnotationsToUse(Annotations[] annotationsToUse)
-
configure
public void configure(DeserializationConfig.Feature f, boolean state)
-
configure
public void configure(SerializationConfig.Feature f, boolean state)
-
configure
public void configure(JsonParser.Feature f, boolean state)
-
configure
public void configure(JsonGenerator.Feature f, boolean state)
-
mapper
protected ObjectMapper 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.
-
_setAnnotations
protected void _setAnnotations(ObjectMapper mapper, Annotations[] annotationsToUse)
-
_resolveIntrospectors
protected AnnotationIntrospector _resolveIntrospectors(Annotations[] annotationsToUse)
-
_resolveIntrospector
protected AnnotationIntrospector _resolveIntrospector(Annotations ann)
-
-