use of com.baremaps.osm.domain.Change.ChangeType in project baremaps by baremaps.
the class OsmChangeSpliterator method readChange.
private Change readChange() throws XMLStreamException {
switch(reader.getLocalName()) {
case ELEMENT_NAME_CREATE:
case ELEMENT_NAME_DELETE:
case ELEMENT_NAME_MODIFY:
ChangeType type = ChangeType.valueOf(reader.getLocalName().toUpperCase());
List<Entity> elements = new ArrayList<>();
reader.nextTag();
while (reader.getEventType() == XMLStreamConstants.START_ELEMENT) {
elements.add(readElement());
reader.nextTag();
}
return new Change(type, elements);
default:
throw new StreamException("Unexpected XML element: " + reader.getLocalName());
}
}
Aggregations