public class SimpleValueInstantiators extends ValueInstantiators.Base
ValueInstantiators.Base| 限定符和类型 | 字段和说明 |
|---|---|
protected HashMap<ClassKey,ValueInstantiator> |
_classMappings
Mappings from raw (type-erased, i.e. non-generic) types
to matching
ValueInstantiator instances. |
| 构造器和说明 |
|---|
SimpleValueInstantiators() |
| 限定符和类型 | 方法和说明 |
|---|---|
SimpleValueInstantiators |
addValueInstantiator(Class<?> forType,
ValueInstantiator inst) |
ValueInstantiator |
findValueInstantiator(DeserializationConfig config,
BeanDescription beanDesc,
ValueInstantiator defaultInstantiator)
Method called to find the
ValueInstantiator to use for creating
instances of specified type during deserialization. |
protected HashMap<ClassKey,ValueInstantiator> _classMappings
ValueInstantiator instances.public SimpleValueInstantiators addValueInstantiator(Class<?> forType, ValueInstantiator inst)
public ValueInstantiator findValueInstantiator(DeserializationConfig config, BeanDescription beanDesc, ValueInstantiator defaultInstantiator)
ValueInstantiatorsValueInstantiator to use for creating
instances of specified type during deserialization.
Note that a default value instantiator is always created first and passed;
if an implementation does not want to modify or replace it, it has to return
passed instance as is (returning null is an error)findValueInstantiator 在接口中 ValueInstantiatorsfindValueInstantiator 在类中 ValueInstantiators.Baseconfig - Deserialization configuration in usebeanDesc - Additional information about POJO type to be instantiated:
description will always be of type
BasicBeanDescription (that is,
safe to cast to this more specific type)defaultInstantiator - Instantiator that will be used if no changes are made;
passed to allow custom instances to use annotation-provided information
(note, however, that earlier ValueInstantiators may have changed it to
a custom instantiator already)defaultInstantiator that was passed,
or a custom variant; can not be null.