Class AbstractObjectExporter

    • Field Detail

      • m_Exporters

        protected static String[] m_Exporters
        the exporters (classnames) currently available.
      • m_ExporterClasses

        protected static Class[] m_ExporterClasses
        the exporters (classes) currently available.
    • Constructor Detail

      • AbstractObjectExporter

        public AbstractObjectExporter()
    • Method Detail

      • initExporters

        protected static void initExporters()
        Initializes the exporters.
      • getExporters

        public static List<AbstractObjectExporter> getExporters​(Object obj)
        Returns a exporters for the specified object.
        Parameters:
        obj - the object to get a commandline exporter for
        Returns:
        the exporters
      • getExporters

        public static List<AbstractObjectExporter> getExporters​(Object obj,
                                                                Class[] excluded)
        Returns a exporters for the specified object.
        Parameters:
        obj - the object to get a commandline exporter for
        excluded - the exporters to exclude, ignored if null
        Returns:
        the exporters
      • getExporters

        public static List<AbstractObjectExporter> getExporters​(Class cls)
        Returns a exporters for the specified class.
        Parameters:
        cls - the class to get a commandline exporter for
        Returns:
        the exporters
      • getExporters

        public static List<AbstractObjectExporter> getExporters​(Class cls,
                                                                Class[] excluded)
        Returns a exporters for the specified class.
        Parameters:
        cls - the class to get a commandline exporter for
        excluded - the exporters to exclude, ignored if null
        Returns:
        the exporters
      • instantiate

        protected static List<AbstractObjectExporter> instantiate​(List<Class> exporters)
        Instantiates the exporters.
        Parameters:
        exporters - the exporters to instantiate
        Returns:
        the instances
      • 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!)
      • handles

        public abstract boolean handles​(Class cls)
        Checks whether the exporter can handle the specified class.
        Parameters:
        cls - the class to check
        Returns:
        true if the exporter can handle this type of object
      • doExport

        protected abstract String doExport​(Object obj,
                                           File file)
        Performs the actual export.
        Parameters:
        obj - the object to export
        file - the file to export to
        Returns:
        null if successful, otherwise error message
      • export

        public String export​(Object obj,
                             File file)
        Exports the object.
        Parameters:
        obj - the object to export
        file - the file to export to
        Returns:
        null if successful, otherwise error message
      • getExporters

        public static String[] getExporters()
        Returns a list with classnames of exporters.
        Returns:
        the exporter classnames