|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.exceptions.i18n.message.LocalizedInfo
public class LocalizedInfo
Controls the localized information for a throwable.
Field Summary | |
---|---|
static String |
BUNDLE_NAME_SUFFIX The suffix for the auto generated bundle name. |
protected String |
bundleBaseName The fully qualified base name of the bundle to use. |
protected Throwable |
cause The cause to the problem. |
protected String |
resourceKey The localization key to fetch messages from message bundles. |
Constructor Summary | |
---|---|
LocalizedInfo(Code code) Convenience constructor. |
|
LocalizedInfo(Code code, String bundleBaseName, String resourceKey) Convenience constructor without cause trail. |
|
LocalizedInfo(Code code, Throwable cause) Convenience constructor. |
|
LocalizedInfo(Code code, Throwable cause, String bundleBaseName, String resourceKey) Default constructor. |
Method Summary | |
---|---|
String |
createLocalizedMessage(Object bean, String keyPrefix, Locale locale, MessageType messageType, ClassLoader loader) Creates a localized message. |
String |
createMessage(Object bean, String keyPrefix, MessageType messageType, ClassLoader loader) Creates a message. |
String |
getBundleBaseName() Returns the fully qualified base name of the bundle to use. |
Throwable |
getCause() Returns the cause to the exception. |
CauseTrailMessages |
getCauseTrail() Returns the messages of the cause up to the root cause. |
CauseTrailMessages |
getCauseTrail(Locale locale) Returns the messages of the cause up to the root cause. |
String |
getLocalizedMessage(Object bean, Locale locale, ClassLoader loader) Returns the localized message for the given locale. |
String |
getLocalizedMessage(Object bean, String keyPrefix, Locale locale, MessageType messageType, ClassLoader loader) Returns the localized message for the given locale. |
String |
getLocalizedSingleLineMessage(Object bean, Locale locale, ClassLoader loader, boolean standard) Returns the localized message for the given locale. |
String |
getLocalizedTextMessage(Object bean, Locale locale, ClassLoader loader) Returns the structured and localized message for the given locale, returning each part of information that is provided. |
String |
getResourceKey() Returns the localization key to fetch messages from message bundles. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String BUNDLE_NAME_SUFFIX
The value of this constant is "Bundle".
"Bundle"
protected final String resourceKey
String
representation of the provided code instance is used.
protected final String bundleBaseName
This bundle base name must never be null
.
protected final Throwable cause
Constructor Detail |
---|
public LocalizedInfo(Code code)
code
- the error or exception code of the exception.
public LocalizedInfo(Code code, Throwable cause)
code
- the error or exception code of the exception.
cause
- the cause to the problem.
public LocalizedInfo(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.
public LocalizedInfo(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 String getResourceKey()
String
representation of the code instance is used.
public String getBundleBaseName()
public String getLocalizedMessage(Object bean, Locale locale, ClassLoader loader)
bean
- the throwable to construct the localized message.
locale
- the locale for which the message is requested.
loader
- the loader to read the message bundle.
public String getLocalizedSingleLineMessage(Object bean, Locale locale, ClassLoader loader, boolean standard)
bean
- the throwable to construct the localized message.
locale
- the locale for which the message is requested.
loader
- the loader to read the message bundle.
standard
- the flag that adds all information to the exception text (
true
) or only the summary (
false
).
public String getLocalizedTextMessage(Object bean, Locale locale, ClassLoader loader)
bean
- the throwable to construct the localized message.
locale
- the locale for which the message is requested.
loader
- the loader to read the message bundle.
public String getLocalizedMessage(Object bean, String keyPrefix, Locale locale, MessageType messageType, ClassLoader loader)
bean
- the throwable to construct the localized message.
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 String createLocalizedMessage(Object bean, String keyPrefix, Locale locale, MessageType messageType, ClassLoader loader)
bean
- the throwable to construct the localized message.
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 String createMessage(Object bean, String keyPrefix, MessageType messageType, ClassLoader loader)
bean
- the throwable to construct the localized message.
keyPrefix
- the prefix of the key to load from the bundle.
messageType
- the type of message to localize.
loader
- the loader to read the message bundle.
public final CauseTrailMessages getCauseTrail()
public final Throwable getCause()
null
.
null
.
public final CauseTrailMessages getCauseTrail(Locale locale)
locale
- the locale for which the message is requested.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |