| This method should be called by all implementations of the
ThrowableList interface in their
java.lang.Throwable.getMessage implementation. It
ensures that the formatting of throwable lists, nested or wrapped exceptions
is done in a consistent way.
The method returns an throwable message assembled in this way:
-
If the calling throwable is a wrapper throwable (see
ThrowableList.isWrapper ),
it delegates the call to the wrapped throwable (
wrappedEx.getMessage() ).
-
If there is a nested throwable (the calling throwable has a message of its own),
the returned message starts with the string returned by the
java.lang.Object.toString method, followed and separated by a end-of-line sequence by the formatted message
of the calling throwable.
-
If the calling throwable has only a message without parameters, this message
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.
-
If the calling throwable provides parameters along with a format string (the
return value of
super.getMessage is interpreted as a format string),
a formatted message produced by
java.text.MessageFormat.format 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.
Parameters: ex - the calling throwable the formatted throwable message See Also: java.text.MessageFormat See Also: ThrowableList |