Interface PromptProvider
-
- All Known Implementing Classes:
ConsolePrompt
,StdIOPrompt
,StreamPrompt
public interface PromptProvider
A provider of prompting
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.io.PrintWriter
getPromptWriter()
Gets the writer to which prompts should be writtenint
readKey()
Reads a single key from the prompts sourcejava.lang.String
readLine()
Reads a line from the prompts sourcechar[]
readSecureLine()
Reads a line from the prompts source in a secure mannerboolean
supportsSecureReads()
Whether the provider supports secured reads
-
-
-
Method Detail
-
getPromptWriter
java.io.PrintWriter getPromptWriter()
Gets the writer to which prompts should be written- Returns:
- Prompt writer
-
readLine
java.lang.String readLine()
Reads a line from the prompts source- Returns:
- Line (or
null
if unable to read a line)
-
readKey
int readKey()
Reads a single key from the prompts source- Returns:
- Key code (or -1 if unable to read a key)
-
readSecureLine
char[] readSecureLine()
Reads a line from the prompts source in a secure manner- Returns:
- Line (or
null
if unable to read a line)
-
supportsSecureReads
boolean supportsSecureReads()
Whether the provider supports secured reads- Returns:
- True if supported, false otherwise
-
-