Class AbstractConversion

    • Field Detail

      • m_Owner

        protected Object m_Owner
        the owner.
      • m_Input

        protected Object m_Input
        the input data.
      • m_Output

        protected Object m_Output
        the generated output.
      • m_Stopped

        protected boolean m_Stopped
        whether the conversion was stopped.
    • Constructor Detail

      • AbstractConversion

        public AbstractConversion()
    • Method Detail

      • setOwner

        public void setOwner​(Object value)
        Sets the owner of this conversion.
        Specified by:
        setOwner in interface Conversion
        Parameters:
        value - the owner
      • getOwner

        public Object getOwner()
        Returns the owner of this conversion.
        Specified by:
        getOwner in interface Conversion
        Returns:
        the owner, null if none set
      • getQuickInfo

        public String getQuickInfo()
        Returns a quick info about the object, which can be displayed in the GUI.

        Default implementation returns null.
        Specified by:
        getQuickInfo in interface QuickInfoSupporter
        Returns:
        null if no info available, otherwise short string
      • accepts

        public abstract Class accepts()
        Returns the class that is accepted as input.
        Specified by:
        accepts in interface Conversion
        Returns:
        the class
      • setInput

        public void setInput​(Object value)
        Sets the original data to convert. For converters implementing StreamConversion this only resets the m_Output variable, but not the whole converter like it does nor simple converters.
        Specified by:
        setInput in interface Conversion
        Parameters:
        value - the data to convert
        See Also:
        StreamConversion, m_Output
      • getInput

        public Object getInput()
        The currently set input data to convert.
        Specified by:
        getInput in interface Conversion
        Returns:
        the data to convert, can be null if not yet set
      • getInput

        public <T> T getInput​(Class<T> cls)
        The currently set input data to convert.
        Specified by:
        getInput in interface Conversion
        Parameters:
        cls - for casting
        Returns:
        the data to convert, can be null if not yet set
      • generates

        public abstract Class generates()
        Returns the class that is generated as output.
        Specified by:
        generates in interface Conversion
        Returns:
        the class
      • getOutput

        public Object getOutput()
        Returns the generated output.
        Specified by:
        getOutput in interface Conversion
        Returns:
        the output, null if none produced yet
      • getOutput

        public <T> T getOutput​(Class<T> cls)
        Returns the generated output.
        Specified by:
        getOutput in interface Conversion
        Parameters:
        cls - for casting
        Returns:
        the output, null if none produced yet
      • checkData

        protected String checkData()
        Checks whether the data can be processed.
        Returns:
        null if checks passed, otherwise error message
      • doConvert

        protected abstract Object doConvert()
                                     throws Exception
        Performs the actual conversion.
        Returns:
        the converted data
        Throws:
        Exception - if something goes wrong with the conversion
      • convert

        public String convert()
        Performs the conversion.
        Specified by:
        convert in interface Conversion
        Returns:
        null if everything worked otherwise the error message
      • cleanUp

        public void cleanUp()
        Cleans up data structures, frees up memory.
        Specified by:
        cleanUp in interface CleanUpHandler
      • stopExecution

        public void stopExecution()
        Stops the execution.
        Specified by:
        stopExecution in interface Stoppable