de.fu_berlin.ties.xml.io
Interface DocumentSerializer


public interface DocumentSerializer

Interface for classes that support reading and writing XML documents.

Version:
$Revision: 1.1 $, $Date: 2004/12/09 18:10:52 $, $Author: siefkes $
Author:
Christian Siefkes

Method Summary
 Document readDocument(InputStream in)
          Reads an XML document from a given stream.
 Document readDocument(Reader reader)
          Reads an XML document from a given reader.
 Document writeDocument(Document document, OutputStream out)
          Writes an XML document to a given stream .
 void writeDocument(Document document, Writer writer)
          Writes an XML document to a given writer.
 

Method Detail

readDocument

Document readDocument(Reader reader)
                      throws DocumentException,
                             IOException
Reads an XML document from a given reader. Typically a stream should be used instead (readDocument(InputStream)) to ensure that encoding issues are handled correctly.

Parameters:
reader - reader containing the text to parse; not closed by this method
Returns:
the newly created document
Throws:
DocumentException - if an error occurs during parsing
IOException - if an I/O error occurrs

readDocument

Document readDocument(InputStream in)
                      throws DocumentException,
                             IOException
Reads an XML document from a given stream.

Parameters:
in - stream containing the text to parse; not closed by this method
Returns:
the newly created document
Throws:
DocumentException - if an error occurs during parsing
IOException - if an I/O error occurrs

writeDocument

void writeDocument(Document document,
                   Writer writer)
                   throws IOException
Writes an XML document to a given writer. Typically a stream should be used instead (writeDocument(Document, OutputStream)) to ensure that encoding issues are handled correctly.

Parameters:
document - the document to write
writer - the writer to write the document text to; flushed but not closed by this method
Throws:
IOException - if an I/O error occurrs

writeDocument

Document writeDocument(Document document,
                       OutputStream out)
                       throws IOException
Writes an XML document to a given stream .

Parameters:
document - the document to write
out - the stream to write the document text to; flushed but not closed by this method
Throws:
IOException - if an I/O error occurs during writing


Copyright © 2003-2004 Christian Siefkes. All Rights Reserved.