Package com.xmlmind.util

## Class SimpleConsole

- java.lang.Object
- - com.xmlmind.util.SimpleConsole

- All Implemented Interfaces:
    `Console`

      public final class SimpleConsole
      extends Object
      implements Console

  An implementation of Console which prints its messages to `System.err` and `System.out`.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.xmlmind.util.Console

      `Console.MessageType`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static SimpleConsole` | `INSTANCE` | A ready-to-use instance of `SimpleConsole`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SimpleConsole()` | Equivalent to `this(null, true, MessageType.INFO)`.
    `SimpleConsole​(String prefix, boolean showMessageType, Console.MessageType errorLevel)` | Constructs a `SimpleConsole`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Console.MessageType` | `getErrorLevel()` | Returns the least severe message type displayed by this console.
    `String` | `getPrefix()` | Returns the prefix to be added to the messages displayed by this console; may return `null`.
    `boolean` | `isShowingMessageType()` | Returns `true` if the type of the message should be used to prefix the messages displayed by this console; `false` otherwise.
    `void` | `setErrorLevel​(Console.MessageType level)` | Specifies the least severe message type displayed by this console.
    `void` | `setPrefix​(String prefix)` | Specifies the prefix to be added to the messages displayed by this console; may be `null`.
    `void` | `setShowingMessageType​(boolean show)` | Specifies whether the type of the message should be used to prefix the messages displayed by this console.
    `void` | `showMessage​(String message, Console.MessageType messageType)` | Show specified message to user.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### INSTANCE

          public static final SimpleConsole INSTANCE

      A ready-to-use instance of `SimpleConsole`

  - ### Constructor Detail

    - #### SimpleConsole

          public SimpleConsole()

      Equivalent to `this(null, true, MessageType.INFO)`.

    - #### SimpleConsole

          public SimpleConsole​(String prefix,
                               boolean showMessageType,
                               Console.MessageType errorLevel)

      Constructs a `SimpleConsole`.
      Parameters:
        `prefix` - prefix to be added to the messages displayed by this console; may be `null`
        `showMessageType` - specifies whether the type of the message should be used to prefix the messages displayed by this console
        `errorLevel` - specifies the least severe message type displayed by this console

  - ### Method Detail

    - #### setPrefix

          public void setPrefix​(String prefix)

      Specifies the prefix to be added to the messages displayed by this console; may be `null`.

    - #### getPrefix

          public String getPrefix()

      Returns the prefix to be added to the messages displayed by this console; may return `null`.

    - #### setShowingMessageType

          public void setShowingMessageType​(boolean show)

      Specifies whether the type of the message should be used to prefix the messages displayed by this console.

    - #### isShowingMessageType

          public boolean isShowingMessageType()

      Returns `true` if the type of the message should be used to prefix the messages displayed by this console; `false` otherwise.

    - #### setErrorLevel

          public void setErrorLevel​(Console.MessageType level)

      Specifies the least severe message type displayed by this console.

    - #### getErrorLevel

          public Console.MessageType getErrorLevel()

      Returns the least severe message type displayed by this console.

    - #### showMessage

          public void showMessage​(String message,
                                  Console.MessageType messageType)

      Description copied from interface: `Console`
      Show specified message to user.
      Specified by:
        `showMessage` in interface `Console`
      Parameters:
        `message` - a possibly multi-line message
        `messageType` - type of message: `Console.MessageType.INFO`, `Console.MessageType.WARNING`, `Console.MessageType.ERROR` or `Console.MessageType.DEBUG`.