protected ValueInstantiator _constructDefaultValueInstantiator(DeserializationContext ctxt,
BeanDescription beanDesc)
throws JsonMappingException
{
boolean fixAccess = ctxt.canOverrideAccessModifiers();
CreatorCollector creators = new CreatorCollector(beanDesc, fixAccess);
AnnotationIntrospector intr = ctxt.getAnnotationIntrospector();
// First, let's figure out constructor/factory-based instantiation
// 23-Jan-2010, tatus: but only for concrete types
if (beanDesc.getType().isConcrete()) {
AnnotatedConstructor defaultCtor = beanDesc.findDefaultConstructor();
if (defaultCtor != null) {
if (fixAccess) {
ClassUtil.checkAndFixAccess(defaultCtor.getAnnotated());
}
creators.setDefaultConstructor(defaultCtor);
}
}
// need to construct suitable visibility checker:
final DeserializationConfig config = ctxt.getConfig();
VisibilityChecker<?> vchecker = config.getDefaultVisibilityChecker();
vchecker = config.getAnnotationIntrospector().findAutoDetectVisibility(beanDesc.getClassInfo(), vchecker);
/* Important: first add factory methods; then constructors, so
* latter can override former!
*/
_addDeserializerFactoryMethods(ctxt, beanDesc, vchecker, intr, creators);
_addDeserializerConstructors(ctxt, beanDesc, vchecker, intr, creators);
return creators.constructValueInstantiator(config);
}