org.appng.api

## Class ApplicationException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - org.appng.api.ApplicationException

- All Implemented Interfaces:
    Serializable, MessageParam

      public class ApplicationException
      extends RuntimeException
      implements MessageParam

  A `RuntimeException` to be used inside business logic. If one of the constructors is used that take a `messageKey`-argument, it's easy to create a user-friendly error message.
  Author:
    Matthias Müller
  See Also:
    `MessageParam`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ApplicationException(String exceptionMessage)`
    `ApplicationException(String exceptionMessage, String messageKey, Object... messageArgs)`
    `ApplicationException(String exceptionMessage, Throwable cause)`
    `ApplicationException(String exceptionMessage, Throwable cause, String messageKey, Object... messageArgs)`
    `ApplicationException(Throwable cause)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object[]` | `getMessageArgs()` Returns the arguments for this message in order to be used with `MessageFormat.format(String, Object...)`
    `String` | `getMessageKey()` Returns the key for the message in order to retrieve the real message from a `ResourceBundle`.

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

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, 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`

- - ### Constructor Detail

    - #### ApplicationException

          public ApplicationException(String exceptionMessage,
                                      String messageKey,
                                      Object... messageArgs)

    - #### ApplicationException

          public ApplicationException(String exceptionMessage,
                                      Throwable cause,
                                      String messageKey,
                                      Object... messageArgs)

    - #### ApplicationException

          public ApplicationException(String exceptionMessage)

    - #### ApplicationException

          public ApplicationException(String exceptionMessage,
                                      Throwable cause)

    - #### ApplicationException

          public ApplicationException(Throwable cause)

  - ### Method Detail

    - #### getMessageKey

          public String getMessageKey()

      Description copied from interface: `MessageParam`
      Returns the key for the message in order to retrieve the real message from a `ResourceBundle`.
      Specified by:
        `getMessageKey` in interface `MessageParam`
      Returns:
        the key for this message
      See Also:
        `ResourceBundle.getString(String)`

    - #### getMessageArgs

          public Object[] getMessageArgs()

      Description copied from interface: `MessageParam`
      Returns the arguments for this message in order to be used with `MessageFormat.format(String, Object...)`
      Specified by:
        `getMessageArgs` in interface `MessageParam`
      Returns:
        the arguments for the message

Copyright © 2011–2023 aiticon GmbH. All rights reserved.