Package adams.console

Class AbstractConsoleApplication

    • Constructor Detail

      • AbstractConsoleApplication

        public AbstractConsoleApplication()
    • Method Detail

      • execute

        protected abstract String execute()
        Executes the application.
        Returns:
        null if successful, otherwise error message
      • forName

        public static AbstractConsoleApplication forName​(String classname,
                                                         String[] options)
        Instantiates the application with the given options.
        Parameters:
        classname - the classname of the application to instantiate
        options - the options for the application
        Returns:
        the instantiated application or null if an error occurred
      • forCommandLine

        public static AbstractConsoleApplication forCommandLine​(String cmdline)
        Instantiates the application from the given commandline (i.e., classname and optional options).
        Parameters:
        cmdline - the classname (and optional options) of the application to instantiate
        Returns:
        the instantiated application or null if an error occurred
      • runApplication

        public static void runApplication​(Class env,
                                          Class app,
                                          String[] options)
        Runs the application from the commandline. Calling code needs to perform a System.exit(0).
        Parameters:
        env - the environment class to use
        app - the application frame class
        options - the commandline options