multex
Class MsgText

java.lang.Object
  |
  +--multex.MsgText

public class MsgText
extends java.lang.Object

Services for getting the message text for exceptions. It handles exceptions


Field Summary
static java.lang.String lineSeparator
          Returns the line separator for the actual platform.
 
Method Summary
static java.lang.String getMessageChain(java.lang.Throwable i_throwable)
          Returns the message for i_throwable with its causal chain.
static java.lang.String getMessageLine(java.lang.Throwable i_throwable)
          Result: A usually one-line message text for the exception i_throwable with inserted parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lineSeparator

public static final java.lang.String lineSeparator
Returns the line separator for the actual platform. This is the line separator for the platform the Java virtual machine is running on. It is the value of the system property 'line.separator'.
Method Detail

getMessageChain

public static java.lang.String getMessageChain(java.lang.Throwable i_throwable)
Returns the message for i_throwable with its causal chain.
Returns:
A usually multi-line String, in which the first line is the message for i_throwable and the further lines are the messages in the chain of causing exceptions of i_throwable. The lines are separated by lineSeparator. See getMessageLine(java.lang.Throwable) for a despription, how each exception is transformed into a message line.

getMessageLine

public static java.lang.String getMessageLine(java.lang.Throwable i_throwable)
Result: A usually one-line message text for the exception i_throwable with inserted parameters. The message text for the exception is taken from the properties file "MsgText.properties" or one of the localized variants of it, e.g. "MsgText_de_DE.properties", see the Java Tutorial chapter on internationalization at february 1999.

This file must contain definition lines of the form:

packageName.ExceptionName = message text pattern
or
packageName.ClassName$InnerExceptionName = message text pattern
with parameter substitutors in the message text pattern, e.g. with named parameters:
CopyNP$CopyFailure = The file "{inFileName}" could not be copied to "{outFileName}"
or with (deprecated) indexed parameters:
Copy$CopyFailure = The file "{0}" could not be copied to "{1}"
If i_throwable is a standard Java exception with one String as detailMessage, this is taken as message parameter {0}.