Class Serializer

  • All Implemented Interfaces:
    IO, Writer

    public class Serializer
    extends IOImpl
    implements Writer

    Serializer class.

    • Constructor Detail

      • Serializer

        public Serializer()
    • Method Detail

      • setFilename

        public void setFilename​(String filename)
        Each writer must be able to write a file to the local filesytem. The filename should be an absolute path.
        Specified by:
        setFilename in interface Writer
        Parameters:
        filename - The filename into which the object should be stored.
      • setOutputStream

        public void setOutputStream​(OutputStream output)
        Each writer must be able to store the object into an OutputStream.
        Specified by:
        setOutputStream in interface Writer
        Parameters:
        output - The OutputStream into that the object should be stored.
      • getName

        public String getName()
        Each io component must have a name that is used in IOFactory.newIO(String). The name must be unique thus it is usefull to use a short description or to the class name ( this.getClass().getName()).
        Specified by:
        getName in interface IO
        Returns:
        Returns the name of the io component.
      • isHandlerFor

        public boolean isHandlerFor​(Class value)
        Checks if the io component is capable to perform the operation for objects of this class.

        A typical implementation looks like:

         public boolean isHandlerFor(Class value) {
                if (DataObject.class.isAssignableFrom(value))
                        return true;
                return false;
         }
         
        Specified by:
        isHandlerFor in interface IO
        Parameters:
        value - The class that has to be checked.
        Returns:
        Results true if the class can oeprate with the given class.
      • copy

        public IO copy()
        overwritten copy-method from Object; use it to copy a complete operator
        Specified by:
        copy in interface IO
        Returns: