|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
net.sf.mmm.util.nls.api.AbstractNlsException
public abstract class AbstractNlsException
This is an abstract base implementation of a checked exception with real
native language support (NLS).
ATTENTION:
Please prefer extending NlsException instead
of this class.
INFORMATION:
Checked exceptions should be used for business errors and should only occur
in unexpected situations.
NlsThrowable,
Serialized Form| Field Summary | |
|---|---|
private NlsMessage |
nlsMessage
the internationalized message |
private static long |
serialVersionUID
UID for serialization. |
private UUID |
uuid
|
| 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 |
| Constructor Summary | |
|---|---|
AbstractNlsException(NlsMessage message)
The constructor. |
|
AbstractNlsException(Throwable nested,
NlsMessage message)
The constructor. |
|
| Method Summary | |
|---|---|
protected UUID |
createUuid()
This method creates a new UUID. |
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. |
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). |
(package private) static void |
printStackTrace(NlsThrowable throwable,
Locale locale,
NlsTemplateResolver resolver,
Appendable buffer)
|
void |
printStackTrace(PrintStream s)
|
void |
printStackTrace(PrintWriter s)
|
NlsMessage |
toNlsMessage()
This method is the equivalent to Object.toString() with native
language support. |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.sf.mmm.util.nls.api.NlsThrowable |
|---|
getCause, getStackTrace |
| Field Detail |
|---|
private static final long serialVersionUID
private final NlsMessage nlsMessage
private final UUID uuid
getUuid()| Constructor Detail |
|---|
public AbstractNlsException(NlsMessage message)
message - the message describing the problem
briefly.
public AbstractNlsException(Throwable nested,
NlsMessage message)
nested - is the cause of this exception.message - the message describing the problem
briefly.| Method Detail |
|---|
protected UUID createUuid()
UUID.
UUID or null to turn this feature off.public final 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.
getUuid in interface NlsThrowableUUID of this exception. It may be null if
this feature is turned of (it is turned on by default).public final NlsMessage getNlsMessage()
NlsMessage describing the problem.
getNlsMessage in interface NlsThrowableNlsMessage.public void printStackTrace(PrintStream s)
printStackTrace in class Throwablepublic void printStackTrace(PrintWriter s)
printStackTrace in class Throwable
public void printStackTrace(Locale locale,
Appendable buffer)
printStackTrace in interface NlsThrowablelocale - is the locale to translate to.buffer - is where to write the stack trace to.
public void printStackTrace(Locale locale,
NlsTemplateResolver resolver,
Appendable buffer)
printStackTrace in interface NlsThrowablelocale - is the locale to translate to.resolver - translates the original message.buffer - is where to write the stack trace to.
static void printStackTrace(NlsThrowable throwable,
Locale locale,
NlsTemplateResolver resolver,
Appendable buffer)
throwable - is the throwable to print.locale - is the locale to translate to.resolver - translates the original message.buffer - is where to write the stack trace to.NlsThrowable.printStackTrace(Locale, NlsTemplateResolver, Appendable)public String getMessage()
getMessage in interface NlsThrowablegetMessage in class Throwablemessage.public String getLocalizedMessage(Locale locale)
getLocalizedMessage in interface NlsThrowablelocale - is the locale to translate to.
NlsThrowable.getLocalizedMessage(Locale, NlsTemplateResolver, Appendable)
public String getLocalizedMessage(Locale locale,
NlsTemplateResolver resolver)
getLocalizedMessage in interface NlsThrowablelocale - is the locale to translate to.resolver - is used to resolve the template in order to translate the
original i18n message.
NlsThrowable.getLocalizedMessage(Locale, NlsTemplateResolver, Appendable)
public void getLocalizedMessage(Locale locale,
NlsTemplateResolver resolver,
Appendable buffer)
getLocalizedMessage in interface NlsThrowablelocale - 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.NlsMessage.getLocalizedMessage(Locale,
NlsTemplateResolver, Appendable)public NlsMessage toNlsMessage()
Object.toString() with native
language support.
toNlsMessage in interface NlsObject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||