public final class BundleFactory
extends java.lang.Object
BundleFactory
provides a simplified approach to getting
resource bundles from the run time resource bundle manager.Constructor and Description |
---|
BundleFactory() |
Modifier and Type | Method and Description |
---|---|
static void |
flush()
Clears out any resource bundles cached by the run time resource bundle manager
|
static java.util.ResourceBundle |
getBundle(java.util.ResourceBundle resourceBundle,
java.util.Locale locale)
Takes a resource bundle and wraps it with the application-level override
bundle
|
static java.util.ResourceBundle |
getBundle(java.lang.String bundleId)
Gets the resource bundle for the given name
|
static java.util.ResourceBundle |
getBundle(java.lang.String bundleId,
java.util.Locale locale)
Gets the resource bundle for the given name
|
static java.util.ResourceBundle |
getBundle(java.lang.String bundleId,
java.util.Locale locale,
java.lang.ClassLoader loader)
Gets the resource bundle for the given name
|
static java.util.ResourceBundle |
getBundle(java.lang.String bundleId,
java.lang.String extension)
Deprecated.
since 11.0
|
static java.util.ResourceBundle |
getBundle(java.lang.String bundleId,
java.lang.String extension,
java.util.Locale locale)
Deprecated.
since 11.0
|
static java.util.ResourceBundle |
getBundle(java.lang.String bundleId,
java.lang.String extension,
java.util.Locale locale,
java.lang.ClassLoader classLoader)
Deprecated.
since 11.0
|
static java.util.Locale |
getDefaultLocale() |
static java.util.Map<java.lang.String,java.lang.String> |
getMap(java.lang.String bundleId)
Gets a map of key/values from the specified bundle id and locale
|
static java.util.Map<java.lang.String,java.lang.String> |
getMap(java.lang.String bundleId,
java.util.Locale locale)
Gets a map of key/values from the specified bundle id and locale
|
static java.util.Map<java.lang.String,java.lang.String> |
getMap(java.lang.String bundleId,
java.util.Locale locale,
java.lang.ClassLoader loader)
Gets a map of key/values from the specified bundle id and locale
|
static boolean |
releaseBundle(java.lang.String bundleId)
Releases the ResourceBundleWrapper and all associated resources, once
released the old resource bundle should not be used anymore, or it will
throw an
IllegalStateException . |
public static void flush()
public static boolean releaseBundle(java.lang.String bundleId)
IllegalStateException
.bundleid
- The resource bundle to release.true
on success.java.lang.NullPointerException
- if bundleId
is null
public static java.util.Map<java.lang.String,java.lang.String> getMap(java.lang.String bundleId)
bundleId
- The bundleId to use. This will only be significant if
the project is set for one bundle per artifact. The bundle ID is up to
the client, however is generally either
{PACKAGE_NAME} + {OBJECT_NAME} + "Bundle"
or
{PACKAGE_NAME} + "Bundle"
.public static java.util.Map<java.lang.String,java.lang.String> getMap(java.lang.String bundleId, java.util.Locale locale)
bundleId
- The bundleId to use. This will only be significant if
the project is set for one bundle per artifact. The bundle ID is up to
the client, however is generally either
{PACKAGE_NAME} + {OBJECT_NAME} + "Bundle"
or
{PACKAGE_NAME} + "Bundle"
.locale
- the locale to use when finding the resource bundlepublic static java.util.Map<java.lang.String,java.lang.String> getMap(java.lang.String bundleId, java.util.Locale locale, java.lang.ClassLoader loader)
bundleId
- locale
- loader
- public static final java.util.ResourceBundle getBundle(java.lang.String bundleId)
bundleId
- The bundleId to use. This will only be significant if
the project is set for one bundle per artifact. The bundle ID is up to
the client, however is generally either
{PACKAGE_NAME} + {OBJECT_NAME} + "Bundle"
or
{PACKAGE_NAME} + "Bundle"
.@Deprecated public static final java.util.ResourceBundle getBundle(java.lang.String bundleId, java.lang.String extension)
bundleId
- The bundleId to use. This will only be significant if
the project is set for one bundle per artifact. The bundle ID is up to
the client, however is generally either
{PACKAGE_NAME} + {OBJECT_NAME} + "Bundle"
or
{PACKAGE_NAME} + "Bundle"
.extension
- the extension of the bundle (no longer used)@Deprecated public static final java.util.ResourceBundle getBundle(java.lang.String bundleId, java.lang.String extension, java.util.Locale locale)
bundleId
- extension
- locale
- @Deprecated public static final java.util.ResourceBundle getBundle(java.lang.String bundleId, java.lang.String extension, java.util.Locale locale, java.lang.ClassLoader classLoader)
bundleId
- extension
- locale
- classLoader
- public static final java.util.ResourceBundle getBundle(java.lang.String bundleId, java.util.Locale locale)
bundleId
- The bundleId to use. This will only be significant if
the project is set for one bundle per artifact. The bundle ID is up to
the client, however is generally either
{PACKAGE_NAME} + {OBJECT_NAME} + "Bundle"
or
{PACKAGE_NAME} + "Bundle"
.locale
- the locale to look forpublic static java.util.ResourceBundle getBundle(java.lang.String bundleId, java.util.Locale locale, java.lang.ClassLoader loader)
bundleId
- The bundleId to use. This will only be significant if
the project is set for one bundle per artifact. The bundle ID is up to
the client, however is generally either
{PACKAGE_NAME} + {OBJECT_NAME} + "Bundle"
or
{PACKAGE_NAME} + "Bundle"
.locale
- locale the locale to look forloader
- the class loader to use to find the filepublic static java.util.ResourceBundle getBundle(java.util.ResourceBundle resourceBundle, java.util.Locale locale)
resourceBundle
- must not be nulllocale
- must not be nullpublic static java.util.Locale getDefaultLocale()