Class AbstractModelLoader<T>

    • Constructor Detail

      • AbstractModelLoader

        public AbstractModelLoader()
    • Method Detail

      • getFlowContext

        public Actor getFlowContext()
        Returns the flow context, if any.
        Specified by:
        getFlowContext in interface FlowContextHandler
        Returns:
        the actor, null if none available
      • modelLoadingTypeTipText

        public String modelLoadingTypeTipText()
        Returns the tip text for this property.
        Specified by:
        modelLoadingTypeTipText in interface ModelLoaderSupporter
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • modelActorTipText

        public String modelActorTipText()
        Returns the tip text for this property.
        Specified by:
        modelActorTipText in interface ModelLoaderSupporter
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • modelStorageTipText

        public String modelStorageTipText()
        Returns the tip text for this property.
        Specified by:
        modelStorageTipText in interface ModelLoaderSupporter
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • unhandledContainer

        protected void unhandledContainer​(AbstractContainer cont,
                                          MessageCollection errors)
        Adds an "unhandled container type" error message.
        Parameters:
        cont - the unhandled container type
        errors - the errors to update
      • getModelFromContainer

        protected abstract T getModelFromContainer​(AbstractContainer cont,
                                                   MessageCollection errors)
        Retrieves the model from the container.
        Parameters:
        cont - the container to get the model from
        errors - for collecting errors
        Returns:
        the model, null if not in container
      • unwrapModel

        protected T unwrapModel​(Object obj,
                                MessageCollection errors)
        Unwraps the model if necessary.
        Parameters:
        obj - the model to process
        errors - for collecting errors
        Returns:
        the unwrapped model, null if failed or input was null
      • deserializeFile

        protected Object deserializeFile​(MessageCollection errors)
        Deserializes the model file.
        Parameters:
        errors - for collecting errors
        Returns:
        the object read from the file, null if failed
      • loadFromFile

        protected T loadFromFile​(MessageCollection errors)
        Loads the model from the specified file.
        Parameters:
        errors - for collecting errors
        Returns:
        the model, null if failed to load
      • loadFromCallableActor

        protected T loadFromCallableActor​(MessageCollection errors)
        Loads the model from the callable actor.
        Parameters:
        errors - for collecting errors
        Returns:
        the model, null if failed to load
      • loadFromStorage

        protected T loadFromStorage​(MessageCollection errors)
        Loads the model from the storage item.
        Parameters:
        errors - for collecting errors
        Returns:
        the model, null if failed to load
      • loadAutomatically

        protected T loadAutomatically​(MessageCollection errors)
        Loads the model automatically from file/callable actor/storage.
        Parameters:
        errors - for collecting errors
        Returns:
        the model, null if failed
      • getModel

        public T getModel​(MessageCollection errors)
        Obtains the model, loads it if necessary.
        Parameters:
        errors - for collecting errors
        Returns:
        the model, null if failed to load
      • getQuickInfo

        public String getQuickInfo​(OptionHandler handler)
        Generates the quick info string.
        Parameters:
        handler - the ModelLoaderSupporter to generate the quick info for
        Returns:
        the generated quick info
      • getQuickInfo

        public String getQuickInfo​(OptionHandler handler,
                                   String current)
        Generates the quick info string.
        Parameters:
        handler - the ModelLoaderSupporter to generate the quick info for
        current - the current info string, can be empty/null
        Returns:
        the generated quick info