Interface PromptProvider
-
- All Known Implementing Classes:
ConsolePrompt,StdIOPrompt,StreamPrompt
public interface PromptProviderA provider of prompting
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.io.PrintWritergetPromptWriter()Gets the writer to which prompts should be writtenintreadKey()Reads a single key from the prompts sourcejava.lang.StringreadLine()Reads a line from the prompts sourcechar[]readSecureLine()Reads a line from the prompts source in a secure mannerbooleansupportsSecureReads()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
nullif 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
nullif unable to read a line)
-
supportsSecureReads
boolean supportsSecureReads()
Whether the provider supports secured reads- Returns:
- True if supported, false otherwise
-
-