org.jrdf.writer
Interface RdfWriter

All Known Subinterfaces:
NTriplesWriter
All Known Implementing Classes:
MemRdfXmlWriter, NTriplesWriterImpl, RdfXmlWriter

public interface RdfWriter

General interface for RDF Writer.

Version:
$Id: RdfWriter.java 3276 2010-05-12 21:50:39Z newmana $
Author:
TurnerRX

Field Summary
static String NEW_LINE
          XML's new line character (LF).
 
Method Summary
 void close()
          Close any streams - should be part of a try/finally block.
 void write(Graph graph, OutputStream stream)
          Writes the Graph contents to the OutputStream.
 void write(Graph graph, Writer writer)
          Writes the Graph contents to the Writer.
 void write(Graph graph, Writer writer, String encoding)
          Writes the Graph contents to the Writer.
 

Field Detail

NEW_LINE

static final String NEW_LINE
XML's new line character (LF).

See Also:
Constant Field Values
Method Detail

write

void write(Graph graph,
           OutputStream stream)
           throws WriteException,
                  GraphException
Writes the Graph contents to the OutputStream.

Parameters:
graph - Graph input
stream - OutputStream output. Caller is responsible for closing stream.
Throws:
WriteException - If the writer encounters an unrecoverable error.
GraphException - If an exception occurrs while reading the graph.

write

void write(Graph graph,
           Writer writer)
           throws WriteException,
                  GraphException
Writes the Graph contents to the Writer.

Parameters:
graph - Graph input
writer - Writer output. Caller is responsible for closing writers.
Throws:
WriteException - If the writer encounters an unrecoverable error.
GraphException - If an exception occurrs while reading the graph.

write

void write(Graph graph,
           Writer writer,
           String encoding)
           throws GraphException
Writes the Graph contents to the Writer.

Parameters:
graph - Graph input
writer - Writer output. Caller is responsible for closing writers.
encoding - Encoding (UTF-8, UTF-16, etc).
Throws:
WriteException - If the writer encounters an unrecoverable error.
GraphException - If an exception occurrs while reading the graph.

close

void close()
           throws WriteException
Close any streams - should be part of a try/finally block.

Throws:
WriteException - if there's an exception closing the streams.