public abstract class BaseRuntimeException extends RuntimeException implements IBaseException
BaseException class to a common
helper| Modifier and Type | Field and Description |
|---|---|
protected long |
code
Unique code of error.
|
protected String |
formatString
TODO: remove the variable, use the Exception get/setMessage() instead.
|
protected String |
messageKey |
| Constructor and Description |
|---|
BaseRuntimeException(BaseException exception) |
BaseRuntimeException(Exception exception) |
BaseRuntimeException(String message,
String key,
long code)
Constructs a BaseException with a default message format, a key to find a
localized message format, and a unique code to identify the exception.
|
BaseRuntimeException(String message,
Throwable cause,
String key,
long code)
Constructs a BaseException with a default message format, a key to find a
localized message format, and a unique code to identify the exception.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getCode() |
String |
getFormatString() |
String |
getLocalizedMessage()
Returns the translated message that describes the exception.
|
String |
getLocalizedMessage(ExceptionTranslator translator,
int indent)
Returns the translated message that
describes the exception with indentation.
|
String |
getLocalizedMessageStack()
Crosses the exceptions chained through cause
to conform the compound message in the corresponding language.
|
String |
getLocalizedMessageStack(ExceptionTranslator translator,
int indent)
Crosses the exceptions chained through cause
to conform the compound message in the corresponding language.
|
String |
getMessage()
Returns the message that describes the exception.
|
String |
getMessage(int indent)
Returns the message that describes the exception, with indentation.
|
String |
getMessageKey() |
String |
getMessageStack()
Crosses the exceptions chained through cause to conform
the message.
|
String |
getMessageStack(int indent)
Crosses the exceptions chained through cause to conform
the compound message with indentation.
|
Object |
getValue(String name) |
Iterator |
iterator() |
void |
setCode(long code)
Sets the exception's code.
|
void |
setFormatString(String formatString)
Sets the format string.
|
void |
setMessageKey(String messageKey)
Sets the property messageKey.
|
protected void |
setValue(String name,
Object value) |
String |
toString() |
protected Map |
values() |
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTraceprotected String messageKey
protected String formatString
protected long code
public BaseRuntimeException(BaseException exception)
public BaseRuntimeException(Exception exception)
public BaseRuntimeException(String message, String key, long code)
message - the default messageFormat to describe the exceptionkey - the key to use to search a localized messageFormnatacode - the unique code to identify the exceptionpublic BaseRuntimeException(String message, Throwable cause, String key, long code)
message - the default messageFormat to describe the exceptioncause - the original cause of the exceptionkey - the key to use to search a localized messageFormnatacode - the unique code to identify the exceptionpublic String getMessage()
IBaseExceptiongetMessage in interface IBaseExceptiongetMessage in class Throwablepublic String getMessage(int indent)
IBaseExceptiongetMessage in interface IBaseExceptionindent - Quantity of blanks to insert
at the start of the message.public String getLocalizedMessage()
IBaseExceptiongetLocalizedMessage in interface IBaseExceptiongetLocalizedMessage in class Throwablepublic String getLocalizedMessage(ExceptionTranslator translator, int indent)
IBaseExceptiongetLocalizedMessage in interface IBaseExceptiontranslator - Instance of a class that fulfills
the IExceptionTranslator interface.
His method "getText" takes charge returning
the expression, correspondent to the key that
delivers him, translated into the configured language.indent - Quantity of blanks to insert
at the start of the message.public String getMessageStack()
IBaseExceptiongetMessageStack in interface IBaseExceptionpublic String getMessageStack(int indent)
IBaseExceptiongetMessageStack in interface IBaseExceptionindent - Quantity of blanks to insert
at the start of the messages.public String getLocalizedMessageStack()
IBaseExceptiongetLocalizedMessageStack in interface IBaseExceptionpublic String getLocalizedMessageStack(ExceptionTranslator translator, int indent)
IBaseExceptiongetLocalizedMessageStack in interface IBaseExceptiontranslator - Instance of a class that fulfills
the IExceptionTranslator interface.
His method "getText" takes charge returning
the expression, correspondent to the key that
delivers him, translated into the configured language.indent - Quantity of blanks to insert
at the start of the messages.public long getCode()
getCode in interface IBaseExceptionpublic void setCode(long code)
public String getFormatString()
getFormatString in interface IBaseExceptionpublic void setFormatString(String formatString)
formatString - public String getMessageKey()
getMessageKey in interface IBaseExceptionpublic void setMessageKey(String messageKey)
messageKey - public Iterator iterator()
iterator in interface IBaseExceptionprotected Map values()
public Object getValue(String name)
getValue in interface IBaseException