Class JLineInputReader

java.lang.Object
org.springframework.shell.jline.JLineInputReader
All Implemented Interfaces:
InputReader

public class JLineInputReader extends Object implements InputReader
Implementation of InputReader that reads input using JLine's LineReader.
Since:
4.0.0
Author:
Mahmoud Ben Hassine
  • Constructor Details

    • JLineInputReader

      public JLineInputReader(org.jline.reader.LineReader lineReader)
      Create a new JLineInputReader instance.
      Parameters:
      lineReader - the JLine line reader
  • Method Details

    • readInput

      public String readInput()
      Description copied from interface: InputReader
      Read a line of input from the user.
      Specified by:
      readInput in interface InputReader
      Returns:
      the input line
    • readInput

      public String readInput(String prompt)
      Description copied from interface: InputReader
      Read a line of input from the user with a prompt.
      Specified by:
      readInput in interface InputReader
      Parameters:
      prompt - the prompt to display to the user
      Returns:
      the input line
    • readPassword

      public char[] readPassword()
      Description copied from interface: InputReader
      Read a password from the user.
      Specified by:
      readPassword in interface InputReader
      Returns:
      the password as a character array
    • readPassword

      public char[] readPassword(String prompt)
      Description copied from interface: InputReader
      Read a password from the user with a prompt.
      Specified by:
      readPassword in interface InputReader
      Parameters:
      prompt - the prompt to display to the user
      Returns:
      the password as a character array