writer.writeEndElement();
}
public void readRows(XMLStreamReader reader, GraphModel graphModel, AbstractAttributeModel attributeModel) throws XMLStreamException {
HierarchicalGraph hierarchicalGraph = graphModel.getHierarchicalGraph();
boolean end = false;
while (reader.hasNext() && !end) {
int type = reader.next();
switch (type) {
case XMLStreamReader.START_ELEMENT:
String name = reader.getLocalName();
if (ELEMENT_NODE_ROW.equalsIgnoreCase(name)) {
int id = Integer.parseInt(reader.getAttributeValue(null, "for"));
Node node = hierarchicalGraph.getNode(id);
if (node.getNodeData().getAttributes() != null && node.getNodeData().getAttributes() instanceof AttributeRowImpl) {
AttributeRowImpl row = (AttributeRowImpl) node.getNodeData().getAttributes();
readRow(reader, attributeModel, attributeModel.getNodeTable(), row);
}
} else if (ELEMENT_EDGE_ROW.equalsIgnoreCase(name)) {
int id = Integer.parseInt(reader.getAttributeValue(null, "for"));
Edge edge = hierarchicalGraph.getEdge(id);
if (edge.getEdgeData().getAttributes() != null && edge.getEdgeData().getAttributes() instanceof AttributeRowImpl) {
AttributeRowImpl row = (AttributeRowImpl) edge.getEdgeData().getAttributes();
readRow(reader, attributeModel, attributeModel.getEdgeTable(), row);
}
}