com.calitha.xml
Interface IDocumentXMLSerializer

All Known Implementing Classes:
DocumentXMLSerializer

public interface IDocumentXMLSerializer

This class reprents a serializer of Document objects to XML output.

The output can eiter be a Writer, OutputStream, File or String by using one of the overloaded serialize methods.

Author:
Robert van Loenhout

Method Summary
 Charset getEncoding()
          Determines the encoding character set.
 boolean isIndenting()
          Determines if indenting will be used when formatting the output.
 boolean isNamespaces()
          Determines if namespaces are supported.
 boolean isPreserveSpace()
          Determines if space is preserved.
 String serialize(Document document)
          Serialized the document to a string.
 void serialize(File file, Document document)
          Serializes the document to a file.
 void serialize(OutputStream out, Document document)
          Serializes the document to an output stream.
 void serialize(Writer writer, Document document)
          Serialize the document to a writer.
 void setEncoding(Charset encoding)
          Sets the encoding character set.
 void setIndenting(boolean indenting)
          Setting this to true will cause indenting to be used when formatting the output.
 void setNamespaces(boolean namespaces)
          Sets the namespace support
 void setPreserveSpace(boolean preserveSpace)
          Setting this to true will make space be preserved.
 

Method Detail

getEncoding

Charset getEncoding()
Determines the encoding character set.

Returns:
character set

setEncoding

void setEncoding(Charset encoding)
Sets the encoding character set.

Parameters:
encoding - character set

isPreserveSpace

boolean isPreserveSpace()
Determines if space is preserved.

Returns:
true if space is preserved

setPreserveSpace

void setPreserveSpace(boolean preserveSpace)
Setting this to true will make space be preserved.

Parameters:
preserveSpace - preserve space value

isNamespaces

boolean isNamespaces()
Determines if namespaces are supported.

Returns:
namespaces support

setNamespaces

void setNamespaces(boolean namespaces)
Sets the namespace support

Parameters:
namespaces - new namespaces support value

isIndenting

boolean isIndenting()
Determines if indenting will be used when formatting the output.

Returns:
true if indenting is used

setIndenting

void setIndenting(boolean indenting)
Setting this to true will cause indenting to be used when formatting the output.

Parameters:
indenting - indenting value

serialize

void serialize(Writer writer,
               Document document)
               throws IOException
Serialize the document to a writer.

Parameters:
writer - writer
document - document
Throws:
IOException - if an I/O error occurs
IllegalArgumentException - if any argument is null

serialize

void serialize(OutputStream out,
               Document document)
               throws IOException
Serializes the document to an output stream.

Parameters:
out - output stream
document - document
Throws:
IOException - if an I/O error occurs
IllegalArgumentException - if any argument is null

serialize

void serialize(File file,
               Document document)
               throws IOException
Serializes the document to a file.

Parameters:
file - file
document - document
Throws:
IOException - if an I/O error occurs
IllegalArgumentException - if any argument is null

serialize

String serialize(Document document)
                 throws IOException
Serialized the document to a string.

Parameters:
document - document
Returns:
string
Throws:
IOException - if an I/O error occurs
IllegalArgumentException - if any argument is null