value = map.get(attrName);
} else {
if (attribute.getDefaultValueLiteral() != null) {
value = attribute.getDefaultValue();
} else {
throw new CreateObjectException(MessageFormat.format("Can''t create instance of {0} protected object: the value of attribute {1} isn''t defined", po.getName(), attrName));
}
}
try {
poInstance.eSet(attribute, value);
} catch (ClassCastException e) {
throw new CreateObjectException(MessageFormat.format("Can''t create instance of {0} protected object: the value of attribute {1} has incorrect type: {2}", po.getName(), attrName, e.getLocalizedMessage()));
}
}
return poInstance;
}