/** * @param cg Conflict graph to be serialized * @throws IOException */ @Override public void serialize(ConflictGraph cg) throws IOException { m_xmlWriter.startDocument(Names.CONFLICT_GRAPH_ROOT_ELEMENT_NAME); for (Set<ConditionalConstraint> ccSet : cg.getConstraintSets()) { m_xmlWriter.writeStartElement(Names.CONFLICT_MAPPING_ELEMENT_NAME); m_xmlWriter.writeStartElement(Names.CC_SET_ELEMENT_NAME); serializeConstraintSet(ccSet); m_xmlWriter.writeEndElement(); // Now serialize conflict sets for (Set<ConditionalConstraint> conflictSet : cg.getConflictSets(ccSet)) { m_xmlWriter.writeStartElement(Names.CONFLICT_SET_ELEMENT_NAME); serializeConstraintSet(conflictSet); m_xmlWriter.writeEndElement(); } m_xmlWriter.writeEndElement(); } m_xmlWriter.endDocument(); }
private void writeAttribute(String attributeName, IRI value) throws IOException { writer.writeAttribute(attributeName, value.toString()); }
public void writeNodeIDAttribute(RDFResourceNode node) throws IOException { writer.writeAttribute(Namespaces.RDF + "nodeID", node.toString()); }
public void writeEndElement() throws IOException { writer.writeEndElement(); }
public void writeLangAttribute(String lang) throws IOException { writer.writeAttribute("xml:lang", lang); }
public void writeTextContent(String text) throws IOException { writer.writeTextContent(text); }
public void writeDatatypeAttribute(IRI datatypeIRI) throws IOException { writer.writeAttribute(Namespaces.RDF + "datatype", datatypeIRI.toString()); }
public void writeParseTypeAttribute() throws IOException { writer.writeAttribute(Namespaces.RDF + "parseType", "Collection"); }
public void writeStartElement(IRI elementName) throws IOException { // Sort out with namespace writer.writeStartElement(elementName.toString()); }
public void writeComment(String comment) throws IOException { writer.writeComment(comment); }
public void endDocument() throws IOException { writer.endDocument(); }
public void startDocument() throws IOException { writer.startDocument(Namespaces.RDF + "RDF"); }