Interface ConsoleWrapper

  • All Known Implementing Classes:
    JavaConsole

    public interface ConsoleWrapper
    Wrap the console commands
    Author:
    Flemming Harms
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void format​(String fmt, Object... args)
      Writes a formatted string to this console's output stream using the specified format string and arguments.
      boolean hasConsole()
      Check if the wrapper does have a console.
      void printf​(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.
      String readLine​(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

      • 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:
        IOError
        IllegalFormatException
      • hasConsole

        boolean hasConsole()
        Check if the wrapper does have a console.
        Returns:
        true if the wrapper does have a console.