Package org.nuclos.api.exception
Class BusinessException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.nuclos.api.exception.BusinessException
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- PointerException
BusinessException is a general exception class for checked 
 exceptions in (user provided) business rules.
 
If a BusinessException is thrown from a (server) business rule, it is guaranteed that the exception message text is displayed to the nuclos client GUI user.
This class is used to display business process problems triggered by business rule execution to the client user.
- Author:
- Matthias Reichart
- See Also:
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedfor deserialization onlyBusinessException(boolean pTranslateAndRememberWithGeneratedKey, String pMessage) Creates a new BusinessException with a message.BusinessException(boolean pTranslateAndRememberWithGeneratedKey, String pMessage, Throwable pThrowable) Creates a new BusinessException with the specified message and cause.BusinessException(boolean pTranslateAndRememberWithGeneratedKey, String pMessage, Locale pSourceLocale) Creates a new BusinessException with the specified translation option for a specific locale.BusinessException(boolean pTranslateAndRememberWithGeneratedKey, String pMessage, Locale pSourceLocale, Throwable pThrowable) Creates a new BusinessException with the specified message, locale, and cause.BusinessException(boolean pTranslateAndRememberWithGeneratedKey, String pMessage, NuclosLocale pSourceLocale) Creates a new BusinessException with the specified translation option for a specific Nuclos locale.BusinessException(boolean pTranslateAndRememberWithGeneratedKey, String pMessage, NuclosLocale pSourceLocale, Throwable pThrowable) Creates a new BusinessException with the specified message, Nuclos locale, and cause.BusinessException(String pMessage) Creates a new BusinessException with a messageBusinessException(String pKey, String pMessage) Creates a new BusinessException with the specified localization key and message.BusinessException(String pKey, String pMessage, Locale pSourceLocale) Creates a new BusinessException with the specified localization key, message, and locale.BusinessException(String pKey, String pMessage, NuclosLocale pSourceLocale) Creates a new BusinessException with the specified localization key, message, and Nuclos locale.BusinessException(String pMessage, Throwable pThrowable) Constructor to initiate the new NuclosBusinessException with an object of type Throwable and an error messageBusinessException(Throwable pThrowable) Constructor to initiate the new NuclosBusinessException with an object of type ThrowableBusinessException(DoNotTranslate pMessage) Creates a new BusinessException with a message that is not translated.BusinessException(DoNotTranslate pMessage, Throwable pThrowable) Creates a new BusinessException with a message that is not translated and the specified cause.
- 
Method SummaryModifier and TypeMethodDescriptionstatic BusinessExceptiondoNotTranslate(String pMessage) Creates a new BusinessException with a message that is not translated.static BusinessExceptiondoNotTranslate(String pMessage, Throwable pThrowable) Creates a new BusinessException with a message that is not translated and the specified cause.protected static StringgetMessage(Throwable cause) This method returns the message that is used in the parameter cause of type ThrowableAdds message arguments to this exception that will be used for message formatting.Methods inherited from class java.lang.ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
- 
Constructor Details- 
BusinessExceptionprotected BusinessException()for deserialization only
- 
BusinessExceptionCreates a new BusinessException with a message- Parameters:
- pMessage-
 
- 
BusinessExceptionCreates a new BusinessException with a message that is not translated.- Parameters:
- pMessage- The error message that should not be translated
 
- 
BusinessExceptionCreates a new BusinessException with a message.- Parameters:
- pTranslateAndRememberWithGeneratedKey- If true, translate and remember with a generated key
- pMessage- The error message
 
- 
BusinessExceptionpublic BusinessException(boolean pTranslateAndRememberWithGeneratedKey, String pMessage, Locale pSourceLocale) Creates a new BusinessException with the specified translation option for a specific locale.- Parameters:
- pTranslateAndRememberWithGeneratedKey- If true, translate and remember with a generated key
- pMessage- The error message
- pSourceLocale- The locale of the text
 
- 
BusinessExceptionpublic BusinessException(boolean pTranslateAndRememberWithGeneratedKey, String pMessage, NuclosLocale pSourceLocale) Creates a new BusinessException with the specified translation option for a specific Nuclos locale.- Parameters:
- pTranslateAndRememberWithGeneratedKey- If true, translate and remember with a generated key
- pMessage- The error message
- pSourceLocale- The NuclosLocale of the text
 
- 
BusinessExceptionCreates a new BusinessException with the specified localization key and message.- Parameters:
- pKey- The localization key
- pMessage- The error message
 
- 
BusinessExceptionCreates a new BusinessException with the specified localization key, message, and locale.- Parameters:
- pKey- The localization key
- pMessage- The error message
- pSourceLocale- The locale of the text
 
- 
BusinessExceptionCreates a new BusinessException with the specified localization key, message, and Nuclos locale.- Parameters:
- pKey- The localization key
- pMessage- The error message
- pSourceLocale- The NuclosLocale of the text
 
- 
BusinessExceptionConstructor to initiate the new NuclosBusinessException with an object of type Throwable- Parameters:
- pThrowable-
 
- 
BusinessExceptionConstructor to initiate the new NuclosBusinessException with an object of type Throwable and an error message- Parameters:
- pThrowable-
 
- 
BusinessExceptionpublic BusinessException(boolean pTranslateAndRememberWithGeneratedKey, String pMessage, Throwable pThrowable) Creates a new BusinessException with the specified message and cause.- Parameters:
- pTranslateAndRememberWithGeneratedKey- If true, translate and remember with a generated key
- pMessage- The error message
- pThrowable- The cause of this exception
 
- 
BusinessExceptionpublic BusinessException(boolean pTranslateAndRememberWithGeneratedKey, String pMessage, Locale pSourceLocale, Throwable pThrowable) Creates a new BusinessException with the specified message, locale, and cause.- Parameters:
- pTranslateAndRememberWithGeneratedKey- If true, translate and remember with a generated key
- pMessage- The error message
- pSourceLocale- The locale of the text
- pThrowable- The cause of this exception
 
- 
BusinessExceptionpublic BusinessException(boolean pTranslateAndRememberWithGeneratedKey, String pMessage, NuclosLocale pSourceLocale, Throwable pThrowable) Creates a new BusinessException with the specified message, Nuclos locale, and cause.- Parameters:
- pTranslateAndRememberWithGeneratedKey- If true, translate and remember with a generated key
- pMessage- The error message
- pSourceLocale- The NuclosLocale of the text
- pThrowable- The cause of this exception
 
- 
BusinessExceptionCreates a new BusinessException with a message that is not translated and the specified cause.- Parameters:
- pMessage- The error message that should not be translated
- pThrowable- The cause of this exception
 
 
- 
- 
Method Details- 
doNotTranslateCreates a new BusinessException with a message that is not translated.- Parameters:
- pMessage- The error message that should not be translated
- Returns:
- A new BusinessException instance with an untranslated message
 
- 
doNotTranslateCreates a new BusinessException with a message that is not translated and the specified cause.- Parameters:
- pMessage- The error message that should not be translated
- pThrowable- The cause of this exception
- Returns:
- A new BusinessException instance with an untranslated message and the specified cause
 
- 
getMessageThis method returns the message that is used in the parameter cause of type Throwable- Parameters:
- cause-
- Returns:
 
- 
withArgsAdds message arguments to this exception that will be used for message formatting.- Parameters:
- pArgs- The arguments to use when formatting the exception message
- Returns:
- This exception instance for method chaining
 
- 
getMessage- Overrides:
- getMessagein class- Throwable
 
 
-