|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfedora.server.storage.translation.DOTranslatorImpl
public class DOTranslatorImpl
A threadsafe DOTranslator that uses a map of serializers
and a map of deserializers to do its job.
| Constructor Summary | |
|---|---|
DOTranslatorImpl(java.util.Map<java.lang.String,DOSerializer> serializers,
java.util.Map<java.lang.String,DODeserializer> deserializers)
Creates an instance. |
|
| Method Summary | |
|---|---|
void |
deserialize(java.io.InputStream in,
DigitalObject obj,
java.lang.String format,
java.lang.String encoding,
int transContext)
Deserializes the given stream. |
void |
serialize(DigitalObject obj,
java.io.OutputStream out,
java.lang.String format,
java.lang.String encoding,
int transContext)
Serializes the given object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DOTranslatorImpl(java.util.Map<java.lang.String,DOSerializer> serializers,
java.util.Map<java.lang.String,DODeserializer> deserializers)
serializers - the DOSerializer map, keyed by format string.deserializers - the DODeserializer map, keyed by format string.| Method Detail |
|---|
public void deserialize(java.io.InputStream in,
DigitalObject obj,
java.lang.String format,
java.lang.String encoding,
int transContext)
throws ObjectIntegrityException,
StreamIOException,
UnsupportedTranslationException,
ServerException
deserialize in interface DOTranslatorin - the stream to read from (closed when finished).obj - the object to deserialize into.format - the format of the stream (typically a format URI).encoding - the character encoding if the format is text-based.transContext - the translation context.
ObjectIntegrityException - if the stream does not properly encode
an object.
StreamIOException - if there is an error reading from the stream.
ServerException - if the translator is unable to deserialize for
any other reason.
UnsupportedTranslationExceptionDOTranslationUtility.DESERIALIZE_INSTANCE
public void serialize(DigitalObject obj,
java.io.OutputStream out,
java.lang.String format,
java.lang.String encoding,
int transContext)
throws ObjectIntegrityException,
StreamIOException,
UnsupportedTranslationException,
ServerException
serialize in interface DOTranslatorobj - the object to serialize.out - where to send the output to (auto-closed when finished).encoding - the character encoding if the format is text-based.transContext - the translation context.
ObjectIntegrityException - if the given object is in such a state
that serialization can't be performed.
StreamIOException - if there is an error writing to the stream.
ServerException - if the translator is unable to serialize for
any other reason.
UnsupportedTranslationExceptionDOTranslationUtility.SERIALIZE_EXPORT_ARCHIVE,
DOTranslationUtility.SERIALIZE_EXPORT_PUBLIC,
DOTranslationUtility.SERIALIZE_EXPORT_MIGRATE,
DOTranslationUtility.SERIALIZE_STORAGE_INTERNAL
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||