private void updateBeanFields(Session session, Object object, ClassDescriptor classDescriptor, Node objectNode) {
String jcrName = null;
Iterator beanDescriptorIterator = classDescriptor.getBeanDescriptors().iterator();
while (beanDescriptorIterator.hasNext())
{
BeanDescriptor beanDescriptor = (BeanDescriptor) beanDescriptorIterator.next();
if (!beanDescriptor.isAutoUpdate()) {
continue;
}
jcrName = beanDescriptor.getJcrName();
Object bean = ReflectionUtils.getNestedProperty(object, beanDescriptor.getFieldName());
String converterClassName = null;
if (null == beanDescriptor.getConverter() || "".equals(beanDescriptor.getConverter()))
{
converterClassName = DEFAULT_BEAN_CONVERTER;
}
else
{
converterClassName = beanDescriptor.getConverter();
}
Object[] param = {this.mapper, this, this.atomicTypeConverterProvider };
BeanConverter beanConverter = (BeanConverter) ReflectionUtils.invokeConstructor(converterClassName, param);
Class beanClass = ReflectionUtils.getPropertyType(object, beanDescriptor.getFieldName());
// if the bean is null, remove existing node
if ((bean == null))
{
beanConverter.remove(session, objectNode, beanDescriptor, mapper.getClassDescriptorByClass(beanClass), bean, classDescriptor, object);