Class Deserializers.Base

  • All Implemented Interfaces:
    Deserializers
    Direct Known Subclasses:
    Deserializers.None
    Enclosing interface:
    Deserializers

    public static class Deserializers.Base
    extends Object
    implements Deserializers
    Basic Deserializers implementation that implements all methods but provides no deserializers. Its main purpose is to serve as a base class so that sub-classes only need to override methods they need, as most of the time some of methods are not needed (especially enumeration and array deserializers are very rarely overridden).
    Since:
    1.9
    • Constructor Detail

      • Base

        public Base()
    • Method Detail

      • findArrayDeserializer

        public JsonDeserializer<?> findArrayDeserializer​(ArrayType type,
                                                         DeserializationConfig config,
                                                         DeserializerProvider provider,
                                                         BeanProperty property,
                                                         TypeDeserializer elementTypeDeserializer,
                                                         JsonDeserializer<?> elementDeserializer)
                                                  throws JsonMappingException
        Description copied from interface: Deserializers
        Method called to locate serializer for specified array type.

        Deserializer for element type may be passed, if configured explicitly at higher level (by annotations, typically), but usually are not. Type deserializer for element is passed if one is needed based on contextual information (annotations on declared element class; or on field or method type is associated with).

        Specified by:
        findArrayDeserializer in interface Deserializers
        Parameters:
        type - Type of array instances to deserialize
        config - Configuration in effect
        provider - Provider that can be used to locate deserializer for component type (if one not provided, or needs to be overridden)
        property - Property that contains array value (null for root values)
        elementTypeDeserializer - If element type needs polymorphic type handling, this is the type information deserializer to use; should usually be used as is when constructing array deserializer.
        elementDeserializer - Deserializer to use for elements, if explicitly defined (by using annotations, for exmple). May be null, in which case it should be resolved here (or using ResolvableDeserializer callback)
        Returns:
        Deserializer to use for the type; or null if this provider does not know how to construct it
        Throws:
        JsonMappingException
      • findCollectionDeserializer

        public JsonDeserializer<?> findCollectionDeserializer​(CollectionType type,
                                                              DeserializationConfig config,
                                                              DeserializerProvider provider,
                                                              BeanDescription beanDesc,
                                                              BeanProperty property,
                                                              TypeDeserializer elementTypeDeserializer,
                                                              JsonDeserializer<?> elementDeserializer)
                                                       throws JsonMappingException
        Description copied from interface: Deserializers
        Method called to locate serializer for specified Collection (List, Set etc) type.

        Deserializer for element type may be passed, if configured explicitly at higher level (by annotations, typically), but usually are not. Type deserializer for element is passed if one is needed based on contextual information (annotations on declared element class; or on field or method type is associated with).

        Specified by:
        findCollectionDeserializer in interface Deserializers
        Parameters:
        type - Type of collection instances to deserialize
        config - Configuration in effect
        provider - Provider that can be used to locate dependant deserializers if and as necessary (but note that in many cases resolution must be deferred by using ResolvableDeserializer callback)
        beanDesc - Definition of the enumeration type that contains class annotations and other information typically needed for building deserializers (note: always instance of BasicBeanDescription)
        property - Property that contains array value (null for root values)
        elementTypeDeserializer - If element type needs polymorphic type handling, this is the type information deserializer to use; should usually be used as is when constructing array deserializer.
        elementDeserializer - Deserializer to use for elements, if explicitly defined (by using annotations, for exmple). May be null, in which case it should be resolved here (or using ResolvableDeserializer callback)
        Returns:
        Deserializer to use for the type; or null if this provider does not know how to construct it
        Throws:
        JsonMappingException
      • findCollectionLikeDeserializer

        public JsonDeserializer<?> findCollectionLikeDeserializer​(CollectionLikeType type,
                                                                  DeserializationConfig config,
                                                                  DeserializerProvider provider,
                                                                  BeanDescription beanDesc,
                                                                  BeanProperty property,
                                                                  TypeDeserializer elementTypeDeserializer,
                                                                  JsonDeserializer<?> elementDeserializer)
                                                           throws JsonMappingException
        Description copied from interface: Deserializers
        Method called to locate serializer for specified "Collection-like" type (one that acts like Collection but does not implement it).

        Deserializer for element type may be passed, if configured explicitly at higher level (by annotations, typically), but usually are not. Type deserializer for element is passed if one is needed based on contextual information (annotations on declared element class; or on field or method type is associated with).

        Specified by:
        findCollectionLikeDeserializer in interface Deserializers
        Parameters:
        type - Type of instances to deserialize
        config - Configuration in effect
        provider - Provider that can be used to locate dependant deserializers if and as necessary (but note that in many cases resolution must be deferred by using ResolvableDeserializer callback)
        beanDesc - Definition of the enumeration type that contains class annotations and other information typically needed for building deserializers (note: always instance of BasicBeanDescription)
        property - Property that contains array value (null for root values)
        elementTypeDeserializer - If element type needs polymorphic type handling, this is the type information deserializer to use; should usually be used as is when constructing array deserializer.
        elementDeserializer - Deserializer to use for elements, if explicitly defined (by using annotations, for exmple). May be null, in which case it should be resolved here (or using ResolvableDeserializer callback)
        Returns:
        Deserializer to use for the type; or null if this provider does not know how to construct it
        Throws:
        JsonMappingException
      • findMapDeserializer

        public JsonDeserializer<?> findMapDeserializer​(MapType type,
                                                       DeserializationConfig config,
                                                       DeserializerProvider provider,
                                                       BeanDescription beanDesc,
                                                       BeanProperty property,
                                                       KeyDeserializer keyDeserializer,
                                                       TypeDeserializer elementTypeDeserializer,
                                                       JsonDeserializer<?> elementDeserializer)
                                                throws JsonMappingException
        Description copied from interface: Deserializers
        Method called to locate deserializer for specified Map type.

        Deserializer for element type may be passed, if configured explicitly at higher level (by annotations, typically), but usually are not. Type deserializer for element is passed if one is needed based on contextual information (annotations on declared element class; or on field or method type is associated with).

        Similarly, a KeyDeserializer may be passed, but this is only done if there is a specific configuration override (annotations) to indicate instance to use. Otherwise null is passed, and key deserializer needs to be obtained using DeserializerProvider

        Specified by:
        findMapDeserializer in interface Deserializers
        Parameters:
        type - Type of Map instances to deserialize
        config - Configuration in effect
        provider - Provider that can be used to locate dependant deserializers if and as necessary (but note that in many cases resolution must be deferred by using ResolvableDeserializer callback)
        beanDesc - Definition of the enumeration type that contains class annotations and other information typically needed for building deserializers (note: always instance of BasicBeanDescription)
        keyDeserializer - Key deserializer use, if it is defined via annotations or other configuration; null if default key deserializer for key type can be used.
        elementTypeDeserializer - If element type needs polymorphic type handling, this is the type information deserializer to use; should usually be used as is when constructing array deserializer.
        elementDeserializer - Deserializer to use for elements, if explicitly defined (by using annotations, for exmple). May be null, in which case it should be resolved here (or using ResolvableDeserializer callback)
        Returns:
        Deserializer to use for the type; or null if this provider does not know how to construct it
        Throws:
        JsonMappingException
      • findMapLikeDeserializer

        public JsonDeserializer<?> findMapLikeDeserializer​(MapLikeType type,
                                                           DeserializationConfig config,
                                                           DeserializerProvider provider,
                                                           BeanDescription beanDesc,
                                                           BeanProperty property,
                                                           KeyDeserializer keyDeserializer,
                                                           TypeDeserializer elementTypeDeserializer,
                                                           JsonDeserializer<?> elementDeserializer)
                                                    throws JsonMappingException
        Description copied from interface: Deserializers
        Method called to locate serializer for specified "Map-like" type (one that acts like Map but does not implement it).

        Deserializer for element type may be passed, if configured explicitly at higher level (by annotations, typically), but usually are not. Type deserializer for element is passed if one is needed based on contextual information (annotations on declared element class; or on field or method type is associated with).

        Similarly, a KeyDeserializer may be passed, but this is only done if there is a specific configuration override (annotations) to indicate instance to use. Otherwise null is passed, and key deserializer needs to be obtained using DeserializerProvider

        Specified by:
        findMapLikeDeserializer in interface Deserializers
        Parameters:
        type - Type of Map instances to deserialize
        config - Configuration in effect
        provider - Provider that can be used to locate dependant deserializers if and as necessary (but note that in many cases resolution must be deferred by using ResolvableDeserializer callback)
        beanDesc - Definition of the enumeration type that contains class annotations and other information typically needed for building deserializers (note: always instance of BasicBeanDescription)
        keyDeserializer - Key deserializer use, if it is defined via annotations or other configuration; null if default key deserializer for key type can be used.
        elementTypeDeserializer - If element type needs polymorphic type handling, this is the type information deserializer to use; should usually be used as is when constructing array deserializer.
        elementDeserializer - Deserializer to use for elements, if explicitly defined (by using annotations, for exmple). May be null, in which case it should be resolved here (or using ResolvableDeserializer callback)
        Returns:
        Deserializer to use for the type; or null if this provider does not know how to construct it
        Throws:
        JsonMappingException