gov.sandia.cognition.io.serialization
Interface TextSerializationHandler<SerializedType>

Type Parameters:
SerializedType - The type of object that can be serialized.
All Superinterfaces:
FileSerializationHandler<SerializedType>, StreamSerializationHandler<SerializedType>
All Known Implementing Classes:
AbstractTextSerializationHandler, XStreamSerializationHandler

public interface TextSerializationHandler<SerializedType>
extends StreamSerializationHandler<SerializedType>

Interface for a serialization handler that can serialize to text. Since it can do text, it is assumed that it can also stream and write to a file.

Since:
3.0
Author:
Justin Basilico
See Also:
AbstractTextSerializationHandler, XStreamSerializationHandler

Method Summary
 Object convertFromString(String string)
          Converts an object from its serialized string representation.
 String convertToString(SerializedType object)
          Converts a given object to its serialized string representation.
 Object readObject(Reader reader)
          Reads an object from the given reader.
 void writeObject(Writer writer, SerializedType object)
          Writes an object to the given writer.
 
Methods inherited from interface gov.sandia.cognition.io.serialization.StreamSerializationHandler
convertFromBytes, convertToBytes, readObject, writeObject
 
Methods inherited from interface gov.sandia.cognition.io.serialization.FileSerializationHandler
readFromFile, readFromFile, writeToFile, writeToFile
 

Method Detail

writeObject

void writeObject(Writer writer,
                 SerializedType object)
                 throws IOException
Writes an object to the given writer.

Parameters:
writer - Writer to write the object to.
object - The object to write.
Throws:
IOException - If there is an i/o error.

readObject

Object readObject(Reader reader)
                  throws IOException,
                         ClassNotFoundException
Reads an object from the given reader.

Parameters:
reader - The reader to read an object from.
Returns:
The object read from the reader.
Throws:
IOException - If there is an i/o error.
ClassNotFoundException - If a class cannot be found.

convertToString

String convertToString(SerializedType object)
                       throws IOException
Converts a given object to its serialized string representation.

Parameters:
object - The object to serialized to a string.
Returns:
The serialized string version of the object.
Throws:
IOException - If there is an i/o error.

convertFromString

Object convertFromString(String string)
                         throws IOException,
                                ClassNotFoundException
Converts an object from its serialized string representation.

Parameters:
string - The string to convert an object from.
Returns:
The object deserialized from the string.
Throws:
IOException - If there is an i/o error.
ClassNotFoundException - If a class cannot be found.