1 package org.simantics.xml.sax.base;
\r
3 import java.util.Collection;
\r
4 import java.util.Set;
\r
6 import javax.xml.stream.XMLStreamException;
\r
7 import javax.xml.stream.XMLStreamWriter;
\r
9 import org.simantics.db.ReadGraph;
\r
10 import org.simantics.db.Resource;
\r
11 import org.simantics.db.Statement;
\r
12 import org.simantics.db.exception.DatabaseException;
\r
14 public class XMLNSElementWriter implements XMLElementWriter{
\r
16 XMLElementWriter writer;
\r
19 public XMLNSElementWriter(XMLElementWriter writer, String ns) {
\r
20 this.writer = writer;
\r
25 public void start(ReadGraph graph, WriterElement instance, XMLStreamWriter writer)
\r
26 throws XMLStreamException, DatabaseException {
\r
27 this.writer.start(graph, instance, writer);
\r
28 writer.writeNamespace("", ns);
\r
32 public void attributes(ReadGraph graph, WriterElement instance, Collection<Statement> attributes,
\r
33 XMLStreamWriter writer) throws XMLStreamException, DatabaseException {
\r
34 this.writer.attributes(graph, instance, attributes, writer);
\r
38 public void characters(ReadGraph graph, WriterElement instance, XMLStreamWriter writer)
\r
39 throws XMLStreamException, DatabaseException {
\r
40 this.writer.characters(graph, instance, writer);
\r
44 public void children(ReadGraph graph, WriterElement instance, Set<Resource> writer)
\r
45 throws XMLStreamException, DatabaseException {
\r
46 this.writer.children(graph, instance, writer);
\r
50 public void end(ReadGraph graph, WriterElement instance, XMLStreamWriter writer)
\r
51 throws XMLStreamException, DatabaseException {
\r
52 this.writer.end(graph, instance, writer);
\r
56 public String getElementId() {
\r
57 return writer.getElementId();
\r
61 public Resource getType(ReadGraph graph) throws DatabaseException {
\r
62 return writer.getType(graph);
\r