public void populateMetaValueFromProperty(PropertyList property, MetaValue metaValue, PropertyDefinitionList propertyDefinition)
{
PropertyDefinition listMemberPropDef = propertyDefinition.getMemberDefinition();
List<Property> listMemberProps = property.getList();
CollectionValueSupport collectionValue = (CollectionValueSupport)metaValue;
MetaType listMemberMetaType = collectionValue.getMetaType().getElementType();
MetaValue[] listMemberValues = new MetaValue[listMemberProps.size()];
PropertyAdapter propertyAdapter = PropertyAdapterFactory.getPropertyAdapter(listMemberMetaType);
int memberIndex = 0;
for (Property listMemberProp : listMemberProps)
{
MetaValue listMemberValue = propertyAdapter.convertToMetaValue(listMemberProp, listMemberPropDef, listMemberMetaType);
listMemberValues[memberIndex++] = listMemberValue;
}
// Replace the existing elements with the new ones.
collectionValue.setElements(listMemberValues);
}