public class ApplicationException extends RuntimeException implements MessageParam
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.MessageParam
,
Serialized FormConstructor 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) |
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 ApplicationException(String exceptionMessage, String messageKey, Object... messageArgs)
public ApplicationException(String exceptionMessage, Throwable cause, String messageKey, Object... messageArgs)
public ApplicationException(String exceptionMessage)
public ApplicationException(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–2019 aiticon GmbH. All rights reserved.