com.hp.hpl.mesa.rdf.jena.common
Class RDFXMLWriter

java.lang.Object
  |
  +--com.hp.hpl.mesa.rdf.jena.common.RDFXMLWriter
All Implemented Interfaces:
RDFWriter

public class RDFXMLWriter
extends java.lang.Object
implements RDFWriter

Writes out an XML serialization of a model.

Version:
Release='$Name: $' Revision='$Revision: 1.9 $' Date='$Date: 2002/09/18 11:58:00 $'
Author:
bwm

Field Summary
 
Fields inherited from interface com.hp.hpl.mesa.rdf.jena.model.RDFWriter
NSPREFIXPROPBASE
 
Constructor Summary
RDFXMLWriter()
           
 
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 properties for this writer The following properties are supported: PropName propValue Description xmlbase String the value of an xml:base attribute to set on the output.
 void write(Model model, java.io.Writer writer, java.lang.String base)
          Write out an XML serialization of a model.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RDFXMLWriter

public RDFXMLWriter()
Method Detail

write

public void write(Model model,
                  java.io.Writer writer,
                  java.lang.String base)
           throws RDFException
Write out an XML serialization of a model.

Specified by:
write in interface RDFWriter
Parameters:
model - the model to be serialized
writer - the PrintWriter to receive the serialization
base - the base URI for relative URI calculations. null means use only absolute URI's.
Throws:
IOException - if an io error occurs
RDFException - if any other exception occurs

setNsPrefix

public void setNsPrefix(java.lang.String prefix,
                        java.lang.String ns)
Description copied from interface: RDFWriter
Set the the namespace prefix to be used for a particular namespace.

Specified by:
setNsPrefix in interface RDFWriter
Parameters:
prefix - the prefix to be used
ns - the namespace

setErrorHandler

public RDFErrorHandler setErrorHandler(RDFErrorHandler errHandler)
Description copied from interface: RDFWriter
Set an error handler.

Specified by:
setErrorHandler in interface RDFWriter
Parameters:
errHandler - The new error handler to be used.
Returns:
the old error handler

setProperty

public java.lang.Object setProperty(java.lang.String propName,
                                    java.lang.Object propValue)
                             throws RDFException
Set properties for this writer The following properties are supported: PropName propValue Description xmlbase String the value of an xml:base attribute to set on the output. longId Boolean Whether to use long or short id's for anon resources. Short id's are easier to read and the default, but can run out of memory on very large models.

Specified by:
setProperty in interface RDFWriter
Parameters:
propName - the name of the property being set
propValue - the 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


Copyright © 2001 Hewlett-Packard. All Rights Reserved.