writer.writeStartElement(ELEMENT_ROWS);
HierarchicalGraph hierarchicalGraph = graphModel.getHierarchicalGraph();
for (Node node : hierarchicalGraph.getNodesTree()) {
if (node.getNodeData().getAttributes() != null && node.getNodeData().getAttributes() instanceof AttributeRowImpl) {
AttributeRowImpl row = (AttributeRowImpl) node.getNodeData().getAttributes();
writer.writeStartElement(ELEMENT_NODE_ROW);
writer.writeAttribute("for", String.valueOf(node.getId()));
if (writeRow(writer, row)) {
writer.writeEndElement();
}
}
}
for (Node node : hierarchicalGraph.getNodesTree()) {
for (Edge edge : hierarchicalGraph.getEdges(node)) {
if (edge.getEdgeData().getAttributes() != null && edge.getEdgeData().getAttributes() instanceof AttributeRowImpl) {
AttributeRowImpl row = (AttributeRowImpl) edge.getEdgeData().getAttributes();
writer.writeStartElement(ELEMENT_EDGE_ROW);
writer.writeAttribute("for", String.valueOf(edge.getId()));
if (writeRow(writer, row)) {
writer.writeEndElement();
}