org.appng.api

## Class BusinessException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - org.appng.api.BusinessException

- All Implemented Interfaces:
    Serializable, MessageParam
  Direct Known Subclasses:
    NoSuchRepositoryException, NoSuchSiteException

      public class BusinessException
      extends Exception
      implements MessageParam

  An `Exception` 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
    `BusinessException(String exceptionMessage)`
    `BusinessException(String exceptionMessage, String messageKey, Object... messageArgs)`
    `BusinessException(String exceptionMessage, Throwable cause)`
    `BusinessException(String exceptionMessage, Throwable cause, String messageKey, Object... messageArgs)`
    `BusinessException(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

    - #### BusinessException

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

    - #### BusinessException

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

    - #### BusinessException

          public BusinessException(String exceptionMessage)

    - #### BusinessException

          public BusinessException(String exceptionMessage,
                                   Throwable cause)

    - #### BusinessException

          public BusinessException(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.