public class BusinessException extends Exception implements MessageParam
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.MessageParam
,
Serialized FormConstructor 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) |
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 . |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public BusinessException(String exceptionMessage, String messageKey, Object... messageArgs)
public BusinessException(String exceptionMessage, Throwable cause, String messageKey, Object... messageArgs)
public BusinessException(String exceptionMessage)
public BusinessException(Throwable cause)
public String getMessageKey()
MessageParam
ResourceBundle
.getMessageKey
in interface MessageParam
ResourceBundle.getString(String)
public Object[] getMessageArgs()
MessageParam
MessageFormat.format(String, Object...)
getMessageArgs
in interface MessageParam
Copyright © 2011–2023 aiticon GmbH. All rights reserved.