use of org.mycore.oai.pmh.Description in project mycore by MyCoRe-Org.
the class MCROAISetManager method createSet.
private MCRSet createSet(String setId, Element setElement) {
String setSpec = setElement.getChildText("setSpec", NS_OAI);
String setName = setElement.getChildText("setName", NS_OAI);
MCRSet set = new MCRSet(setId, getSetSpec(setSpec), setName);
set.getDescription().addAll(setElement.getChildren("setDescription", NS_OAI).stream().flatMap(// first childElement of setDescription
e -> e.getChildren().stream().limit(1)).peek(Element::detach).map(d -> (Description) new Description() {
@Override
public Element toXML() {
return d;
}
@Override
public void fromXML(Element descriptionElement) {
throw new UnsupportedOperationException();
}
}).collect(Collectors.toList()));
return set;
}
Aggregations