Class InteractiveShellRunner

java.lang.Object
org.springframework.shell.core.InteractiveShellRunner
All Implemented Interfaces:
ShellRunner
Direct Known Subclasses:
JLineShellRunner, SystemShellRunner

public abstract class InteractiveShellRunner extends Object implements ShellRunner
Base class for interactive shell runners. Implementations must provide concrete methods to print messages and flush the output.
Since:
4.0.0
Author:
Mahmoud Ben Hassine
  • Constructor Details

    • InteractiveShellRunner

      public InteractiveShellRunner(InputProvider inputProvider, CommandParser commandParser, CommandRegistry commandRegistry)
      Create a new InteractiveShellRunner instance.
      Parameters:
      inputProvider - the input provider
      commandParser - the command parser
      commandRegistry - the command registry
  • Method Details

    • run

      public void run(String[] args) throws Exception
      Description copied from interface: ShellRunner
      Execute ShellRunner with given args.
      Specified by:
      run in interface ShellRunner
      Parameters:
      args - the raw arguments
      Throws:
      Exception - possible error during run
    • print

      public abstract void print(String message)
      Print a message to the output.
      Parameters:
      message - the message to print
    • flush

      public abstract void flush()
      Flush the output.
    • getWriter

      public abstract PrintWriter getWriter()
      Get the writer to the output.
      Returns:
      the print writer