Class JavaConsole
- java.lang.Object
-
- org.jboss.as.domain.management.security.adduser.JavaConsole
-
- All Implemented Interfaces:
ConsoleWrapper
public class JavaConsole extends Object implements ConsoleWrapper
Describe the purpose- Author:
- Flemming Harms
-
-
Constructor Summary
Constructors Constructor Description JavaConsole()
-
Method Summary
All Methods Instance Methods Concrete 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
public void format(String fmt, Object... args) throws IllegalFormatException
Description copied from interface:ConsoleWrapperWrites a formatted string to this console's output stream using the specified format string and arguments. see Format string syntax- Specified by:
formatin interfaceConsoleWrapper- Throws:
IllegalFormatException
-
printf
public void printf(String format, Object... args) throws IllegalFormatException
Description copied from interface:ConsoleWrapperA convenience method to write a formatted string to this console's output stream using the specified format string and arguments.- Specified by:
printfin interfaceConsoleWrapper- Throws:
IllegalFormatException
-
readLine
public String readLine(String fmt, Object... args) throws IOError
Description copied from interface:ConsoleWrapperProvides a formatted prompt, then reads a single line of text from the console.- Specified by:
readLinein interfaceConsoleWrapper- 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
public char[] readPassword(String fmt, Object... args) throws IllegalFormatException, IOError
Description copied from interface:ConsoleWrapperProvides a formatted prompt, then reads a password or passphrase from the console with echoing disabled.- Specified by:
readPasswordin interfaceConsoleWrapper- Returns:
- A character array containing the password or passphrase read from the console.
- Throws:
IOErrorIllegalFormatException
-
hasConsole
public boolean hasConsole()
Description copied from interface:ConsoleWrapperCheck if the wrapper does have a console.- Specified by:
hasConsolein interfaceConsoleWrapper- Returns:
- true if the wrapper does have a console.
-
-