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


Method Summary
static void appendMessageChain(java.lang.StringBuffer io_buffer, java.lang.Throwable i_throwable, java.lang.String i_lineSeparator)
          Appends the message for i_throwable with its causal chain.
static void appendMessageLine(java.lang.StringBuffer io_buffer, java.lang.Throwable i_throwable)
          Appends the usually one-line message text for the exception i_throwable with inserted parameters to io_buffer.
static void setInternationalization(boolean i_internationalization)
          Activates the internationalization of message texts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setInternationalization

public static void setInternationalization(boolean i_internationalization)
Activates the internationalization of message texts. Further calls to appendMessageLine(java.lang.StringBuffer, java.lang.Throwable) or appendMessageChain(java.lang.StringBuffer, java.lang.Throwable, java.lang.String) will deliver the internationalized message text for an exception instead of the default message text contained in the MultexException-object.

Since:
MulTEx 1c

appendMessageChain

public static void appendMessageChain(java.lang.StringBuffer io_buffer,
                                      java.lang.Throwable i_throwable,
                                      java.lang.String i_lineSeparator)
Appends the message for i_throwable with its causal chain. Appends an usually multi-line message, 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. See appendMessageLine(java.lang.StringBuffer, java.lang.Throwable) for a despription, how each exception is transformed into a message line.

Parameters:
i_lineSeparator - The String used to separate the lines of the message chain. If null is provided, defaults to Failure.lineSeparator.

appendMessageLine

public static void appendMessageLine(java.lang.StringBuffer io_buffer,
                                     java.lang.Throwable i_throwable)
Appends the usually one-line message text for the exception i_throwable with inserted parameters to io_buffer. The message text pattern for the exception is taken from the mostly localized variant of the properties file "MsgText.properties" or helpwise from the default message text pattern in the exception object itself. A local message text pattern for the german language (de) in its swiss (CH) variant would be taken from file "MsgText_de_CH.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 "{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}.