Package org.springframework.shell.core
Interface InputReader
- All Known Implementing Classes:
ConsoleInputReader,JLineInputReader
public interface InputReader
Interface for reading input from the user.
- Since:
- 4.0.0
- Author:
- Mahmoud Ben Hassine
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringRead a line of input from the user.default StringRead a line of input from the user with a prompt.default char[]Read a password from the user.default char[]readPassword(String prompt) Read a password from the user with a prompt.
-
Method Details
-
readInput
Read a line of input from the user.- Returns:
- the input line
- Throws:
Exception- if an error occurs while reading input
-
readInput
Read a line of input from the user with a prompt.- Parameters:
prompt- the prompt to display to the user- Returns:
- the input line
- Throws:
Exception- if an error occurs while reading input
-
readPassword
Read a password from the user.- Returns:
- the password as a character array
- Throws:
Exception- if an error occurs while reading the password
-
readPassword
Read a password from the user with a prompt.- Parameters:
prompt- the prompt to display to the user- Returns:
- the password as a character array
- Throws:
Exception- if an error occurs while reading the password
-