net.sf.eos.document
Class XmlSerializer

java.lang.Object
  extended by net.sf.eos.config.Configured
      extended by net.sf.eos.document.Serializer
          extended by net.sf.eos.document.XmlSerializer
All Implemented Interfaces:
Configurable

public class XmlSerializer
extends Serializer

Serializer and deserializer for an EosDocument. See XmlSerializer.ElementName for element names. The order of the elements in the root container are not defined. Also the order in the meta container is not defined. If the root container contains more than one title or text element, the latest elements may win. If the meta container contains more than one key, the latest may win.

Author:
Sascha Kohlmann

Nested Class Summary
static class XmlSerializer.ElementName
          Represents the XML element names of a serialized εοs document.
protected static class XmlSerializer.XmlEosDocumentHandler
          Deserializes a EosDocument which is serialized by serialize(EosDocument, Writer).
 
Field Summary
 
Fields inherited from class net.sf.eos.document.Serializer
SERIALIZER_IMPL_CONFIG_NAME
 
Constructor Summary
XmlSerializer()
           
 
Method Summary
 EosDocument deserialize(Reader in)
          Implementations must deserialize a EosDocument which are serialized by Serializer.serialize(EosDocument,Writer).
 void serialize(EosDocument doc, Writer out)
          Implementations serializes the content of an EosDocument thru the given writer
 
Methods inherited from class net.sf.eos.document.Serializer
newInstance
 
Methods inherited from class net.sf.eos.config.Configured
configure, getConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlSerializer

public XmlSerializer()
Method Detail

serialize

public void serialize(EosDocument doc,
                      Writer out)
               throws IOException
Description copied from class: Serializer
Implementations serializes the content of an EosDocument thru the given writer

Specified by:
serialize in class Serializer
Parameters:
doc - the document to serialize
out - the sink to write the content thru
Throws:
IOException - if something goes wrong during serialization

deserialize

public EosDocument deserialize(Reader in)
                        throws IOException,
                               ParserConfigurationException,
                               SAXException
Description copied from class: Serializer
Implementations must deserialize a EosDocument which are serialized by Serializer.serialize(EosDocument,Writer).

Specified by:
deserialize in class Serializer
Parameters:
in - the stream to read the EosDocument content from
Returns:
a EosDocument constructed form the content
Throws:
IOException - if in occurs an error
ParserConfigurationException
SAXException


Copyright © 2008. All Rights Reserved.