org.fcrepo.server.storage.translation
Interface DOTranslator

All Known Implementing Classes:
DOTranslatorImpl, DOTranslatorModule

public interface DOTranslator

Interface for serializing and deserializing Fedora objects to/from various formats.

Author:
Chris Wilper

Method Summary
 void deserialize(InputStream in, DigitalObject obj, String format, String encoding, int transContext)
          Deserializes the given stream.
 void serialize(DigitalObject obj, OutputStream out, String format, String encoding, int transContext)
          Serializes the given object.
 

Method Detail

deserialize

void deserialize(InputStream in,
                 DigitalObject obj,
                 String format,
                 String encoding,
                 int transContext)
                 throws ObjectIntegrityException,
                        StreamIOException,
                        UnsupportedTranslationException,
                        ServerException
Deserializes the given stream.

Parameters:
in - 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.
Throws:
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.
UnsupportedEncodingException - if the encoding is not supported by the JVM.
UnsupportedTranslationException
See Also:
DOTranslationUtility.DESERIALIZE_INSTANCE

serialize

void serialize(DigitalObject obj,
               OutputStream out,
               String format,
               String encoding,
               int transContext)
               throws ObjectIntegrityException,
                      StreamIOException,
                      UnsupportedTranslationException,
                      ServerException
Serializes the given object.

Parameters:
obj - 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.
Throws:
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.
UnsupportedEncodingException - if the encoding is not supported by the JVM.
UnsupportedTranslationException
See Also:
DOTranslationUtility.SERIALIZE_EXPORT_ARCHIVE, DOTranslationUtility.SERIALIZE_EXPORT_PUBLIC, DOTranslationUtility.SERIALIZE_EXPORT_MIGRATE, DOTranslationUtility.SERIALIZE_STORAGE_INTERNAL


Copyright © 2011 DuraSpace. All Rights Reserved.