org.dbforms.util
Class MessageResourcesInternal

java.lang.Object
  extended by org.dbforms.util.MessageResourcesInternal

public class MessageResourcesInternal
extends Object

handling of internal messages

Author:
Henner Kollmann

Constructor Summary
MessageResourcesInternal()
           
 
Method Summary
static String getMessage(String msg, Locale loc)
          Retrieve message from ResourceBundle.
static String getMessage(String msg, Locale locale, String defaultMsg)
          Get the message from ResourceBundle.
static String getMessage(String msg, Locale loc, String[] parms)
          Retrieve message from ResourceBundle and replace parameter "{x}" with values in parms array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageResourcesInternal

public MessageResourcesInternal()
Method Detail

getMessage

public static String getMessage(String msg,
                                Locale locale,
                                String defaultMsg)
Get the message from ResourceBundle. If not present, return the defaultMsg at the place of a null. To avoid to doing this condition everywhere in the code ...

Parameters:
msgString - : Message key to lookup.
localeLocale - : Locale object to map message with good ResourceBundle.
defaultMsgString - : String to return if the lookup message key is not found.
Returns:
String : Message resolve.

getMessage

public static String getMessage(String msg,
                                Locale loc)
Retrieve message from ResourceBundle. If the ResourceBundle is not yet cached, cache it and retreive message.

Parameters:
msgString - : Message key to lookup.
locLocale - : Locale object to map message with good ResourceBundle.
Returns:
String : Message resolve, null if not found.

getMessage

public static String getMessage(String msg,
                                Locale loc,
                                String[] parms)
Retrieve message from ResourceBundle and replace parameter "{x}" with values in parms array.

Parameters:
msgString - : Message key to lookup.
locLocale - : Locale object to map message with good ResourceBundle.
parmsString[] - : Parameters to replace "{x}" in message .
Returns:
String : Message resolve with parameter replaced, null if message key not found.


Copyright © 2002-2006 DbForms. All Rights Reserved.