|
||||||||||
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 java.lang.RuntimeException de.smartics.exceptions.AbstractCoreRuntimeException de.smartics.exceptions.i18n.AbstractLocalizedRuntimeException
public abstract class AbstractLocalizedRuntimeException
The base implementation of exceptions that support internationalization for unchecked exceptions.
Field Summary | |
---|---|
protected LocalizedInfo |
localizedInfo The localized information controls the localization information. |
Fields inherited from class de.smartics.exceptions.AbstractCoreRuntimeException |
---|
info |
Constructor Summary | |
---|---|
protected |
AbstractLocalizedRuntimeException(Code code) Constructor. |
protected |
AbstractLocalizedRuntimeException(Code code, String bundleBaseName) Constructor. |
protected |
AbstractLocalizedRuntimeException(Throwable cause, Code code) Constructor. |
protected |
AbstractLocalizedRuntimeException(Throwable cause, Code code, String bundleBaseName) Constructor. |
protected |
AbstractLocalizedRuntimeException(Throwable cause, Code code, String bundleBaseName, String resourceKey) Constructor. |
Method Summary | |
---|---|
Messages |
createMessages() Returns a created messages instance. |
Messages |
createMessages(Locale locale) Returns a created messages instance. |
String |
getBundleBaseName() Returns the fully qualified base name of the bundle to use. |
CauseTrailMessages |
getCauseTrail() Returns the cause trail of messages. |
CauseTrailMessages |
getCauseTrail(Locale locale) Returns the cause trail of messages. |
String |
getLocalizedMessage() Returns the localized message according to the system's default 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 |
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) Returns the message for the given message type and the system's default locale. |
String |
getMessages() Returns the messages in one string. |
String |
getMessages(Locale locale) Returns the messages in one string. |
String |
getResourceKey() Returns the localization key to fetch messages from message bundles. |
String |
toString() Returns the string representation of the exception. |
Methods inherited from class de.smartics.exceptions.AbstractCoreRuntimeException |
---|
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 LocalizedInfo localizedInfo
Constructor Detail |
---|
protected AbstractLocalizedRuntimeException(Code code)
code
- the error or exception code of the exception.
AbstractLocalizedRuntimeException(Throwable,Code)
protected AbstractLocalizedRuntimeException(Code code, String bundleBaseName)
code
- the error or exception code of the exception.
bundleBaseName
- the fully qualified name of the bundle to use.
AbstractLocalizedRuntimeException(Throwable,Code,String)
protected AbstractLocalizedRuntimeException(Throwable cause, Code code)
cause
- the cause (which is saved for later retrieval by the
AbstractCoreRuntimeException.getCause()
method). (A
null value is permitted, and indicates that the cause is nonexistent or unknown.)
code
- the error or exception code of the exception.
AbstractLocalizedRuntimeException(Throwable,Code,String)
protected AbstractLocalizedRuntimeException(Throwable cause, Code code, String bundleBaseName)
cause
- the cause (which is saved for later retrieval by the
AbstractCoreRuntimeException.getCause()
method). (A
null value is permitted, and indicates that the cause is nonexistent or unknown.)
code
- the error or exception code of the exception.
bundleBaseName
- the fully qualified name of the bundle to use.
AbstractLocalizedRuntimeException(Throwable,Code,String,String)
protected AbstractLocalizedRuntimeException(Throwable cause, Code code, String bundleBaseName, String resourceKey)
cause
- the cause (which is saved for later retrieval by the
AbstractCoreRuntimeException.getCause()
method). (A
null value is permitted, and indicates that the cause is nonexistent or unknown.)
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.
AbstractCoreRuntimeException.AbstractCoreRuntimeException(String, Throwable, Code)
Method Detail |
---|
public final String getResourceKey()
String
representation of the
AbstractCoreRuntimeException.getCode()
instance is used.
public final String getBundleBaseName()
public final String getMessage(MessageType messageType)
getMessage
in interface
LocalizedException
messageType
- the type if message to return.
public final String getMessage()
Returns the localized message for the default locale.
getMessage
in interface
CoreException
getMessage
in class
Throwable
Throwable.getMessage()
public final String getMessage(Locale locale, MessageType messageType)
getMessage
in interface
LocalizedException
locale
- the locale to select the localized message.
messageType
- the type if message to return.
public final String getLocalizedMessage()
Creates a localized description of this throwable. Subclasses may override this method in order to produce a locale-specific message. For subclasses that do not override this method, the default implementation returns the same result as getMessage()
.
getLocalizedMessage
in interface
CoreException
getLocalizedMessage
in class
Throwable
public final String getLocalizedMessage(Locale locale)
locale
- the locale for which the message is requested.
public final String getLocalizedMessage(Locale locale, ClassLoader loader)
locale
- the locale for which the message is requested.
loader
- the loader to read the message bundle.
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 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 de.smartics.exceptions.ExceptionContext
.
toString
in class
AbstractCoreRuntimeException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |