public abstract class BasicDeserializerFactory extends DeserializerFactory
Collection
).
Since all simple deserializers are eagerly instantiated, and there is no additional introspection or customizability of these types, this factory is stateless.
DeserializerFactory.Config
限定符和类型 | 字段和说明 |
---|---|
protected static HashMap<JavaType,JsonDeserializer<Object>> |
_arrayDeserializers
And finally, we have special array deserializers for primitive
array types
|
protected OptionalHandlerFactory |
optionalHandlers
To support external/optional deserializers, we'll use this helper class
(as per [JACKSON-386])
|
NO_DESERIALIZERS
限定符 | 构造器和说明 |
---|---|
protected |
BasicDeserializerFactory() |
限定符和类型 | 方法和说明 |
---|---|
protected abstract JsonDeserializer<?> |
_findCustomArrayDeserializer(ArrayType type,
DeserializationConfig config,
DeserializerProvider p,
BeanProperty property,
TypeDeserializer elementTypeDeser,
JsonDeserializer<?> elementDeser) |
protected abstract JsonDeserializer<?> |
_findCustomCollectionDeserializer(CollectionType type,
DeserializationConfig config,
DeserializerProvider p,
BasicBeanDescription beanDesc,
BeanProperty property,
TypeDeserializer elementTypeDeser,
JsonDeserializer<?> elementDeser) |
protected abstract JsonDeserializer<?> |
_findCustomCollectionLikeDeserializer(CollectionLikeType type,
DeserializationConfig config,
DeserializerProvider p,
BasicBeanDescription beanDesc,
BeanProperty property,
TypeDeserializer elementTypeDeser,
JsonDeserializer<?> elementDeser) |
protected abstract JsonDeserializer<?> |
_findCustomEnumDeserializer(Class<?> type,
DeserializationConfig config,
BasicBeanDescription beanDesc,
BeanProperty property) |
protected abstract JsonDeserializer<?> |
_findCustomMapDeserializer(MapType type,
DeserializationConfig config,
DeserializerProvider p,
BasicBeanDescription beanDesc,
BeanProperty property,
KeyDeserializer keyDeser,
TypeDeserializer elementTypeDeser,
JsonDeserializer<?> elementDeser) |
protected abstract JsonDeserializer<?> |
_findCustomMapLikeDeserializer(MapLikeType type,
DeserializationConfig config,
DeserializerProvider p,
BasicBeanDescription beanDesc,
BeanProperty property,
KeyDeserializer keyDeser,
TypeDeserializer elementTypeDeser,
JsonDeserializer<?> elementDeser) |
protected abstract JsonDeserializer<?> |
_findCustomTreeNodeDeserializer(Class<? extends JsonNode> type,
DeserializationConfig config,
BeanProperty property) |
protected EnumResolver<?> |
constructEnumResolver(Class<?> enumClass,
DeserializationConfig config) |
JsonDeserializer<?> |
createArrayDeserializer(DeserializationConfig config,
DeserializerProvider p,
ArrayType type,
BeanProperty property)
Method called to create (or, for completely immutable deserializers,
reuse) a deserializer that can convert JSON content into values of
specified Java type.
|
JsonDeserializer<?> |
createCollectionDeserializer(DeserializationConfig config,
DeserializerProvider p,
CollectionType type,
BeanProperty property) |
JsonDeserializer<?> |
createCollectionLikeDeserializer(DeserializationConfig config,
DeserializerProvider p,
CollectionLikeType type,
BeanProperty property) |
JsonDeserializer<?> |
createEnumDeserializer(DeserializationConfig config,
DeserializerProvider p,
JavaType type,
BeanProperty property)
Factory method for constructing serializers of
Enum types. |
JsonDeserializer<?> |
createMapDeserializer(DeserializationConfig config,
DeserializerProvider p,
MapType type,
BeanProperty property) |
JsonDeserializer<?> |
createMapLikeDeserializer(DeserializationConfig config,
DeserializerProvider p,
MapLikeType type,
BeanProperty property) |
JsonDeserializer<?> |
createTreeDeserializer(DeserializationConfig config,
DeserializerProvider p,
JavaType nodeType,
BeanProperty property)
Method called to create and return a deserializer that can construct
JsonNode(s) from JSON content.
|
protected JsonDeserializer<Object> |
findDeserializerFromAnnotation(DeserializationConfig config,
Annotated ann,
BeanProperty property)
Helper method called to check if a class or method
has annotation that tells which class to use for deserialization.
|
TypeDeserializer |
findPropertyContentTypeDeserializer(DeserializationConfig config,
JavaType containerType,
AnnotatedMember propertyEntity,
BeanProperty property)
Method called to find and create a type information deserializer for values of
given container (list, array, map) property, if one is needed.
|
TypeDeserializer |
findPropertyTypeDeserializer(DeserializationConfig config,
JavaType baseType,
AnnotatedMember annotated,
BeanProperty property)
Method called to create a type information deserializer for values of
given non-container property, if one is needed.
|
protected JsonDeserializer<Object> |
findStdBeanDeserializer(DeserializationConfig config,
DeserializerProvider p,
JavaType type,
BeanProperty property)
Method called by
BeanDeserializerFactory to see if there might be a standard
deserializer registered for given type. |
TypeDeserializer |
findTypeDeserializer(DeserializationConfig config,
JavaType baseType,
BeanProperty property)
Method called to find and create a type information deserializer for given base type,
if one is needed.
|
abstract ValueInstantiator |
findValueInstantiator(DeserializationConfig config,
BasicBeanDescription beanDesc)
Method that is to find all creators (constructors, factory methods)
for the bean type to deserialize.
|
abstract JavaType |
mapAbstractType(DeserializationConfig config,
JavaType type)
Method that can be called to try to resolve an abstract type
(interface, abstract class) into a concrete type, or at least
something "more concrete" (abstract class instead of interface).
|
protected <T extends JavaType> |
modifyTypeByAnnotation(DeserializationConfig config,
Annotated a,
T type,
String propName)
Method called to see if given method has annotations that indicate
a more specific type than what the argument specifies.
|
protected JavaType |
resolveType(DeserializationConfig config,
BasicBeanDescription beanDesc,
JavaType type,
AnnotatedMember member,
BeanProperty property)
Helper method used to resolve method return types and field
types.
|
abstract DeserializerFactory |
withConfig(DeserializerFactory.Config config)
Method used for creating a new instance of this factory, but with different
configuration.
|
protected static final HashMap<JavaType,JsonDeserializer<Object>> _arrayDeserializers
protected OptionalHandlerFactory optionalHandlers
public abstract DeserializerFactory withConfig(DeserializerFactory.Config config)
DeserializerFactory
Note that custom sub-classes must override implementation
of this method, as it usually requires instantiating a new instance of
factory type. Check out javadocs for
BeanDeserializerFactory
for more details.
withConfig
在类中 DeserializerFactory
protected abstract JsonDeserializer<?> _findCustomArrayDeserializer(ArrayType type, DeserializationConfig config, DeserializerProvider p, BeanProperty property, TypeDeserializer elementTypeDeser, JsonDeserializer<?> elementDeser) throws JsonMappingException
protected abstract JsonDeserializer<?> _findCustomCollectionDeserializer(CollectionType type, DeserializationConfig config, DeserializerProvider p, BasicBeanDescription beanDesc, BeanProperty property, TypeDeserializer elementTypeDeser, JsonDeserializer<?> elementDeser) throws JsonMappingException
protected abstract JsonDeserializer<?> _findCustomCollectionLikeDeserializer(CollectionLikeType type, DeserializationConfig config, DeserializerProvider p, BasicBeanDescription beanDesc, BeanProperty property, TypeDeserializer elementTypeDeser, JsonDeserializer<?> elementDeser) throws JsonMappingException
protected abstract JsonDeserializer<?> _findCustomEnumDeserializer(Class<?> type, DeserializationConfig config, BasicBeanDescription beanDesc, BeanProperty property) throws JsonMappingException
protected abstract JsonDeserializer<?> _findCustomMapDeserializer(MapType type, DeserializationConfig config, DeserializerProvider p, BasicBeanDescription beanDesc, BeanProperty property, KeyDeserializer keyDeser, TypeDeserializer elementTypeDeser, JsonDeserializer<?> elementDeser) throws JsonMappingException
protected abstract JsonDeserializer<?> _findCustomMapLikeDeserializer(MapLikeType type, DeserializationConfig config, DeserializerProvider p, BasicBeanDescription beanDesc, BeanProperty property, KeyDeserializer keyDeser, TypeDeserializer elementTypeDeser, JsonDeserializer<?> elementDeser) throws JsonMappingException
protected abstract JsonDeserializer<?> _findCustomTreeNodeDeserializer(Class<? extends JsonNode> type, DeserializationConfig config, BeanProperty property) throws JsonMappingException
public abstract ValueInstantiator findValueInstantiator(DeserializationConfig config, BasicBeanDescription beanDesc) throws JsonMappingException
DeserializerFactory
findValueInstantiator
在类中 DeserializerFactory
JsonMappingException
public abstract JavaType mapAbstractType(DeserializationConfig config, JavaType type) throws JsonMappingException
DeserializerFactory
mapAbstractType
在类中 DeserializerFactory
JsonMappingException
public JsonDeserializer<?> createArrayDeserializer(DeserializationConfig config, DeserializerProvider p, ArrayType type, BeanProperty property) throws JsonMappingException
DeserializerFactory
createArrayDeserializer
在类中 DeserializerFactory
p
- Provider that can be called to create deserializers for
contained member typestype
- Type to be deserializedJsonMappingException
public JsonDeserializer<?> createCollectionDeserializer(DeserializationConfig config, DeserializerProvider p, CollectionType type, BeanProperty property) throws JsonMappingException
public JsonDeserializer<?> createCollectionLikeDeserializer(DeserializationConfig config, DeserializerProvider p, CollectionLikeType type, BeanProperty property) throws JsonMappingException
public JsonDeserializer<?> createMapDeserializer(DeserializationConfig config, DeserializerProvider p, MapType type, BeanProperty property) throws JsonMappingException
createMapDeserializer
在类中 DeserializerFactory
JsonMappingException
public JsonDeserializer<?> createMapLikeDeserializer(DeserializationConfig config, DeserializerProvider p, MapLikeType type, BeanProperty property) throws JsonMappingException
public JsonDeserializer<?> createEnumDeserializer(DeserializationConfig config, DeserializerProvider p, JavaType type, BeanProperty property) throws JsonMappingException
Enum
types.public JsonDeserializer<?> createTreeDeserializer(DeserializationConfig config, DeserializerProvider p, JavaType nodeType, BeanProperty property) throws JsonMappingException
DeserializerFactory
protected JsonDeserializer<Object> findStdBeanDeserializer(DeserializationConfig config, DeserializerProvider p, JavaType type, BeanProperty property) throws JsonMappingException
BeanDeserializerFactory
to see if there might be a standard
deserializer registered for given type.JsonMappingException
public TypeDeserializer findTypeDeserializer(DeserializationConfig config, JavaType baseType, BeanProperty property) throws JsonMappingException
DeserializerFactory
Note that this method is usually only directly called for values of container (Collection, array, Map) types and root values, but not for bean property values.
findTypeDeserializer
在类中 DeserializerFactory
baseType
- Declared base type of the value to deserializer (actual
deserializer type will be this type or its subtype)JsonMappingException
public TypeDeserializer findPropertyTypeDeserializer(DeserializationConfig config, JavaType baseType, AnnotatedMember annotated, BeanProperty property) throws JsonMappingException
Note that this method is only called for non-container bean properties, and not for values in container types or root values (or container properties)
baseType
- Declared base type of the value to deserializer (actual
deserializer type will be this type or its subtype)JsonMappingException
public TypeDeserializer findPropertyContentTypeDeserializer(DeserializationConfig config, JavaType containerType, AnnotatedMember propertyEntity, BeanProperty property) throws JsonMappingException
Note that this method is only called for container bean properties, and not for values in container types or root values (or non-container properties)
containerType
- Type of property; must be a container typepropertyEntity
- Field or method that contains container propertyJsonMappingException
protected JsonDeserializer<Object> findDeserializerFromAnnotation(DeserializationConfig config, Annotated ann, BeanProperty property) throws JsonMappingException
protected <T extends JavaType> T modifyTypeByAnnotation(DeserializationConfig config, Annotated a, T type, String propName) throws JsonMappingException
a
- Method or field that the type is associated withtype
- Type derived from the setter argumentpropName
- Name of property that refers to type, if any; null
if no property information available (when modify type declaration
of a class, for example)JsonMappingException
- if invalid annotation is foundprotected JavaType resolveType(DeserializationConfig config, BasicBeanDescription beanDesc, JavaType type, AnnotatedMember member, BeanProperty property) throws JsonMappingException
Starting with version 1.3, this method will also resolve instances of key and content deserializers if defined by annotations.
protected EnumResolver<?> constructEnumResolver(Class<?> enumClass, DeserializationConfig config)