com.comtrade.ecm.engine.exceptions

## Class EcmSimpleException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - com.comtrade.ecm.engine.exceptions.EcmException
      - - com.comtrade.ecm.engine.exceptions.EcmSimpleException

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    ActionException, AttributeDefinitionException, ConfigurationException, FileNotCreatedException, LoggingException, LoggingException, NonPermittedNullParameterException, PersistenceException, ServiceProviderDefinitionException, UnknownMimeTypeException, UnsupportedOperationException, ValidationException, XsdValidationException

      public class EcmSimpleException
      extends EcmException

  An exception that can be thrown from library method(s).
  All `EcmSimpleException`s have a collection of `EcmMessagePart`-objects, i.e., messages that COULD be localized (if said so).
  The aim is to enable an automated transformation from an EcmExtension to a "front-end message" (a message that can be presented to a user). At the moment when Exception gets propagated to a front-end, each part of a message (each `EcmMessagePart`) could be (if should be) localized and (then) concatened into a human-readable message.
  First `EcmMessagePart` in the list ALWAYS is a exception's class name.
  See Also:
    `EcmMessagePart`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EcmSimpleException()` Constructor that initializes list of exception's messages (which means setting exception's class name as the first part of a message).
    `EcmSimpleException(java.util.Collection<EcmMessagePart> messages)` Creates an exception with following submessages : - exception's class simple name - all the `EcmMessagePart`-objects transfered as a parameter
    `EcmSimpleException(EcmMessagePart... messages)` Creates an exception with following submessages : - exception's class simple name - all the `EcmMessagePart`-objects transfered as a parameter
    `EcmSimpleException(java.lang.Exception e)` Creates an exception with following submessages : - (potentionally localized) exception's class simple name - unlocalized exception's message

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addMessages(EcmMessagePart... messageParts)` Adds a collection of `EcmMessagePart`-objects
    `void` | `addMessages(java.lang.String... messageParts)` Adds a collection of `EcmMessagePart`-objects
    `void` | `clearMessages()` Clears a collection of submessages, then installs exception's class name as the first `EcmMessagePart`.
    `EcmMessage` | `getMessages()`
    `void` | `setMessages(EcmMessagePart... messageParts)` Sets a collection of `EcmMessagePart`-objects
    `void` | `setMessages(java.lang.String... messageParts)` Sets a collection of `EcmMessagePart`-objects
    `java.lang.String` | `toString()`
    `java.lang.String` | `toString(java.util.Locale locale)`
    `java.lang.String` | `toUnlocalizedString()`

    - ### 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

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

- - ### Constructor Detail

    - #### EcmSimpleException

          public EcmSimpleException()

      Constructor that initializes list of exception's messages (which means setting exception's class name as the first part of a message).

    - #### EcmSimpleException

          public EcmSimpleException(EcmMessagePart... messages)

      Creates an exception with following submessages :
      - exception's class simple name - all the `EcmMessagePart`-objects transfered as a parameter
      Parameters:
        `messages` - Collection of `EcmMessagePart`-objects that should be concatenated after an exception's class simple name
      See Also:
        `EcmMessagePart`

    - #### EcmSimpleException

          public EcmSimpleException(java.util.Collection<EcmMessagePart> messages)

      Creates an exception with following submessages :
      - exception's class simple name - all the `EcmMessagePart`-objects transfered as a parameter
      Parameters:
        `messages` - Collection of `EcmMessagePart`-objects that should be concatenated after an exception's class simple name
      See Also:
        `EcmMessagePart`

    - #### EcmSimpleException

          public EcmSimpleException(java.lang.Exception e)

      Creates an exception with following submessages :
      - (potentionally localized) exception's class simple name - unlocalized exception's message
      Parameters:
        `e` - An exception whose message we will inject into newly created `EcmException`

  - ### Method Detail

    - #### clearMessages

          public void clearMessages()

      Clears a collection of submessages, then installs exception's class name as the first `EcmMessagePart`.

    - #### setMessages

          public void setMessages(EcmMessagePart... messageParts)

      Sets a collection of `EcmMessagePart`-objects
      Parameters:
        `messageParts` - Parts of a message
      See Also:
        `EcmMessagePart`

    - #### setMessages

          public void setMessages(java.lang.String... messageParts)

      Sets a collection of `EcmMessagePart`-objects
      Parameters:
        `messageParts` - Parts of a message

    - #### addMessages

          public void addMessages(EcmMessagePart... messageParts)

      Adds a collection of `EcmMessagePart`-objects
      Parameters:
        `messageParts` - Parts of a message
      See Also:
        `EcmMessagePart`

    - #### addMessages

          public void addMessages(java.lang.String... messageParts)

      Adds a collection of `EcmMessagePart`-objects
      Parameters:
        `messageParts` - Parts of a message
      See Also:
        `EcmMessagePart`

    - #### getMessages

          public EcmMessage getMessages()

    - #### toUnlocalizedString

          public java.lang.String toUnlocalizedString()

    - #### toString

          public java.lang.String toString(java.util.Locale locale)

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Throwable`