|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.globus.util.I18n
public class I18n
An utility class for internationalized message handling. Example usage::
private static I18n i18n = I18n.getI18n("org.globus.resource"); ... public void hello() { String filename = "file1"; String msg = i18n.getMessage("noFile", new String[]{filename}); ... }
Constructor Summary | |
---|---|
protected |
I18n(ResourceBundle messages)
|
Method Summary | |
---|---|
static I18n |
getI18n(String resource)
Retrieve a I18n instance by resource name. |
static I18n |
getI18n(String resource,
ClassLoader loader)
Retrieve a I18n instance by resource name |
String |
getMessage(String key)
Gets a message from resource bundle. |
String |
getMessage(String key,
Object arg)
Gets a formatted message from resource bundle |
String |
getMessage(String key,
Object[] vars)
Gets a formatted message from resource bundle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected I18n(ResourceBundle messages)
Method Detail |
---|
public static I18n getI18n(String resource)
resource
- resource name. See ResourceBundle.getBundle()
public static I18n getI18n(String resource, ClassLoader loader)
resource
- resource name. See ResourceBundle.getBundle()
loader
- the class loader to be used to load
the resource. This parameter is only used
initially to load the actual resource. Once the resource
is loaded, this argument is ignored.public String getMessage(String key) throws MissingResourceException
MissingResourceException
public String getMessage(String key, Object arg) throws MissingResourceException
MissingResourceException
public String getMessage(String key, Object[] vars) throws MissingResourceException
MissingResourceException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |