Class AbstractObjectReader

    • Constructor Detail

      • AbstractObjectReader

        public AbstractObjectReader()
    • Method Detail

      • getFormatDescription

        public abstract String getFormatDescription()
        Returns a string describing the format (used in the file chooser).
        Specified by:
        getFormatDescription in interface FileFormatHandler
        Returns:
        a description suitable for displaying in the file chooser
      • getFormatExtensions

        public abstract String[] getFormatExtensions()
        Returns the extension(s) of the format.
        Specified by:
        getFormatExtensions in interface FileFormatHandler
        Returns:
        the extension (without the dot!)
      • getCorrespondingWriter

        public abstract AbstractObjectWriter getCorrespondingWriter()
        Returns, if available, the corresponding writer.
        Returns:
        the writer, null if none available
      • isAvailable

        public boolean isAvailable()
        Returns whether the reader is actually available.
        Returns:
        true if available and ready to use
      • check

        protected void check​(PlaceholderFile file)
        Performs checks.
        Parameters:
        file - the image file to check
      • doRead

        protected abstract Object doRead​(PlaceholderFile file)
        Performs the actual reading of the object file.
        Parameters:
        file - the file to read
        Returns:
        the object, null if failed to read
      • read

        public Object read​(PlaceholderFile file)
        Reads the object file.
        Parameters:
        file - the file to read
        Returns:
        the object, null if failed to read
      • getReaders

        public static String[] getReaders()
        Returns a list with classnames of readers.
        Returns:
        the reader classnames