PropertyIterator pi = parentNode.getProperties(jcrName);
if (!pi.hasNext()) {
return null;
}
ManageableCollection collection = ManageableCollectionUtil.getManageableCollection(collectionFieldClass);
AtomicTypeConverter atomicTypeConverter = getAtomicTypeConverter(collectionDescriptor);
while (pi.hasNext()) {
Property prop = pi.nextProperty();
// ignore protected properties here
if (prop.getDefinition().isProtected()) {
continue;
}
// handle multvalues as a list
Object value;
if (prop.getDefinition().isMultiple()) {
List valueList = new ArrayList();
Value[] values = prop.getValues();
for (int i = 0; i < values.length; i++) {
valueList.add(atomicTypeConverter.getObject(values[i]));
}
value = valueList;
} else {
value = atomicTypeConverter.getObject(prop.getValue());
}
if (collection instanceof Map) {
String name = prop.getName();
((Map) collection).put(name, value);
} else {
collection.addObject(value);
}
}
return collection;
} catch (ValueFormatException vfe) {