Class CustomDeserializerFactory


  • @Deprecated
    public class CustomDeserializerFactory
    extends BeanDeserializerFactory
    Deprecated.
    Starting with 1.7, functionality of this class has been implemented both in base SerializerFactory (see methods like SerializerFactory.withAdditionalSerializers(Serializers)) and through new Module API. As such, this class is not the best way to add custom functionality, and will likely be removed from 2.0 release
    Deserializer factory implementation that allows for configuring mapping between types and deserializers to use, by using multiple types of overrides. Existing mappings established by BeanDeserializerFactory (and its super class, BasicDeserializerFactory) are used if no overrides are defined.

    Unlike base deserializer factories, this factory is stateful because of configuration settings. It is thread-safe, however, as long as all configuration as done before using the factory -- a single instance can be shared between providers and mappers.

    Configurations currently available are:

    • Ability to define explicit mappings between simple non-generic classes/interfaces and deserializers to use for deserializing instance of these classes. Mappings are one-to-one (i.e. there is no "generic" variant for handling sub- or super-classes/interfaces).

    The way custom deserializer factory instances are hooked to ObjectMapper is usually by constructing an instance of DeserializerProvider (most commonly StdDeserializerProvider) with custom deserializer factory, and setting ObjectMapper to use it.

    • Field Detail

      • _directClassMappings

        protected HashMap<ClassKey,​JsonDeserializer<Object>> _directClassMappings
        Deprecated.
        Direct mappings that are used for exact class and interface type matches.
      • _mixInAnnotations

        protected HashMap<ClassKey,​Class<?>> _mixInAnnotations
        Deprecated.
        Mapping that defines how to apply mix-in annotations: key is the type to received additional annotations, and value is the type that has annotations to "mix in".

        Annotations associated with the value classes will be used to override annotations of the key class, associated with the same field or method. They can be further masked by sub-classes: you can think of it as injecting annotations between the target class and its sub-classes (or interfaces)

        Since:
        1.2
    • Constructor Detail

      • CustomDeserializerFactory

        public CustomDeserializerFactory()
        Deprecated.