Jackson Glossary: DeserializerFactory

Role

DeserializerFactory is a configurable component that is responsible for constructing a JsonDeserializer instances for various types. It does not cache resulting deserializers (this is what DeserializerProvider does!), but may have a static set of default deserializers it can return.

Usage

DeserializerFactory is used by ObjectMapper, but configured through DeserializerProvider. Usually it is done like:

   1   DeseriaizerProvider provider = new StdDeserializerProvider(new MyDeserializerFactory());
   2   objectMapper.setDeserializerProvider(provider); // or pass via constructor

However, starting with JacksonRelease17 it is usually better to add new deserializer providers (implementation of Deserializers instead of creating a separate factory (such as instance of CustomDeserializerFactory which was used prior to 1.7)

Default implementation(s)

org.codehaus.jackson.map.deser.BeanDeserializerFactory is the default implementation used; another commonly used (before 1.7) implementation is org.codehaus.jackson.map.ser.CustomDeserializerFactory which allows registration of custom deserializers.


Back to Jackson Term Glossary


CategoryJackson

DeserializerFactory (last edited 2010-12-22 00:52:01 by TatuSaloranta)

Copyright ©2009 FasterXML, LLC