Class ConsoleInputProvider

java.lang.Object
org.springframework.shell.core.ConsoleInputProvider
All Implemented Interfaces:
InputProvider

public class ConsoleInputProvider extends Object implements InputProvider
Input provider based on the JVM's system Console.
Since:
4.0.0
Author:
Mahmoud Ben Hassine
  • Constructor Details

    • ConsoleInputProvider

      public ConsoleInputProvider()
      Create a new ConsoleInputProvider instance.
    • ConsoleInputProvider

      public ConsoleInputProvider(Console console)
      Create a new ConsoleInputProvider instance.
      Parameters:
      console - the system console
  • Method Details

    • readInput

      public @Nullable String readInput() throws Exception
      Description copied from interface: InputProvider
      Return text entered by user to invoke commands.
      Specified by:
      readInput in interface InputProvider
      Returns:
      user input line or null if end of input is reached
      Throws:
      Exception - on error
    • getConsole

      public Console getConsole()