|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.exceptions.i18n.AbstractMessageBean
public abstract class AbstractMessageBean
The message information for a incidence.
Field Summary | |
---|---|
protected Code |
code The error or exception code of the exception. |
protected LocalizedInfo |
localizedInfo The localized information controls the localization information. |
Constructor Summary | |
---|---|
protected |
AbstractMessageBean(Code code) Convenience constructor to use if the defaults for bundleBaseName and resource key are used. |
protected |
AbstractMessageBean(Code code, String bundleBaseName) Constructor to control the bundle name. |
protected |
AbstractMessageBean(Code code, String bundleBaseName, String resourceKey) Default constructor to control the bundle name and resource key. |
protected |
AbstractMessageBean(Code code, Throwable cause) Convenience constructor to use if the defaults for bundleBaseName and resource key are used, with cause. |
protected |
AbstractMessageBean(Code code, Throwable cause, String bundleBaseName) Constructor to control the bundle name, with cause. |
protected |
AbstractMessageBean(Code code, Throwable cause, String bundleBaseName, String resourceKey) Default constructor to control the bundle name and resource key. |
Method Summary | |
---|---|
Throwable |
getCause() Returns the cause to the exception. |
CauseTrailMessages |
getCauseTrail() Returns the cause trail of messages. |
CauseTrailMessages |
getCauseTrail(Locale locale) Returns the cause trail of messages. |
Code |
getCode() Returns the error or exception code of the exception. |
LocalizedInfo |
getLocalizedInfo() Returns the localized information controls the localization information. |
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 localized message for the default locale. |
String |
getMessage(Locale locale, MessageType messageType) Returns the message for the given type. |
String |
getMessage(MessageType messageType) Calls AbstractLocalizedException.getMessage(java.util.Locale, de.smartics.exceptions.i18n.message.MessageType) with argument list (Locale.getDefault() , <messageType>). |
String |
getMessages() Creates the messages as a string, based on the default locale. |
Messages |
getMessages(Locale locale) Creates the messages with the given locale. |
String |
toString() Returns the string representation of the exception. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final Code code
protected final LocalizedInfo localizedInfo
Constructor Detail |
---|
protected AbstractMessageBean(Code code)
code
- the error or exception code of the exception.
protected AbstractMessageBean(Code code, Throwable cause)
code
- the error or exception code of the exception.
cause
- the cause to the problem.
protected AbstractMessageBean(Code code, String bundleBaseName)
code
- the error or exception code of the exception.
bundleBaseName
- the fully qualified name of the bundle to use.
protected AbstractMessageBean(Code code, Throwable cause, String bundleBaseName)
code
- the error or exception code of the exception.
cause
- the cause to the problem.
bundleBaseName
- the fully qualified name of the bundle to use.
protected AbstractMessageBean(Code code, String bundleBaseName, String resourceKey)
code
- the error or exception code of the exception.
bundleBaseName
- the fully qualified name of the bundle to use.
resourceKey
- the localization key to fetch messages from message bundles.
protected AbstractMessageBean(Code code, Throwable cause, String bundleBaseName, String resourceKey)
code
- the error or exception code of the exception.
cause
- the cause to the problem.
bundleBaseName
- the fully qualified name of the bundle to use.
resourceKey
- the localization key to fetch messages from message bundles.
Method Detail |
---|
public final Code getCode()
getCode
in interface
MessageBean
public final LocalizedInfo getLocalizedInfo()
getLocalizedInfo
in interface
MessageBean
public final String getMessage()
Returns the localized message for the default locale.
public final String getMessage(MessageType messageType)
AbstractLocalizedException.getMessage(java.util.Locale, de.smartics.exceptions.i18n.message.MessageType)
with argument list (
Locale.getDefault()
, <messageType>).
messageType
- the type of message to fetch.
AbstractLocalizedException.getMessage(java.util.Locale, de.smartics.exceptions.i18n.message.MessageType)
public final String getMessage(Locale locale, MessageType messageType)
MessageBean
getMessage
in interface
MessageBean
locale
- the locale to use.
messageType
- the type of message to retrieve.
null
if there is no message for the given type.
public final String getLocalizedMessage()
Calls getLocalizedMessage(java.util.Locale)
with argument list ( Locale.getDefault()
).
AbstractLocalizedException.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()
AbstractLocalizedException.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()
public final Messages getMessages(Locale locale)
getMessages
in interface
MessageBean
locale
- the locale to use.
public final CauseTrailMessages getCauseTrail()
MessageBean
getCauseTrail
in interface
MessageBean
public final CauseTrailMessages getCauseTrail(Locale locale)
MessageBean
getCauseTrail
in interface
MessageBean
locale
- the locale to use.
public Throwable getCause()
null
.
May be override to return a covariant type.
getCause
in interface
MessageBean
null
.
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 de.smartics.exceptions.ExceptionContext
.
toString
in class
Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |