net.sf.eos.document
Class Serializer
java.lang.Object
net.sf.eos.config.Configured
net.sf.eos.document.Serializer
- All Implemented Interfaces:
- Configurable
- Direct Known Subclasses:
- XmlSerializer
public abstract class Serializer
- extends Configured
Implementations must serialize and deserialize an EosDocument
.
An implementation which serialized a document thru th
serialize(EosDocument, Writer)
implementation must deserialize it
thru the corresponding deserialize(Reader)
method.
- Author:
- Sascha Kohlmann
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SERIALIZER_IMPL_CONFIG_NAME
@ConfigurationKey(type=CLASSNAME,
description="Implementation supports serialization and deserialization of EosDocuments.")
public static final String SERIALIZER_IMPL_CONFIG_NAME
- The configuration key name for the classname of the serializer.
- See Also:
newInstance(Configuration)
,
Constant Field Values
Serializer
protected Serializer()
newInstance
@FactoryMethod(key="net.sf.eos.document.Serializer.impl",
implementation=XmlSerializer.class)
public static final Serializer newInstance(Configuration config)
throws EosException
- Throws:
EosException
serialize
public abstract void serialize(EosDocument doc,
Writer out)
throws IOException
- Implementations serializes the content of an
EosDocument
thru the given writer
- Parameters:
doc
- the document to serializeout
- the sink to write the content thru
- Throws:
IOException
- if something goes wrong during serialization
deserialize
public abstract EosDocument deserialize(Reader in)
throws Exception,
IOException
- Implementations must deserialize a
EosDocument
which are
serialized by serialize(EosDocument,Writer)
.
- Parameters:
in
- the stream to read the EosDocument
content from
- Returns:
- a
EosDocument
constructed form the content
- Throws:
Exception
- if an error occurs during deserilization
IOException
- if in occurs an error
Copyright © 2008. All Rights Reserved.