|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openrdf.rio.rdfxml.RDFXMLWriter
public class RDFXMLWriter
An implementation of the RDFWriter interface that writes RDF documents in XML-serialized RDF format.
| Field Summary | |
|---|---|
protected boolean |
headerWritten
|
protected Resource |
lastWrittenSubject
|
protected Map<String,String> |
namespaceTable
|
protected Writer |
writer
|
protected boolean |
writingStarted
|
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
void |
endRDF()
Signals the end of the RDF data. |
protected void |
flushPendingStatements()
|
RDFFormat |
getRDFFormat()
Gets the RDF format that this RDFWriter uses. |
void |
handleComment(String comment)
Handles a comment. |
void |
handleNamespace(String prefix,
String name)
Handles a namespace declaration/definition. |
void |
handleStatement(Statement st)
Handles a statement. |
protected void |
setNamespace(String prefix,
String name,
boolean fixedPrefix)
|
void |
startRDF()
Signals the start of the RDF data. |
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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Writer writer
protected Map<String,String> namespaceTable
protected boolean writingStarted
protected boolean headerWritten
protected Resource lastWrittenSubject
| Constructor Detail |
|---|
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.| Method Detail |
|---|
public RDFFormat getRDFFormat()
RDFWriter
getRDFFormat in interface RDFWriterpublic void startRDF()
RDFHandler
startRDF in interface RDFHandler
protected void writeHeader()
throws IOException
IOException
public void endRDF()
throws RDFHandlerException
RDFHandler
endRDF in interface RDFHandlerRDFHandlerException - If the RDF handler has encountered an unrecoverable error.
public void handleNamespace(String prefix,
String name)
RDFHandler
handleNamespace in interface RDFHandlerprefix - The prefix for the namespace, or an empty string in case of a
default namespace.name - The URI that the prefix maps to.
protected void setNamespace(String prefix,
String name,
boolean fixedPrefix)
public void handleStatement(Statement st)
throws RDFHandlerException
RDFHandler
handleStatement in interface RDFHandlerst - The statement.
RDFHandlerException - If the RDF handler has encountered an unrecoverable error.
public void handleComment(String comment)
throws RDFHandlerException
RDFHandler
handleComment in interface RDFHandlercomment - The comment.
RDFHandlerException - If the RDF handler has encountered an unrecoverable error.
protected void flushPendingStatements()
throws IOException
IOException
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
IOException
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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||