Package 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
AnException
to be used inside business logic. If one of the constructors is used that take amessageKey
-argument, it's easy to create a user-friendly error message.- Author:
- Matthias Müller
- See Also:
MessageParam
, Serialized Form
-
-
Constructor Summary
Constructors Constructor 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 Description Object[]
getMessageArgs()
Returns the arguments for this message in order to be used withMessageFormat.format(String, Object...)
String
getMessageKey()
Returns the key for the message in order to retrieve the real message from aResourceBundle
.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
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(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 aResourceBundle
.- Specified by:
getMessageKey
in interfaceMessageParam
- 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 withMessageFormat.format(String, Object...)
- Specified by:
getMessageArgs
in interfaceMessageParam
- Returns:
- the arguments for the message
-
-