public class MException
extends java.lang.Exception
Constructor and Description |
---|
MException(ErrorCode error)
Constructs a new MException using the given error code.
|
MException(ErrorCode error,
java.lang.Object... parameters)
Constructs a new MException with the given error code and parameter substitution for the message.
|
MException(java.lang.Exception cause,
ErrorCode error)
Constructs a new MException with the cause and error msg.
|
MException(java.lang.Exception cause,
ErrorCode error,
java.lang.Object... parameters)
Constructs a new MException with the cause, using the error.
|
Modifier and Type | Method and Description |
---|---|
ErrorCode |
getErrorCode()
Gets the error code associated with this exception.
|
java.lang.String |
getMessage()
Gets the locale dependent message for this exception.
|
java.lang.String |
getMessage(java.util.Locale locale)
Gets the exception message in the given locale (if a translation is available).
|
java.lang.Object[] |
getParameters()
Gets the exception parameters.
|
java.lang.Object |
getSource()
Gets the source object that generated this exception.
|
boolean |
isError(ErrorCode error)
Compares the internal error code with the given error code and returns true if they are equal.
|
void |
setSource(java.lang.Object src)
Sets the source object that generated this exception.
|
public MException(ErrorCode error)
error
- error code for the exceptionpublic MException(ErrorCode error, java.lang.Object... parameters)
error
- the error codeparameters
- substitution parameters for the error messagepublic MException(java.lang.Exception cause, ErrorCode error)
cause
- the causeerror
- error codepublic MException(java.lang.Exception cause, ErrorCode error, java.lang.Object... parameters)
cause
- the causeerror
- error codeparameters
- substitution parameterspublic ErrorCode getErrorCode()
public java.lang.Object getSource()
public void setSource(java.lang.Object src)
src
- source of this exceptionpublic java.lang.Object[] getParameters()
public java.lang.String getMessage()
getMessage
in class java.lang.Throwable
public java.lang.String getMessage(java.util.Locale locale)
locale
- locale for the messagepublic boolean isError(ErrorCode error)
error
- error code