net.sf.xbus.base.core
Class MessageHandler

java.lang.Object
  extended by net.sf.xbus.base.core.MessageHandler

public class MessageHandler
extends java.lang.Object

A Message is selected from a properties file.

The message result is a String.
The clear regulation of the message is reached by a key. The key is described in * XException documentation page.

Author:
Lars Messner

Method Summary
static MessageHandler getInstance(java.lang.String basename)
          Returns a named instance of the Message.
 java.lang.String getMessage(java.lang.String key, java.util.List params)
          On the basis of the key get the message of the properties file.
 java.lang.String getMessageOptional(java.lang.String key, java.util.List params)
          On the basis of the key get the message of the properties file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMessage

public java.lang.String getMessage(java.lang.String key,
                                   java.util.List params)
On the basis of the key get the message of the properties file.

Parameters:
key - contain char and/or int for the definitly designation of the message
params - contain a list of the inspected parameters
Returns:
messageText contain the message from the properties file

getMessageOptional

public java.lang.String getMessageOptional(java.lang.String key,
                                           java.util.List params)
On the basis of the key get the message of the properties file.

Parameters:
key - contain char and/or int for the definitly designation of the message
params - contain a list of the inspected parameters
Returns:
messageText contain the message from the properties file

getInstance

public static MessageHandler getInstance(java.lang.String basename)
Returns a named instance of the Message.

The first call creates a new Message and reads all entries. Following calls will return the object, that has been created by the first call.

Parameters:
basename - the basename of the properties file.
Returns:
MessageHandler - instance ofMessageHandler