}
public void populateMetaValueFromProperty(PropertyList property,
MetaValue metaValue, PropertyDefinitionList propertyDefinition)
{
MapCompositeValueSupport valuesMap = (MapCompositeValueSupport)metaValue;
for (Property p : property.getList())
{
PropertyMap propertyMap = (PropertyMap)p;
PropertySimple nameProperty = (PropertySimple)propertyMap
.get("name");
PropertySimple typeProperty = (PropertySimple)propertyMap
.get("type");
PropertySimple valueProperty = (PropertySimple)propertyMap
.get("value");
String configPropertyName = nameProperty.getStringValue();
String configPropertyType = typeProperty.getStringValue();
String configPropertyValue = valueProperty.getStringValue();
if (!ConfigPropertyType.fromTypeName(configPropertyType)
.isValueValid(configPropertyValue))
{
String message = "The value of Config Property '"
+ configPropertyName
+ "' has an invalid value for its type.";
property.setErrorMessage(message);
throw new IllegalArgumentException(message);
}
valuesMap.put(configPropertyName, new SimpleValueSupport(
SimpleMetaType.STRING, valueProperty.getStringValue()));
valuesMap.put(configPropertyName + ".type", new SimpleValueSupport(
SimpleMetaType.STRING, typeProperty.getStringValue()));
}
}