org.ow2.weblab.services.iterator.messages
Class Messages

java.lang.Object
  extended by org.ow2.weblab.services.iterator.messages.Messages

public abstract class Messages
extends java.lang.Object

This class enable to load messages from the resource bundle associated to this class canonical name. It provides to method, one retrieving the message itself and another one using MessageFormat mechanism for substitution of parameters.

Author:
ymombrun
See Also:
MessageFormat
Date:
2011-08-17

Method Summary
static java.lang.String getString(java.lang.String key)
          Lookup in the ResourceBundle for the key in parameter.
static java.lang.String getString(java.lang.String key, java.lang.Object... params)
          Lookup in the ResourceBundle for the key in parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getString

public static java.lang.String getString(java.lang.String key)
Lookup in the ResourceBundle for the key in parameter. If key is not found, returns !key!

Parameters:
key - The key of the message in the resource file.
Returns:
The value in the resource file (or !key! if not found).

getString

public static java.lang.String getString(java.lang.String key,
                                         java.lang.Object... params)
Lookup in the ResourceBundle for the key in parameter. The parameters in ellipse are used through the MessageFormat.format(String, Object...) method. If key is not found, returns '!'+key'!'+Arrays.toString(params).

Parameters:
key - The key of the message.
params - The array used by the inner message formatter class to replace informations in the message.
Returns:
The value associated to the key in the property file, or '!'+key'!'+Arrays.toString(params) if not found. Using the array in parameter to format the message.


Copyright © 2004-2011. All Rights Reserved.