Allows clients to get/set locale and get at localized resource bundle content in a resource path independent manner, without having to worry about handling exception states or deal directly with ResourceBundle object instances. Instead, clients receive numeric handles to the underlying objects. Rather than causing exception states, missing or inaccessible resources and underlying MissingResource and NullPointer exceptions result in null return values when attempting to retrieve a resource.
| Modifier and Type | Field and Description |
|---|---|
| private static HashMap | bundleHandleMap
Map: Integer object handle maps to: |
| private static HsqlArrayList | bundleList
List whose elements are |
| private static Locale | locale
The Locale used internally to fetch resource bundles. |
| private static final Object | mutex
Used to synchronize access |
| private static final Method | newGetBundleMethod
JDK 1.1 compliance |
| private static final String | prefix
The resource path prefix of the |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static ResourceBundle | getBundle(String
the base name of the resource bundle, a fully
qualified class name name, Locale the locale for which a resource bundle is desired locale, ClassLoader the class loader from which to load the resource bundle cl)Retrieves a resource bundle using the specified base name, locale, and class loader. |
| public static int | Returns: int handle to the ResourceBundle
object corresponding to the specified name and
current Locale, or -1 if no such bundle
can be foundof the desired bundle name, ClassLoader The ClassLoader to use in the search cl)Retrieves an |
| public static Locale | |
| private static Method | getNewGetBundleMethod()
One-shot initialization of JDK 1.2+ ResourceBundle.getBundle() method having ClassLoader in the signature. |
| public static String | Returns: The String value corresponding to the specified handle and key.an handle, String int handle to a
ResourceBundle objectA key)String key to a String valueRetrieves, from the |
| public static void |
| bundleHandleMap | back to summary |
|---|---|
| private static HashMap<String, Integer> bundleHandleMap Map: Integer object handle maps to: | |
| bundleList | back to summary |
|---|---|
| private static HsqlArrayList<ResourceBundle> bundleList List whose elements are | |
| locale | back to summary |
|---|---|
| private static Locale locale The Locale used internally to fetch resource bundles. | |
| mutex | back to summary |
|---|---|
| private static final Object mutex Used to synchronize access | |
| newGetBundleMethod | back to summary |
|---|---|
| private static final Method newGetBundleMethod JDK 1.1 compliance | |
| prefix | back to summary |
|---|---|
| private static final String prefix The resource path prefix of the | |
| ResourceBundleHandler | back to summary |
|---|---|
| private ResourceBundleHandler() Pure utility class: external construction disabled. | |
| getBundle | back to summary |
|---|---|
| public static ResourceBundle getBundle(String name, Locale locale, ClassLoader cl) throws NullPointerException, MissingResourceException Retrieves a resource bundle using the specified base name, locale, and class loader. This is a JDK 1.1 compliant substitution for the ResourceBundle method with the same name and signature. If there is a problem using the JDK 1.2 functionality (the class loader is specified non-null and the underlying method is not available or there is a security exception, etc.), then the behaviour reverts to that of JDK 1.1.
| |
| getBundleHandle | back to summary |
|---|---|
| public static int getBundleHandle(String name, ClassLoader cl) Retrieves an
| |
| getLocale | back to summary |
|---|---|
| public static Locale getLocale() Getter for property locale.
| |
| getNewGetBundleMethod | back to summary |
|---|---|
| private static Method getNewGetBundleMethod() One-shot initialization of JDK 1.2+ ResourceBundle.getBundle() method having ClassLoader in the signature. | |
| getString | back to summary |
|---|---|
| public static String getString(int handle, String key) Retrieves, from the
| |
| setLocale | back to summary |
|---|---|
| public static void setLocale(Locale l) throws IllegalArgumentException Setter for property locale.
| |