|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.radeox.util.i18n.ResourceManager
public class ResourceManager
A Resource Manager implementation to aid the use of locales. It works similar to what the bundle tag in jstl fmt taglibs does but adapted for use withing a threaded java environment.
Constructor Summary | |
---|---|
ResourceManager()
|
Method Summary | |
---|---|
static ResourceManager |
forceGet()
Thread re-use makes your life hard. |
static ResourceManager |
get()
Get a new thread-local instance of the ResourceManager If you are having problems with bundles beeing the same for different threads and locales, try forceGet() |
static java.util.ResourceBundle |
getBundle(java.lang.String baseName)
Get ResourceBundle using the base name provided. |
static java.util.Locale |
getLocale(java.lang.String baseName)
Get the locale of the loaded bundle. |
java.util.ResourceBundle |
getResourceBundle(java.lang.String baseName)
Get the bundle that is active for this thread. |
static java.lang.String |
getString(java.lang.String baseName,
java.lang.String key)
|
void |
setLocale(java.util.Locale locale,
java.util.Enumeration fallback)
Set the locale and potential fallbacks for this thread. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourceManager()
Method Detail |
---|
public static ResourceManager forceGet()
public static ResourceManager get()
public static java.util.ResourceBundle getBundle(java.lang.String baseName)
baseName
- the bundle base name
public static java.util.Locale getLocale(java.lang.String baseName)
baseName
- the bundle base name
public static java.lang.String getString(java.lang.String baseName, java.lang.String key)
public void setLocale(java.util.Locale locale, java.util.Enumeration fallback)
locale
- the requested localefallback
- a set of fallback locales, i.e. request.getLocales()public java.util.ResourceBundle getResourceBundle(java.lang.String baseName)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |