Package org.springframework.shell.core
Class ConsoleInputReader
java.lang.Object
org.springframework.shell.core.ConsoleInputReader
- All Implemented Interfaces:
InputReader
Implementation of
InputReader that reads input from the system console.- Since:
- 4.0.0
- Author:
- Mahmoud Ben Hassine
-
Constructor Summary
ConstructorsConstructorDescriptionConsoleInputReader(Console console) Create a newConsoleInputReaderinstance. -
Method Summary
Modifier and TypeMethodDescriptionRead a line of input from the user.Read a line of input from the user with a prompt.char[]Read a password from the user.char[]readPassword(String prompt) Read a password from the user with a prompt.
-
Constructor Details
-
ConsoleInputReader
Create a newConsoleInputReaderinstance.- Parameters:
console- the system console
-
-
Method Details
-
readInput
Description copied from interface:InputReaderRead a line of input from the user.- Specified by:
readInputin interfaceInputReader- Returns:
- the input line
-
readInput
Description copied from interface:InputReaderRead a line of input from the user with a prompt.- Specified by:
readInputin interfaceInputReader- Parameters:
prompt- the prompt to display to the user- Returns:
- the input line
-
readPassword
public char[] readPassword()Description copied from interface:InputReaderRead a password from the user.- Specified by:
readPasswordin interfaceInputReader- Returns:
- the password as a character array
-
readPassword
Description copied from interface:InputReaderRead a password from the user with a prompt.- Specified by:
readPasswordin interfaceInputReader- Parameters:
prompt- the prompt to display to the user- Returns:
- the password as a character array
-