Class CleanerModelLoader

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.io.ModelFileHandler, adams.core.LenientModeSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, adams.flow.core.FlowContextHandler, adams.flow.core.ModelLoaderSupporter, Serializable

    public class CleanerModelLoader
    extends adams.flow.core.AbstractModelLoader<AbstractCleaner>
    implements adams.core.LenientModeSupporter
    Model loader for AbstractCleaner objects.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class adams.flow.core.AbstractModelLoader

        adams.flow.core.AbstractModelLoader.ModelLoadingType
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean m_Lenient
      whether to be lenient.
      • Fields inherited from class adams.flow.core.AbstractModelLoader

        m_FlowContext, m_Helper, m_Model, m_ModelActor, m_ModelFile, m_ModelLoadingType, m_ModelStorage
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void defineOptions()
      Adds options to the internal list of options.
      protected Object deserializeFile​(adams.core.MessageCollection errors)
      Deserializes the model file.
      boolean getLenient()
      Returns whether lenient, ie first tries to load the object as SerializableObject and if that fails just deserializes it.
      protected AbstractCleaner getModelFromContainer​(adams.flow.container.AbstractContainer cont, adams.core.MessageCollection errors)
      Retrieves the model from the container.
      String globalInfo()
      Returns a string describing the object.
      String lenientTipText()
      Returns the tip text for this property.
      void setLenient​(boolean value)
      Sets whether lenient, ie first tries to load the object as SerializableObject and if that fails just deserializes it.
      • Methods inherited from class adams.flow.core.AbstractModelLoader

        automaticOrderInfo, getFlowContext, getModel, getModelActor, getModelFile, getModelLoadingType, getModelStorage, getQuickInfo, getQuickInfo, initialize, loadAutomatically, loadFromCallableActor, loadFromFile, loadFromStorage, modelActorTipText, modelFileTipText, modelLoadingTypeTipText, modelStorageTipText, reset, setFlowContext, setModelActor, setModelFile, setModelLoadingType, setModelStorage, unhandledContainer, unwrapModel
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, toCommandLine, toString
      • Methods inherited from class adams.core.logging.CustomLoggingLevelObject

        setLoggingLevel
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Field Detail

      • m_Lenient

        protected boolean m_Lenient
        whether to be lenient.
    • Constructor Detail

      • CleanerModelLoader

        public CleanerModelLoader()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.flow.core.AbstractModelLoader<AbstractCleaner>
      • setLenient

        public void setLenient​(boolean value)
        Sets whether lenient, ie first tries to load the object as SerializableObject and if that fails just deserializes it.
        Specified by:
        setLenient in interface adams.core.LenientModeSupporter
        Parameters:
        value - true if lenient
      • getLenient

        public boolean getLenient()
        Returns whether lenient, ie first tries to load the object as SerializableObject and if that fails just deserializes it.
        Specified by:
        getLenient in interface adams.core.LenientModeSupporter
        Returns:
        true if lenient
      • lenientTipText

        public String lenientTipText()
        Returns the tip text for this property.
        Specified by:
        lenientTipText in interface adams.core.LenientModeSupporter
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • deserializeFile

        protected Object deserializeFile​(adams.core.MessageCollection errors)
        Deserializes the model file.
        Overrides:
        deserializeFile in class adams.flow.core.AbstractModelLoader<AbstractCleaner>
        Parameters:
        errors - for collecting errors
        Returns:
        the object read from the file, null if failed
      • getModelFromContainer

        protected AbstractCleaner getModelFromContainer​(adams.flow.container.AbstractContainer cont,
                                                        adams.core.MessageCollection errors)
        Retrieves the model from the container.
        Specified by:
        getModelFromContainer in class adams.flow.core.AbstractModelLoader<AbstractCleaner>
        Parameters:
        cont - the container to get the model from
        errors - for collecting errors
        Returns:
        the model, null if not in container