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.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • modelFileTipText

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

        public void setModelActor​(CallableActorReference value)
        Sets the callable actor to obtain the model from.
        Parameters:
        value - the actor reference
      • getModelActor

        public CallableActorReference getModelActor()
        Returns the callable actor to obtain the model from.
        Returns:
        the actor reference
      • modelActorTipText

        public String modelActorTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setModelStorage

        public void setModelStorage​(StorageName value)
        Sets the storage item name to get the model from.
        Parameters:
        value - the storage name
      • getModelStorage

        public StorageName getModelStorage()
        Returns the storage item name to get the model from.
        Returns:
        the storage name
      • modelStorageTipText

        public String modelStorageTipText()
        Returns the tip text for this property.
        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