|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.informatica.util.locale.ResourceCache
public class ResourceCache
Map associating PropertyResourceBundles and Locales.
Allows to access a ResourceBundle for a given locale multiple
times, without having to reload the Bundle each time. Also tries to keep
single copies of each Bundle (multiple locales may map to the same
ResourceBundle object).
It can also be used to load the best bundle for a list of given locales:
instead of just probing one Locale and returning the default one when not
found, when getBundle() is invoked with the array argument it
tries to find the best locale according the array of desired locales.
ResourceBundle| Method Summary | |
|---|---|
static ResourceCache |
createResourceCache(String baseclass)
Create a ResourceCache for a base resource, with the default ClassLoader. |
static ResourceCache |
createResourceCache(String baseclass,
ClassLoader loader)
Create a ResourceCache for a base resource, supplying a ClassLoader. |
static ResourceCache |
createResourceCache(String baseclass,
ClassLoader loader,
Locale deflocale,
ResourceBundle.Control control)
Create a ResourceCache for a base resource, supplying a ClassLoader, a default locale and a Resource Control. |
ResourceBundle |
getBundle()
Retrieves the Bundle associated to default locale. |
ResourceBundle |
getBundle(Enumeration<Locale> locales)
Retrieves the most appropriate Bundle according to an Enumeration of desired locales. |
ResourceBundle |
getBundle(Locale loc)
Retrieves the best Bundle associated to a given Locale. |
ResourceBundle |
getBundle(Locale[] loc)
Retrieves the most appropriate Bundle according to an array of desired locales. |
Object |
getObject(String name)
|
Object |
getObject(String name,
Locale loc)
|
String |
getString(String name)
|
String |
getString(String name,
Locale loc)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ResourceCache createResourceCache(String baseclass,
ClassLoader loader,
Locale deflocale,
ResourceBundle.Control control)
baseclass - the base resource class name.loader - the class loader.
MissingResourceException - if no resources can be found at
the baseclass.
public static ResourceCache createResourceCache(String baseclass,
ClassLoader loader)
baseclass - the base resource class name.loader - the class loader.
MissingResourceException - if no resources can be found at
the baseclass.public static ResourceCache createResourceCache(String baseclass)
baseclass - the base resource class name.
MissingResourceException - if no resources can be found at
the baseclass.public ResourceBundle getBundle(Enumeration<Locale> locales)
If the list of locales is null, returns the default locale.
locales - the Enumeration of desired locales, in descending order of
priority
public ResourceBundle getBundle(Locale[] loc)
If the list of locales is null, returns the default locale.
loc - the array of desired locales, in descending order of priority
public ResourceBundle getBundle(Locale loc)
loc - the requested locale
public ResourceBundle getBundle()
public Object getObject(String name)
throws LocaleNotFoundException
name - the key name
LocaleNotFoundException
public String getString(String name)
throws LocaleNotFoundException
name - the key name
LocaleNotFoundException
public Object getObject(String name,
Locale loc)
throws MissingResourceException
name - the key nameloc - the requested locale
MissingResourceException
public String getString(String name,
Locale loc)
throws MissingResourceException
name - the key nameloc - the requested locale
MissingResourceException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||