com.hp.hpl.mesa.rdf.jena.model
Interface RDFWriter

All Known Implementing Classes:
NTripleWriter, PrettyWriter, RDFXMLWriter

public interface RDFWriter

RDFWriter is an interface to RDF serializers.

An RDFWriter is a class which serializes an RDF model to some RDF serializaion language. RDF/XML, n-triple and n3 are examples of serialization languages.

Version:
$Revision: 1.3 $
Author:
bwm

Field Summary
static java.lang.String NSPREFIXPROPBASE
          Namespace prefixes can be set using a system property of the form
 
Method Summary
 RDFErrorHandler setErrorHandler(RDFErrorHandler errHandler)
          Set an error handler.
 void setNsPrefix(java.lang.String prefix, java.lang.String ns)
          Set the the namespace prefix to be used for a particular namespace.
 java.lang.Object setProperty(java.lang.String propName, java.lang.Object propValue)
          Set a property to control the behaviour of this writer.
 void write(Model model, java.io.Writer out, java.lang.String base)
          Serialize Model model to Writer out.
 

Field Detail

NSPREFIXPROPBASE

public static final java.lang.String NSPREFIXPROPBASE
Namespace prefixes can be set using a system property of the form
  NSPREFIXPROPBASE + URI
 
. Such prefixes override the built in ones and those set using setNsPrefix
Method Detail

write

public void write(Model model,
                  java.io.Writer out,
                  java.lang.String base)
           throws RDFException
Serialize Model model to Writer out.
Parameters:
out - The Writer to which the serialization should be sent.
model - The model to be written.
base - the base URI for relative URI calculations. null means use only absolute URI's.
Throws:
RDFException - Generic RDF exception.

setProperty

public java.lang.Object setProperty(java.lang.String propName,
                                    java.lang.Object propValue)
                             throws RDFException
Set a property to control the behaviour of this writer.

An RDFWriter's behaviour can be influenced by defining property values interpreted by that particular writer class. The values for such properties can be changed by calling this method.

No standard properties are defined. For the properties recognised by any particular writer implementation, see the the documentation for that implementation. The properties recognised by writers provided in the standard distribution can be found in the description of their setProperty method. Consult the list of implementors of this interface given above.

Parameters:
propName - The name of the property.
propValue - The new value of the property
Returns:
the old value for this property, or null if no value was set.
Throws:
RDFException - Throws a generic RDF exception

setNsPrefix

public void setNsPrefix(java.lang.String prefix,
                        java.lang.String ns)
Set the the namespace prefix to be used for a particular namespace.
Parameters:
prefix - the prefix to be used
ns - the namespace

setErrorHandler

public RDFErrorHandler setErrorHandler(RDFErrorHandler errHandler)
Set an error handler.
Parameters:
errHandler - The new error handler to be used.
Returns:
the old error handler


Copyright 2001 Hewlett-Packard. All Rights Reserved.