Interface ConsoleWrapper
-
- All Known Implementing Classes:
JavaConsole
public interface ConsoleWrapperWrap the console commands- Author:
- Flemming Harms
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidformat(String fmt, Object... args)Writes a formatted string to this console's output stream using the specified format string and arguments.booleanhasConsole()Check if the wrapper does have a console.voidprintf(String format, Object... args)A convenience method to write a formatted string to this console's output stream using the specified format string and arguments.StringreadLine(String fmt, Object... args)Provides a formatted prompt, then reads a single line of text from the console.char[]readPassword(String fmt, Object... args)Provides a formatted prompt, then reads a password or passphrase from the console with echoing disabled.
-
-
-
Method Detail
-
format
void format(String fmt, Object... args) throws IllegalFormatException
Writes a formatted string to this console's output stream using the specified format string and arguments. see Format string syntax- Parameters:
fmt-args-- Throws:
IllegalFormatException
-
printf
void printf(String format, Object... args) throws IllegalFormatException
A convenience method to write a formatted string to this console's output stream using the specified format string and arguments.- Parameters:
format-args-- Throws:
IllegalStateExceptionIllegalFormatException
-
readLine
String readLine(String fmt, Object... args) throws IOError
Provides a formatted prompt, then reads a single line of text from the console.- Parameters:
fmt-args-- Returns:
- A string containing the line read from the console, not including any line-termination characters, or null if an end of stream has been reached.
- Throws:
IOError
-
readPassword
char[] readPassword(String fmt, Object... args) throws IllegalFormatException, IOError
Provides a formatted prompt, then reads a password or passphrase from the console with echoing disabled.- Parameters:
fmt-args-- Returns:
- A character array containing the password or passphrase read from the console.
- Throws:
IOErrorIllegalFormatException
-
hasConsole
boolean hasConsole()
Check if the wrapper does have a console.- Returns:
- true if the wrapper does have a console.
-
-