de.caff.i18n

## Class ResourcedRuntimeException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - de.caff.i18n.ResourcedRuntimeException

- All Implemented Interfaces:
    ResourcedThrowable, java.io.Serializable

      public class ResourcedRuntimeException
      extends java.lang.RuntimeException
      implements ResourcedThrowable

  An internationalized runtime exception.
  Author:
    Rammi
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.Object[]` | `args` The arguments for the resource.
    `protected java.lang.String` | `resTag` The resource tag.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResourcedRuntimeException(java.lang.String tag)` Constructor for a simple I18n message.
    `ResourcedRuntimeException(java.lang.String tag, java.lang.Object... args)` Constructor for an I18n message with arguments.
    `ResourcedRuntimeException(java.lang.Throwable originalException, java.lang.String tag)` Constructor for a simple I18n message after receiving another exception.
    `ResourcedRuntimeException(java.lang.Throwable originalException, java.lang.String tag, java.lang.Object... args)` Constructor for a I18n message with arguments after receiving another exception.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getMessage()` Get the message with default locale.
    `java.lang.String` | `getMessage(java.util.Locale l)` Get the message for a locale.
    `java.lang.Throwable` | `getOriginalException()` Get the exception from where this resourced exception originated.
    `void` | `setOriginalException(java.lang.Throwable originalException)` Set the exception from where this resourced exception originated.

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

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

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

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

- - ### Field Detail

    - #### resTag

          @NotNull
          protected final java.lang.String resTag

      The resource tag.
      See Also:
        `I18n.getString(java.lang.String)`, `I18n.format(java.lang.String, java.lang.Object...)`

    - #### args

          protected java.lang.Object[] args

      The arguments for the resource.
      See Also:
        `I18n.format(java.lang.String, java.lang.Object...)`

  - ### Constructor Detail

    - #### ResourcedRuntimeException

          public ResourcedRuntimeException(@NotNull
                                           java.lang.String tag)

      Constructor for a simple I18n message.
      Parameters:
        `tag` - I18n resource tag of message
      See Also:
        `I18n.getString(String)`

    - #### ResourcedRuntimeException

          public ResourcedRuntimeException(@NotNull
                                           java.lang.String tag,
                                           java.lang.Object... args)

      Constructor for an I18n message with arguments.
      Parameters:
        `tag` - I18n resource tag for a message with arguments
        `args` - arguments
      See Also:
        `I18n.format(String, Object...)`

    - #### ResourcedRuntimeException

          public ResourcedRuntimeException(@NotNull
                                           java.lang.Throwable originalException,
                                           @NotNull
                                           java.lang.String tag)

      Constructor for a simple I18n message after receiving another exception.
      Parameters:
        `originalException` - wrapped exception
        `tag` - I18n resource tag for a message with arguments
      See Also:
        `I18n.getString(String)`

    - #### ResourcedRuntimeException

          public ResourcedRuntimeException(@NotNull
                                           java.lang.Throwable originalException,
                                           @NotNull
                                           java.lang.String tag,
                                           java.lang.Object... args)

      Constructor for a I18n message with arguments after receiving another exception.
      Parameters:
        `originalException` - wrapped exception
        `tag` - resource tag
        `args` - arguments
      See Also:
        `I18n.format(String, Object...)`

  - ### Method Detail

    - #### getMessage

          public java.lang.String getMessage()

      Get the message with default locale.
      Specified by:
        `getMessage` in interface `ResourcedThrowable`
      Overrides:
        `getMessage` in class `java.lang.Throwable`
      Returns:
        message

    - #### getMessage

          public java.lang.String getMessage(java.util.Locale l)

      Get the message for a locale.
      Specified by:
        `getMessage` in interface `ResourcedThrowable`
      Parameters:
        `l` - requested locale
      Returns:
        message for the given locale

    - #### getOriginalException

          public java.lang.Throwable getOriginalException()

      Get the exception from where this resourced exception originated.
      Specified by:
        `getOriginalException` in interface `ResourcedThrowable`
      Returns:
        original exception or `null` if there is no original exception

    - #### setOriginalException

          public final void setOriginalException(java.lang.Throwable originalException)

      Set the exception from where this resourced exception originated.
      Specified by:
        `setOriginalException` in interface `ResourcedThrowable`
      Parameters:
        `originalException` - original exception