public class RDFXMLWriter extends AbstractRDFWriter implements RDFWriter
Modifier and Type | Field and Description |
---|---|
protected String |
defaultNamespace |
protected boolean |
headerWritten |
protected Resource |
lastWrittenSubject |
protected Writer |
writer |
protected boolean |
writingStarted |
namespaceTable
Constructor and Description |
---|
RDFXMLWriter(OutputStream out)
Creates a new RDFXMLWriter that will write to the supplied OutputStream.
|
RDFXMLWriter(Writer writer)
Creates a new RDFXMLWriter that will write to the supplied Writer.
|
Modifier and Type | Method and Description |
---|---|
void |
endRDF() |
protected void |
flushPendingStatements() |
RDFFormat |
getRDFFormat() |
protected String |
getValidNodeId(BNode bNode)
Create a syntactically valid node id from the supplied blank node id.
|
void |
handleComment(String comment) |
void |
handleNamespace(String prefix,
String name) |
void |
handleStatement(Statement st) |
protected void |
setNamespace(String prefix,
String name) |
void |
startRDF() |
protected void |
writeAttribute(String attName,
String value) |
protected void |
writeAttribute(String namespace,
String attName,
String value) |
protected void |
writeCharacterData(String chars) |
protected void |
writeEndOfEmptyTag() |
protected void |
writeEndOfStartTag() |
protected void |
writeEndTag(String namespace,
String localName) |
protected void |
writeHeader() |
protected void |
writeIndent() |
protected void |
writeNewLine() |
protected void |
writeStartOfStartTag(String namespace,
String localName) |
getSupportedSettings, getWriterConfig, setWriterConfig
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSupportedSettings, getWriterConfig, setWriterConfig
protected Writer writer
protected String defaultNamespace
protected boolean writingStarted
protected boolean headerWritten
protected Resource lastWrittenSubject
public RDFXMLWriter(OutputStream out)
out
- The OutputStream to write the RDF/XML document to.public RDFXMLWriter(Writer writer)
writer
- The Writer to write the RDF/XML document to.public RDFFormat getRDFFormat()
getRDFFormat
in interface RDFWriter
public void startRDF() throws RDFHandlerException
startRDF
in interface RDFHandler
RDFHandlerException
protected void writeHeader() throws IOException
IOException
public void endRDF() throws RDFHandlerException
endRDF
in interface RDFHandler
RDFHandlerException
public void handleNamespace(String prefix, String name)
handleNamespace
in interface RDFHandler
handleNamespace
in class AbstractRDFWriter
public void handleStatement(Statement st) throws RDFHandlerException
handleStatement
in interface RDFHandler
RDFHandlerException
public void handleComment(String comment) throws RDFHandlerException
handleComment
in interface RDFHandler
RDFHandlerException
protected void flushPendingStatements() throws IOException, RDFHandlerException
IOException
RDFHandlerException
protected void writeStartOfStartTag(String namespace, String localName) throws IOException
IOException
protected void writeAttribute(String attName, String value) throws IOException
IOException
protected void writeAttribute(String namespace, String attName, String value) throws IOException, RDFHandlerException
IOException
RDFHandlerException
protected void writeEndOfStartTag() throws IOException
IOException
protected void writeEndOfEmptyTag() throws IOException
IOException
protected void writeEndTag(String namespace, String localName) throws IOException
IOException
protected void writeCharacterData(String chars) throws IOException
IOException
protected void writeIndent() throws IOException
IOException
protected void writeNewLine() throws IOException
IOException
protected String getValidNodeId(BNode bNode) throws IOException
bNode
- a blank node identifierIOException
Copyright © 2001-2015 Aduna. All Rights Reserved.