if (itemMetadata != null && itemMetadata.size() > 0)
{
for (String mdString : itemMetadata)
{
String converterName = null;
IConverter converter = null;
Matcher converterMatcher = converterPattern.matcher(mdString);
if (converterMatcher.matches())
{
converterName = converterMatcher.group(1);
converter = (IConverter) PluginManager.getNamedPlugin(
IConverter.class, converterName);
if (converter == null)
{
log.warn(LogManager.getHeader(null,
"createMetadata",
"no converter plugin found with name "
+ converterName + " for metadata "
+ mdString));
}
}
DCValue[] dcValues;
if (converterName != null)
{
dcValues = item.getMetadata(mdString.replaceAll("\\("
+ converterName + "\\)", ""));
}
else
{
dcValues = item.getMetadata(mdString);
}
try
{
for (DCValue dcValue : dcValues)
{
if (!MetadataExposure.isHidden(((HarvestedItemInfo) nativeItem).context,
dcValue.schema, dcValue.element, dcValue.qualifier))
{
String value;
if (converter != null)
{
value = converter.makeConversion(dcValue.value);
}
else
{
value = dcValue.value;
}