{
converterClassName = beanDescriptor.getConverter();
}
Object[] param = {this.mapper, this, this.atomicTypeConverterProvider};
BeanConverter beanConverter = (BeanConverter) ReflectionUtils.invokeConstructor(converterClassName, param);
if (beanDescriptor.isProxy())
{
if (beanDescriptor.getJcrType() != null && !"".equals(beanDescriptor.getJcrType())) {
// If a mapped jcrType has been set, use it as proxy parent class instead of the bean property type.
// This way, we can handle proxies when bean property type is an interface.
try {
String className = mapper.getClassDescriptorByNodeType(beanDescriptor.getJcrType()).getClassName();
if (log.isDebugEnabled()) {
log.debug("a mapped jcrType has been specified, switching from <" + beanClass + "> to <" + ReflectionUtils.forName(className));
}
beanClass = ReflectionUtils.forName(className);
} catch (IncorrectPersistentClassException e) {
if (log.isDebugEnabled()) {
log.debug(beanDescriptor.getClassDescriptor().getJcrType() + " is not mapped");
}
}
}
bean = proxyManager.createBeanProxy(beanConverter, beanConverter.getPath(session, beanDescriptor, node), session, node, beanDescriptor, mapper.getClassDescriptorByClass(beanClass), beanClass, bean);
}
else
{
bean = beanConverter.getObject(session, node, beanDescriptor, mapper.getClassDescriptorByClass(beanClass), beanClass, bean);
}
requestObjectCache.cache(beanPath, bean);
ReflectionUtils.setNestedProperty(object, beanName, bean);
}
}