public class StreamConsoleProvider extends Object
System.in and System.out.
The DeviceConsoleProvider should be preferred when System.console()
returns a non-null value.ConsoleProvider.Factory| Constructor and Description |
|---|
StreamConsoleProvider(InputStream in,
PrintStream out) |
| Modifier and Type | Method and Description |
|---|---|
protected IOException |
closed() |
void |
flush() |
void |
print(String text) |
void |
printErrorMessage(String errorMessage) |
void |
printErrorMessage(Throwable ex) |
void |
println() |
void |
println(String text) |
char |
readFirstChar(String prompt) |
String |
readLine() |
String |
readLine(String prompt) |
protected String |
readLineImpl() |
String |
readPassword(String prompt) |
boolean |
readYesNo(String prompt,
boolean defaultValue) |
protected void |
showPrompt(String prompt) |
public StreamConsoleProvider(InputStream in, PrintStream out)
protected String readLineImpl() throws IOException
IOExceptionpublic String readLine(String prompt) throws IOException
IOExceptionpublic String readPassword(String prompt) throws IOException
IOExceptionpublic void print(String text)
public void println()
public void println(String text)
public void flush()
protected IOException closed()
protected void showPrompt(String prompt)
public String readLine() throws IOException
readLine in interface ConsoleProviderIOExceptionpublic char readFirstChar(String prompt) throws IOException
readFirstChar in interface ConsoleProviderIOExceptionpublic boolean readYesNo(String prompt, boolean defaultValue) throws IOException
readYesNo in interface ConsoleProviderIOExceptionpublic void printErrorMessage(String errorMessage)
printErrorMessage in interface ConsoleProviderpublic void printErrorMessage(Throwable ex)
printErrorMessage in interface ConsoleProviderCopyright © 2002-2019 Atlassian. All Rights Reserved.