com.h3c.util

## Class LocalizableException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - com.h3c.util.LocalizableException

- All Implemented Interfaces:
    Serializable

      public class LocalizableException
      extends Exception

  This exception allows for a message key to be associated with the exception, such that a localized error message can be presented to the user in the UI where appropriate.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LocalizableException()` Constructs an exception with no associated message key.
    `LocalizableException(String uiMessageKey)` Constructs an exception with the given message key.
    `LocalizableException(String uiMessageKey, String logMessage)` Constructs an exception with the given message key, and the given log message (internal).
    `LocalizableException(String uiMessageKey, String logMessage, Throwable cause)` Constructs an exception with the given message key, given log message (internal), and cause.
    `LocalizableException(String uiMessageKey, Throwable cause)` Constructs an exception with the given message key and cause.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getMessageKey()` Returns the message key associated with this exception (may be null).
    `String` | `toString()`

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

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### LocalizableException

          public LocalizableException()

      Constructs an exception with no associated message key.

    - #### LocalizableException

          public LocalizableException(String uiMessageKey)

      Constructs an exception with the given message key. The message key is intended for retrieving a localized message to present to the user in the UI.
      Parameters:
        `uiMessageKey` - the message key for an external UI message

    - #### LocalizableException

          public LocalizableException(String uiMessageKey,
                              String logMessage)

      Constructs an exception with the given message key, and the given log message (internal). The message key is intended for retrieving a localized message to present to the user in the UI. The log message is for internal logging.
      Parameters:
        `uiMessageKey` - the message key for an external UI message
        `logMessage` - the internal log message

    - #### LocalizableException

          public LocalizableException(String uiMessageKey,
                              String logMessage,
                              Throwable cause)

      Constructs an exception with the given message key, given log message (internal), and cause. The message key is intended for retrieving a localized message to present to the user in the UI. The log message is for internal logging.
      Parameters:
        `uiMessageKey` - the message key for an external UI message
        `logMessage` - the internal log message
        `cause` - the underlying exception that caused this exception

    - #### LocalizableException

          public LocalizableException(String uiMessageKey,
                              Throwable cause)

      Constructs an exception with the given message key and cause. The message key is intended for retrieving a localized message to present to the user in the UI.
      Parameters:
        `uiMessageKey` - the message key for an external UI message
        `cause` - the underlying exception that caused this exception

  - ### Method Detail

    - #### getMessageKey

          public String getMessageKey()

      Returns the message key associated with this exception (may be null).
      Returns:
        the message key

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Throwable`

Copyright © 2014. All Rights Reserved.