Interface SerializeMethod


  • public interface SerializeMethod
    The SerializeMethod is used to define a serialization strategy for a certain object type.
    Author:
    Thomas Morgner
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Class getObjectClass()
      The class of the object, which this object can serialize.
      java.lang.Object readObject​(java.io.ObjectInputStream in)
      Reads the object from the object input stream.
      void writeObject​(java.lang.Object o, java.io.ObjectOutputStream out)
      Writes a serializable object description to the given object output stream.
    • Method Detail

      • writeObject

        void writeObject​(java.lang.Object o,
                         java.io.ObjectOutputStream out)
                  throws java.io.IOException
        Writes a serializable object description to the given object output stream.
        Parameters:
        o - the to be serialized object.
        out - the outputstream that should receive the object.
        Throws:
        java.io.IOException - if an I/O error occured.
      • readObject

        java.lang.Object readObject​(java.io.ObjectInputStream in)
                             throws java.io.IOException,
                                    java.lang.ClassNotFoundException
        Reads the object from the object input stream.
        Parameters:
        in - the object input stream from where to read the serialized data.
        Returns:
        the generated object.
        Throws:
        java.io.IOException - if reading the stream failed.
        java.lang.ClassNotFoundException - if serialized object class cannot be found.
      • getObjectClass

        java.lang.Class getObjectClass()
        The class of the object, which this object can serialize.
        Returns:
        the class of the object type, which this method handles.