|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception de.smartics.exceptions.AbstractCoreException de.smartics.exceptions.i18n.AbstractMessageException
public abstract class AbstractMessageException
The base implementation of exceptions that support internationalization for checked exceptions and whose message information is based on a message bean.
Field Summary | |
---|---|
protected MessageBean |
messageBean The message information for the exception. |
Fields inherited from class de.smartics.exceptions.AbstractCoreException |
---|
info |
Constructor Summary | |
---|---|
protected |
AbstractMessageException(MessageBean messageBean) Default constructor. |
Method Summary | |
---|---|
Messages |
createMessages() Returns a created messages instance. |
Messages |
createMessages(Locale locale) Returns a created messages instance. |
CauseTrailMessages |
getCauseTrail() Returns the cause trail of messages. |
CauseTrailMessages |
getCauseTrail(Locale locale) Returns the cause trail of messages. |
String |
getLocalizedMessage() Returns the localized message for the given locale. |
String |
getLocalizedMessage(Locale locale) Returns the localized message for the given locale. |
String |
getLocalizedMessage(Locale locale, ClassLoader loader) Returns the localized message for the given locale. |
String |
getLocalizedMessage(String keyPrefix, Locale locale, MessageType messageType, ClassLoader loader) Returns the localized message for the given locale. |
String |
getLocalizedTextMessage() Returns the localized message for the given locale as formatted multi-line text. |
String |
getLocalizedTextMessage(Locale locale) Returns the localized message for the given locale as formatted multi-line text. |
String |
getLocalizedTextMessage(Locale locale, ClassLoader loader) Returns the localized message for the given locale as formatted multi-line text. |
String |
getMessage() Returns the detail message string of this throwable. |
String |
getMessage(Locale locale, MessageType messageType) Returns the message for the given message type. |
String |
getMessage(MessageType messageType) Calls getMessage(java.util.Locale, de.smartics.exceptions.i18n.message.MessageType) with argument list (Locale.getDefault() , <messageType>). |
MessageBean |
getMessageBean() Returns the message information for the exception. |
String |
getMessages() Returns the messages in one string. |
String |
getMessages(Locale locale) Returns the messages in one string. |
String |
toString() Returns the string representation of the exception. |
Methods inherited from class de.smartics.exceptions.AbstractCoreException |
---|
getCause, getCode, getId, getTime, truncateCause |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.smartics.exceptions.CoreException |
---|
getCause, getCode, getId, getStackTrace, getTime, setStackTrace, truncateCause |
Field Detail |
---|
protected final MessageBean messageBean
Constructor Detail |
---|
protected AbstractMessageException(MessageBean messageBean)
messageBean
- the message information for the exception.
Method Detail |
---|
public MessageBean getMessageBean()
Allowed to be overridden to return covariant.
public final String getMessage()
Returns the localized message for the default locale.
getMessage
in interface
CoreException
getMessage
in class
Throwable
public final String getMessage(MessageType messageType)
getMessage(java.util.Locale, de.smartics.exceptions.i18n.message.MessageType)
with argument list (
Locale.getDefault()
, <messageType>).
getMessage
in interface
LocalizedException
messageType
- the type of message to fetch.
getMessage(java.util.Locale, de.smartics.exceptions.i18n.message.MessageType)
public final String getMessage(Locale locale, MessageType messageType)
LocalizedException
getMessage
in interface
LocalizedException
locale
- the locale to select the localized message.
messageType
- the type if message to return.
public final String getLocalizedMessage()
Calls getLocalizedMessage(java.util.Locale)
with argument list ( Locale.getDefault()
).
getLocalizedMessage
in interface
CoreException
getLocalizedMessage
in class
Throwable
getLocalizedMessage(java.util.Locale)
public final String getLocalizedMessage(Locale locale)
Calls getLocalizedMessage(java.util.Locale,ClassLoader)
with argument list (<locale>, null
).
locale
- locale the locale for which the message is requested.
getLocalizedMessage(java.util.Locale, ClassLoader)
public final String getLocalizedMessage(Locale locale, ClassLoader loader)
Calls getLocalizedMessage(String,java.util.Locale,de.smartics.exceptions.i18n.message.MessageType,java.lang.ClassLoader)
with argument list (null
, <locale>, MessageType.SUMMARY, <loader>).
locale
- locale the locale for which the message is requested.
loader
- loader the loader to read the message bundle.
getLocalizedMessage(String,java.util.Locale,de.smartics.exceptions.i18n.message.MessageType,java.lang.ClassLoader)
public final String getLocalizedMessage(String keyPrefix, Locale locale, MessageType messageType, ClassLoader loader)
keyPrefix
- the prefix of the key to load from the bundle.
locale
- the locale for which the message is requested.
messageType
- the type of message to localize.
loader
- the loader to read the message bundle.
public final String getLocalizedTextMessage()
getLocalizedMessage(java.util.Locale)
public final String getLocalizedTextMessage(Locale locale)
locale
- locale the locale for which the message is requested.
getLocalizedMessage(java.util.Locale, ClassLoader)
public final String getLocalizedTextMessage(Locale locale, ClassLoader loader)
locale
- locale the locale for which the message is requested.
loader
- loader the loader to read the message bundle.
getLocalizedMessage(String,java.util.Locale,de.smartics.exceptions.i18n.message.MessageType,java.lang.ClassLoader)
public final String getMessages()
LocalizedException
message types
for debugging.
Uses the default locale to access the messages.
getMessages
in interface
LocalizedException
types
of messages.
public final String getMessages(Locale locale)
LocalizedException
message types
for debugging.
getMessages
in interface
LocalizedException
locale
- the locale to use for the dump.
types
of messages.
public final Messages createMessages()
LocalizedException
Uses the default locale to access the messages.
createMessages
in interface
LocalizedException
types
.
public final Messages createMessages(Locale locale)
LocalizedException
createMessages
in interface
LocalizedException
locale
- the locale to use for the dump.
types
.
public final CauseTrailMessages getCauseTrail()
LocalizedException
getCauseTrail
in interface
LocalizedException
public final CauseTrailMessages getCauseTrail(Locale locale)
LocalizedException
getCauseTrail
in interface
LocalizedException
locale
- the locale to use for the dump.
public String toString()
May be overridden by subclasses in an application (not a library) to change the string representation. Usually an implementation of I18nCodeMessageFormatter
should be set to the ExceptionContext
.
toString
in class
AbstractCoreException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |