org.jrdf.writer.ntriples
Class NTriplesWriterImpl

java.lang.Object
  extended by org.jrdf.writer.ntriples.NTriplesWriterImpl
All Implemented Interfaces:
TypedNodeVisitor, NTriplesWriter, RdfWriter

public class NTriplesWriterImpl
extends Object
implements NTriplesWriter


Field Summary
 
Fields inherited from interface org.jrdf.writer.RdfWriter
NEW_LINE
 
Constructor Summary
NTriplesWriterImpl()
           
 
Method Summary
 void close()
          Close any streams - should be part of a try/finally block.
 void visitBlankNode(BlankNode blankNode)
          Visit blank node.
 void visitLiteral(Literal literal)
          Visit Literal.
 void visitNode(Node node)
          Visit node.
 void visitResource(Resource resource)
          Visit Resource.
 void visitURIReference(URIReference uriReference)
          Visit URI Reference.
 void write(Graph graph, OutputStream stream)
          Writes the Graph contents to the OutputStream.
 void write(Graph graph, Writer newWriter)
          Writes the Graph contents to the Writer.
 void write(Graph graph, Writer newWriter, String encoding)
          Writes the Graph contents to the Writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NTriplesWriterImpl

public NTriplesWriterImpl()
Method Detail

write

public void write(Graph graph,
                  OutputStream stream)
           throws WriteException,
                  GraphException
Description copied from interface: RdfWriter
Writes the Graph contents to the OutputStream.

Specified by:
write in interface RdfWriter
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

public void write(Graph graph,
                  Writer newWriter)
           throws WriteException,
                  GraphException
Description copied from interface: RdfWriter
Writes the Graph contents to the Writer.

Specified by:
write in interface RdfWriter
Parameters:
graph - Graph input
newWriter - 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

public void write(Graph graph,
                  Writer newWriter,
                  String encoding)
           throws GraphException
Description copied from interface: RdfWriter
Writes the Graph contents to the Writer.

Specified by:
write in interface RdfWriter
Parameters:
graph - Graph input
newWriter - Writer output. Caller is responsible for closing writers.
encoding - Encoding (UTF-8, UTF-16, etc).
Throws:
GraphException - If an exception occurrs while reading the graph.

close

public void close()
           throws WriteException
Description copied from interface: RdfWriter
Close any streams - should be part of a try/finally block.

Specified by:
close in interface RdfWriter
Throws:
WriteException - if there's an exception closing the streams.

visitBlankNode

public void visitBlankNode(BlankNode blankNode)
Description copied from interface: TypedNodeVisitor
Visit blank node.

Specified by:
visitBlankNode in interface TypedNodeVisitor
Parameters:
blankNode - the blank node to visit.

visitURIReference

public void visitURIReference(URIReference uriReference)
Description copied from interface: TypedNodeVisitor
Visit URI Reference.

Specified by:
visitURIReference in interface TypedNodeVisitor
Parameters:
uriReference - the URI Reference to visit.

visitLiteral

public void visitLiteral(Literal literal)
Description copied from interface: TypedNodeVisitor
Visit Literal.

Specified by:
visitLiteral in interface TypedNodeVisitor
Parameters:
literal - the Literal to visit.

visitNode

public void visitNode(Node node)
Description copied from interface: TypedNodeVisitor
Visit node.

Specified by:
visitNode in interface TypedNodeVisitor
Parameters:
node - the node to visit.

visitResource

public void visitResource(Resource resource)
Description copied from interface: TypedNodeVisitor
Visit Resource.

Specified by:
visitResource in interface TypedNodeVisitor
Parameters:
resource - the node to visit.