Jackson Glossary: SerializerFactory

Role

Serializer Factory is a configurable component that is responsible for constructing a JsonSerializer for various types. It does not cache resulting serializers (this is what SerializerProvider does!), but may have a static set of default serializer it can return.

Usage

Serializer factory is used via ObjectMapper, and factory in use can be changed with:

   1   objectMapper.setSerializerFactory(new MySerializerFactory());

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

Default implementation(s)

org.codehaus.jackson.map.ser.BeanSerializerFactory is the default implementation used; another commonly used (before 1.7) implementation is org.codehaus.jackson.map.ser.CustomSerializerFactory which allows registration of custom serializers.


Back to Jackson Term Glossary


CategoryJackson

SerializerFactory (last edited 2010-12-08 20:36:06 by TatuSaloranta)

Copyright ©2009 FasterXML, LLC