|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface NlsThrowable
This is the interface for exceptions and runtime exceptions with real
native language support (NLS).
In extension to a regular throwable it brings enhanced
native language support (NLS). In a server environment there can be multiple
users active at a time with different locales.
This approach aims to simplify the NLS when creating throwables with error
messages. It has the following principles:
NlsTemplateResolver.
NlsMessage,
NlsException,
NlsRuntimeException| Field Summary |
|---|
| Fields inherited from interface net.sf.mmm.util.nls.api.NlsObject |
|---|
KEY_ANNOTATION, KEY_ARGUMENT, KEY_CAPACITY, KEY_DEFAULT, KEY_DIRECTORY, KEY_ERROR, KEY_FILE, KEY_FUNCTION, KEY_ID, KEY_KEY, KEY_LOCATION, KEY_MAX, KEY_MIN, KEY_MODE, KEY_NAME, KEY_OBJECT, KEY_OPERAND, KEY_OPERATION, KEY_OPTION, KEY_PATH, KEY_PROPERTY, KEY_QUERY, KEY_RESOURCE, KEY_SIZE, KEY_SOURCE, KEY_TARGET_TYPE, KEY_TITLE, KEY_TYPE, KEY_URI, KEY_VALUE |
| Method Summary | |
|---|---|
Throwable |
getCause()
|
String |
getLocalizedMessage(Locale locale)
This method gets the localized message as string. |
String |
getLocalizedMessage(Locale locale,
NlsTemplateResolver resolver)
This method gets the localized message as string. |
void |
getLocalizedMessage(Locale locale,
NlsTemplateResolver resolver,
Appendable buffer)
This method writes the localized message to the given string buffer. |
String |
getMessage()
|
NlsMessage |
getNlsMessage()
This method gets the NlsMessage describing the problem. |
StackTraceElement[] |
getStackTrace()
|
UUID |
getUuid()
This method gets the UUID of this exception. |
void |
printStackTrace(Locale locale,
Appendable buffer)
This method prints the stack trace with localized exception message(s). |
void |
printStackTrace(Locale locale,
NlsTemplateResolver resolver,
Appendable buffer)
This method prints the stack trace with localized exception message(s). |
| Methods inherited from interface net.sf.mmm.util.nls.api.NlsObject |
|---|
toNlsMessage |
| Method Detail |
|---|
Throwable getCause()
cause.String getMessage()
message.NlsMessage getNlsMessage()
NlsMessage describing the problem.
NlsMessage.String getLocalizedMessage(Locale locale)
locale - is the locale to translate to.
getLocalizedMessage(Locale, NlsTemplateResolver, Appendable)
String getLocalizedMessage(Locale locale,
NlsTemplateResolver resolver)
locale - is the locale to translate to.resolver - is used to resolve the template in order to translate the
original i18n message.
getLocalizedMessage(Locale, NlsTemplateResolver, Appendable)
void getLocalizedMessage(Locale locale,
NlsTemplateResolver resolver,
Appendable buffer)
throws IllegalStateException
locale - is the locale to translate to.resolver - is used to resolve the template required to translate the
internationalized message.buffer - is the buffer where to write the message to.
IllegalStateException - if the given buffer produced an
IOException.NlsMessage.getLocalizedMessage(Locale,
NlsTemplateResolver, Appendable)
void printStackTrace(Locale locale,
Appendable buffer)
throws IllegalStateException
locale - is the locale to translate to.buffer - is where to write the stack trace to.
IllegalStateException - if the given buffer produced an
IOException.
void printStackTrace(Locale locale,
NlsTemplateResolver resolver,
Appendable buffer)
throws IllegalStateException
locale - is the locale to translate to.resolver - translates the original message.buffer - is where to write the stack trace to.
IllegalStateException - if the given buffer produced an
IOException.StackTraceElement[] getStackTrace()
stack-trace.UUID getUuid()
UUID of this exception. The UUID is created
when the exception is constructed or copied from the given
cause if it is also a NlsThrowable.UUID will appear in the
printed
stacktrace but NOT in the message and should
therefore be written to log-files if the NlsThrowable is logged. If
you supply the UUID to the end-user in case of an unexpected error,
he can easily find the stacktrace in the log-files.
UUID of this exception. It may be null if
this feature is turned of (it is turned on by default).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||