if (property != null && property.isOpenContent() && dataObject.getType().isOpen()) {
dataObject.addOpenContentProperty(property);
}
// Update the data object
if (property.isMany()) {
ListWrapper listWrapper = (ListWrapper) dataObject.getList(property);
if (value instanceof List) {
// iterate list
for (Iterator i = ((List) value).iterator(); i.hasNext();) {
// add a setting to the end of the sequence
Object aValue = i.next();
Setting setting = convertToSetting(property, aValue);
valuesToSettings.put(new Key(property, aValue), setting);
settings.add(index++, setting);
// no need to check updateContainment flag -
// ListWrapper.add() will not pass an entire List here
listWrapper.add(aValue, false);
}
} else {
// set individual list item
// add a setting to the end of the sequence
Setting setting = convertToSetting(property, value);
valuesToSettings.put(new Key(property, value), setting);
settings.add(index, setting);
int listIdx = getIndexInList(property, value);
if (listIdx != -1) {
listWrapper.add(listIdx, value, false);
} else {
listWrapper.add(value, false);
}
}
} else {
dataObject.setPropertyInternal((SDOProperty) property, value, false);
// Update the settings