Interface StartupModel

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addException​(java.lang.Exception exception)
      Add an exception to the list of exceptions thrown when loading the model or performing the action.
      java.util.List<java.lang.Exception> getExceptions()
      Get the exceptions thrown by the startup model.
      java.lang.String getName()
      Return the name of of the model or its controlled object.
      boolean isValid()
      Test is model is a valid model.
      void performAction()
      Perform the startup action.
      void setName​(java.lang.String name)
      Set the name of the model.
    • Method Detail

      • getName

        @CheckForNull
        java.lang.String getName()
        Return the name of of the model or its controlled object.
        Returns:
        the name, an empty string, or null
      • setName

        void setName​(@CheckForNull
                     java.lang.String name)
        Set the name of the model.
        Parameters:
        name - the name, an empty string, or null
      • isValid

        boolean isValid()
        Test is model is a valid model. Invalid models will not be shown or saved by the Startup Actions Preferences panel.
        Returns:
        true if valid; false otherwise
      • performAction

        void performAction()
                    throws JmriException
        Perform the startup action.
        Throws:
        JmriException - if there is an exception thrown initializing the startup item; the original exception should be available as Throwable.getCause()
      • getExceptions

        @Nonnull
        java.util.List<java.lang.Exception> getExceptions()
        Get the exceptions thrown by the startup model.
        Returns:
        the list of exceptions thrown during startup in order or an empty list if no exceptions were thrown
      • addException

        void addException​(@Nonnull
                          java.lang.Exception exception)
        Add an exception to the list of exceptions thrown when loading the model or performing the action.
        Parameters:
        exception - the exception to retain with the model