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
IOException
public String readLine(String prompt) throws IOException
IOException
public String readPassword(String prompt) throws IOException
IOException
public 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 ConsoleProvider
IOException
public char readFirstChar(String prompt) throws IOException
readFirstChar
in interface ConsoleProvider
IOException
public boolean readYesNo(String prompt, boolean defaultValue) throws IOException
readYesNo
in interface ConsoleProvider
IOException
public void printErrorMessage(String errorMessage)
printErrorMessage
in interface ConsoleProvider
public void printErrorMessage(Throwable ex)
printErrorMessage
in interface ConsoleProvider
Copyright © 2002-2022 Atlassian. All Rights Reserved.