throws XDIMEException {
// check the id
if (id == null) {
if (!hasPageScope()) {
throw new XDIMEException(LOCALIZER.format(
"invalid-meta-property-scope-page", propertyName));
}
} else if (!hasElementScope()) {
throw new XDIMEException(LOCALIZER.format(
"invalid-meta-property-scope-element", propertyName));
}
checkContent(content, context);
// store the content
final MetaData metaData;
if (id == null) {
metaData = context.getPageMetaData();
} else {
metaData = context.getElementMetaData(id);
}
if (multipleInstancesAllowed()) {
metaData.addPropertyValue(propertyName, content);
} else {
if (metaData.setPropertyValue(propertyName, content) != null) {
throw new XDIMEException(LOCALIZER.format(
"meta-property-occurrence-error", propertyName));
}
}
}