if (classDescriptor.usesNodeTypePerHierarchyStrategy() && classDescriptor.hasDiscriminator())
{
if (!node.hasProperty(ManagerConstant.DISCRIMINATOR_PROPERTY_NAME))
{
throw new ObjectContentManagerException("Class '"
+ classDescriptor.getClassName()
+ "' has not a discriminator property.");
}
}
while (fieldDescriptorIterator.hasNext()) {
FieldDescriptor fieldDescriptor = (FieldDescriptor) fieldDescriptorIterator.next();
String fieldName = fieldDescriptor.getFieldName();
String propertyName = fieldDescriptor.getJcrName();
if (fieldDescriptor.isPath()) {
// HINT: lazy initialize target bean - The bean can be null
// when it is inline
if (null == initializedBean) {
initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());
}
ReflectionUtils.setNestedProperty(initializedBean, fieldName, node.getPath());
} else {
if (fieldDescriptor.isUuid()) {
if (null == initializedBean) {
initializedBean = ReflectionUtils.newInstance(classDescriptor.getClassName());
}
ReflectionUtils.setNestedProperty(initializedBean, fieldName, node.getUUID());
} else {
initializedBean = retrieveSimpleField(classDescriptor, node, initializedBean, fieldDescriptor, fieldName, propertyName);
}
}
}
} catch (ValueFormatException vfe) {
throw new ObjectContentManagerException(
"Cannot retrieve properties of object " + object + " from node " + node, vfe);
} catch (RepositoryException re) {
throw new org.apache.jackrabbit.ocm.exception.RepositoryException( "Cannot retrieve properties of object " + object
+ " from node " + node, re);
}