org.objectweb.jonas_lib
Class I18n

java.lang.Object
  extended by org.objectweb.jonas_lib.I18n

public class I18n
extends java.lang.Object

This class defines the way for getting message with ResourceBundle for different language Inspired from http://java.sun.com/docs/books/tutorial/i18n/

Author:
Florent Benoit

Method Summary
static I18n getInstance(java.lang.Class c)
          Gets the instance for a given class
static I18n getInstance(java.lang.Class c, java.lang.ClassLoader cl)
          Gets the instance for a given class
static I18n getInstance(java.lang.String packageName)
          Gets the instance for a given package
static I18n getInstance(java.lang.String packageName, java.lang.ClassLoader cl)
          Gets the instance for a given package
 java.lang.String getMessage(java.lang.String key)
          Gets the value of the given key
 java.lang.String getMessage(java.lang.String key, java.lang.Object obj)
          Gets the formatted string with the given arguments
 java.lang.String getMessage(java.lang.String key, java.lang.Object[] args)
          Gets the formatted string with the given arguments
 java.lang.String getMessage(java.lang.String key, java.lang.Object obj1, java.lang.Object obj2)
          Gets the formatted string with the given arguments
 java.lang.String getMessage(java.lang.String key, java.lang.Object obj1, java.lang.Object obj2, java.lang.Object obj3)
          Gets the formatted string with the given arguments
 java.lang.String getMessage(java.lang.String key, java.lang.Object obj1, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4)
          Gets the formatted string with the given arguments
 java.lang.String getMessage(java.lang.String key, java.lang.Object obj1, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4, java.lang.Object obj5)
          Gets the formatted string with the given arguments
 java.lang.String getMessage(java.lang.String key, java.lang.Object obj1, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4, java.lang.Object obj5, java.lang.Object obj6)
          Gets the formatted string with the given arguments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static I18n getInstance(java.lang.Class c)
Gets the instance for a given class

Parameters:
c - the class for which we want a bundle
Returns:
I18n object

getInstance

public static I18n getInstance(java.lang.Class c,
                               java.lang.ClassLoader cl)
Gets the instance for a given class

Parameters:
c - the class for which we want a bundle
cl - the classloader used to load bundle
Returns:
I18n object

getInstance

public static I18n getInstance(java.lang.String packageName)
Gets the instance for a given package

Parameters:
packageName - the package for which we want a bundle
Returns:
I18n object

getInstance

public static I18n getInstance(java.lang.String packageName,
                               java.lang.ClassLoader cl)
Gets the instance for a given package

Parameters:
packageName - the package for which we want a bundle
cl - the classloader used to load bundle
Returns:
I18n object

getMessage

public java.lang.String getMessage(java.lang.String key,
                                   java.lang.Object[] args)
Gets the formatted string with the given arguments

Parameters:
key - the keystring on which to apply arguments
args - the object arguments for the formatter
Returns:
the formatted string

getMessage

public java.lang.String getMessage(java.lang.String key)
Gets the value of the given key

Parameters:
key - the keystring to retrieve
Returns:
the value for the given key or the key if the value can not be found

getMessage

public java.lang.String getMessage(java.lang.String key,
                                   java.lang.Object obj)
Gets the formatted string with the given arguments

Parameters:
key - the keystring on which to apply arguments
obj - the object argument for the formatter
Returns:
the formatted string

getMessage

public java.lang.String getMessage(java.lang.String key,
                                   java.lang.Object obj1,
                                   java.lang.Object obj2)
Gets the formatted string with the given arguments

Parameters:
key - the keystring on which to apply arguments
obj1 - the first object argument for the formatter
obj2 - the second object argument for the formatter
Returns:
the formatted string

getMessage

public java.lang.String getMessage(java.lang.String key,
                                   java.lang.Object obj1,
                                   java.lang.Object obj2,
                                   java.lang.Object obj3)
Gets the formatted string with the given arguments

Parameters:
key - the keystring on which to apply arguments
obj1 - the first object argument for the formatter
obj2 - the second object argument for the formatter
obj3 - the third object argument for the formatter
Returns:
the formatted string

getMessage

public java.lang.String getMessage(java.lang.String key,
                                   java.lang.Object obj1,
                                   java.lang.Object obj2,
                                   java.lang.Object obj3,
                                   java.lang.Object obj4)
Gets the formatted string with the given arguments

Parameters:
key - the keystring on which to apply arguments
obj1 - argument for the formatter
obj2 - argument for the formatter
obj3 - argument for the formatter
obj4 - argument for the formatter
Returns:
the formatted string

getMessage

public java.lang.String getMessage(java.lang.String key,
                                   java.lang.Object obj1,
                                   java.lang.Object obj2,
                                   java.lang.Object obj3,
                                   java.lang.Object obj4,
                                   java.lang.Object obj5)
Gets the formatted string with the given arguments

Parameters:
key - the keystring on which to apply arguments
obj1 - argument for the formatter
obj2 - argument for the formatter
obj3 - argument for the formatter
obj4 - argument for the formatter
obj5 - argument for the formatter
Returns:
the formatted string

getMessage

public java.lang.String getMessage(java.lang.String key,
                                   java.lang.Object obj1,
                                   java.lang.Object obj2,
                                   java.lang.Object obj3,
                                   java.lang.Object obj4,
                                   java.lang.Object obj5,
                                   java.lang.Object obj6)
Gets the formatted string with the given arguments

Parameters:
key - the keystring on which to apply arguments
obj1 - argument for the formatter
obj2 - argument for the formatter
obj3 - argument for the formatter
obj4 - argument for the formatter
obj5 - argument for the formatter
obj6 - argument for the formatter
Returns:
the formatted string