org.codehaus.jackson.map
Class DeserializerProvider

java.lang.Object
  extended by org.codehaus.jackson.map.DeserializerProvider
Direct Known Subclasses:
StdDeserializerProvider

public abstract class DeserializerProvider
extends java.lang.Object

Abstract class that defines API used by ObjectMapper and JsonDeserializers to obtain deserializers capable of re-constructing instances of handled type from Json content.


Constructor Summary
protected DeserializerProvider()
           
 
Method Summary
abstract  KeyDeserializer findKeyDeserializer(DeserializationConfig config, JavaType type)
          Method called to get hold of a deserializer to use for deserializing keys for Map.
abstract  JsonDeserializer<java.lang.Object> findValueDeserializer(DeserializationConfig config, JavaType type, JavaType referrer, java.lang.String refPropName)
          Method called to get hold of a deserializer for a value of given type; or if no such deserializer can be found, a default handler (which may do a best-effort generic serialization or just simply throw an exception when invoked).
abstract  boolean hasValueDeserializerFor(DeserializationConfig config, JavaType type)
          Method called to find out whether provider would be able to find a deserializer for given type, using a root reference (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeserializerProvider

protected DeserializerProvider()
Method Detail

findValueDeserializer

public abstract JsonDeserializer<java.lang.Object> findValueDeserializer(DeserializationConfig config,
                                                                         JavaType type,
                                                                         JavaType referrer,
                                                                         java.lang.String refPropName)
                                                                  throws JsonMappingException
Method called to get hold of a deserializer for a value of given type; or if no such deserializer can be found, a default handler (which may do a best-effort generic serialization or just simply throw an exception when invoked).

Note: this method is only called for value types; not for keys. Key deserializers can be accessed using findKeyDeserializer(org.codehaus.jackson.map.DeserializationConfig, org.codehaus.jackson.type.JavaType).

Parameters:
type - Declared type of the value to deserializer (obtained using 'setter' method signature and/or type annotations
referrer - Type that contains the value, if any: null for root-level object.
refPropName - Logical name of the property within instance of referrer, if through a property (field). Null for Collection and Array types, where reference is not through a field, as well as for "any property" fallback references
Throws:
JsonMappingException - if there are fatal problems with accessing suitable deserializer; including that of not finding any serializer

findKeyDeserializer

public abstract KeyDeserializer findKeyDeserializer(DeserializationConfig config,
                                                    JavaType type)
                                             throws JsonMappingException
Method called to get hold of a deserializer to use for deserializing keys for Map.

Throws:
JsonMappingException - if there are fatal problems with accessing suitable key deserializer; including that of not finding any serializer

hasValueDeserializerFor

public abstract boolean hasValueDeserializerFor(DeserializationConfig config,
                                                JavaType type)
Method called to find out whether provider would be able to find a deserializer for given type, using a root reference (i.e. not through fields or membership in an array or collection)