public final class ThrowableMessageFormatter
extends java.lang.Object
This class is used by the implementations of the ThrowableList
interface.
Its method getMessage(de.susebox.java.lang.ThrowableList)
formats the message that should be returned by
the Throwable.getMessage()
overridden by implementations of the
ThrowableList
interface.
ThrowableList
,
Throwable
,
MessageFormat
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MSG_IDENTATION
Message indentation for nested exceptions.
|
Constructor and Description |
---|
ThrowableMessageFormatter() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getMessage(ThrowableList ex)
This method should be called by all implementations of the
ThrowableList
interface in their Throwable.getMessage() implementation. |
public static final java.lang.String MSG_IDENTATION
public static final java.lang.String getMessage(ThrowableList ex)
ThrowableList
interface in their Throwable.getMessage()
implementation. It
ensures that the formatting of throwable lists, nested or wrapped exceptions
is done in a consistent way.
ThrowableList.isWrapper()
),
it delegates the call to the wrapped throwable (wrappedEx.getMessage()
).
Object.toString()
method, followed and separated by a end-of-line sequence by the formatted message
of the calling throwable.
super.getMessage
is interpreted as a format string),
a formatted message produced by MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition)
is either
appended to the string produced by processing a nested throwable or is taken as
the entire return value if there is no nested or subsequent throwable present.
ex
- the calling throwableMessageFormat
,
ThrowableList