jumpToEnd();
return id;
}
protected Relation parseRelation() throws XMLStreamException {
RelationData rd = new RelationData();
readCommon(rd);
Relation r = new Relation(rd.getId(), rd.getVersion());
r.setVisible(rd.isVisible());
r.load(rd);
externalIdMap.put(rd.getPrimitiveId(), r);
Collection<RelationMemberData> members = new ArrayList<>();
while (true) {
int event = parser.next();
if (event == XMLStreamConstants.START_ELEMENT) {
switch (parser.getLocalName()) {
case "member":
members.add(parseRelationMember(r));
break;
case "tag":
parseTag(r);
break;
default:
parseUnknown();
}
} else if (event == XMLStreamConstants.END_ELEMENT) {
break;
}
}
if (r.isDeleted() && !members.isEmpty()) {
Main.info(tr("Deleted relation {0} contains members", r.getUniqueId()));
members = new ArrayList<>();
}
relations.put(rd.getUniqueId(), members);
return r;
}