|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
A context for providing localization via exposing the current
Locale and ResourceBundles. The ResourceBundle of a different Locale
can be accessed without chaning the current Locale with getResourceBundle(Locale).
The current Locale can be changed with setLocale(Locale) and all
subsequent request to getResourceBundle() will use the new current Locale.
| Nested Class Summary | |
static interface |
LocalizationContext.LocaleChangeListener
|
| Method Summary | |
void |
addLocaleChangeListener(LocalizationContext.LocaleChangeListener listener)
|
Locale |
getLocale()
Returns the current session locale. |
String |
getMessage(String code,
Object[] args)
Localizes the code and uses it to format the message with the passed arguments. |
String |
getMessage(String code,
Object[] args,
String defaultMessage)
Localizes the code and uses it to format the message with the passed arguments. |
ResourceBundle |
getResourceBundle()
Returns a resource bundle corresponding to the current locale. |
ResourceBundle |
getResourceBundle(Locale locale)
Returns a resource bundle corresponding to arbitrary locale. |
String |
localize(String key)
Localizes a string returning one that corresponds to the current locale. |
boolean |
removeLocaleChangeListener(LocalizationContext.LocaleChangeListener listener)
|
void |
setLocale(Locale locale)
Sets the current session locale. |
| Method Detail |
public Locale getLocale()
public void setLocale(Locale locale)
public String localize(String key)
public ResourceBundle getResourceBundle()
public ResourceBundle getResourceBundle(Locale locale)
public String getMessage(String code,
Object[] args,
String defaultMessage)
java.text.MessageFormat.
If the localized message cannot be resolved uses defaultMessage instead.
public String getMessage(String code,
Object[] args)
java.text.MessageFormat.
public void addLocaleChangeListener(LocalizationContext.LocaleChangeListener listener)
public boolean removeLocaleChangeListener(LocalizationContext.LocaleChangeListener listener)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||