{
JsonDeserializer<Object> subDeser;
// First: maybe we have already created sub-type deserializer?
synchronized (this) {
subDeser = (_subDeserializers == null) ? null : _subDeserializers.get(new ClassKey(bean.getClass()));
}
if (subDeser != null) {
return subDeser;
}
// If not, maybe we can locate one. First, need provider
DeserializerProvider deserProv = ctxt.getDeserializerProvider();
if (deserProv != null) {
JavaType type = ctxt.constructType(bean.getClass());
/* 09-Dec-2010, tatu: Would be nice to know which property pointed to this
* bean... but, alas, no such information is retained, so:
*/
subDeser = deserProv.findValueDeserializer(ctxt.getConfig(), type, _property);
// Also, need to cache it
if (subDeser != null) {
synchronized (this) {
if (_subDeserializers == null) {
_subDeserializers = new HashMap<ClassKey,JsonDeserializer<Object>>();;
}
_subDeserializers.put(new ClassKey(bean.getClass()), subDeser);
}
}
}
return subDeser;
}