int place = 1;
for (Object v : sd.getFieldValues(m))
{
String value = (String) v;
String[] mv = value.split("\\|\\|\\|");
WSMetadataValue mvalue = new WSMetadataValue();
mvalue.setValue(mv[0]);
mvalue.setAuthority(mv.length > 1 ? mv[1] : null);
mvalue.setShare(mv.length > 2 ? Integer.parseInt(mv[2]) : null);
mvalue.setPlace(place);
place++;
metadata.getValues().add(mvalue);
}
item.getMetadata().add(metadata);
}