public class DatabaseResourceBundleManager
extends java.lang.Object
DatabasePropertyResourceBundle
manager which loads and caches
DatabasePropertyResourceBundles
.Constructor and Description |
---|
DatabaseResourceBundleManager() |
Modifier and Type | Method and Description |
---|---|
DatabasePropertyResourceBundle |
getResourceBundle(java.lang.String baseName,
java.lang.String resourceBundleExtension,
java.lang.ClassLoader classLoader)
Gets a resource bundle using the specified
baseName , and the
specified resourceBundleExtension . |
public DatabasePropertyResourceBundle getResourceBundle(java.lang.String baseName, java.lang.String resourceBundleExtension, java.lang.ClassLoader classLoader)
baseName
, and the
specified resourceBundleExtension
. The baseName
identifies the specific set of resources to load, while the
resourceBundleExtension
is used to locate database-specific
localizations of those resources.
The passed base name and resource bundle extension are used to create resource bundle names. The first name is created by concatenating the base name with the resource bundle extension (if provided). From this name all parent bundle names are derived. This results in a list of possible bundle names.
For example, the baseName "full.package.name.BaseName"
, and the
resourceBundleExtension "_mysql_5_1"
(for MySQL 5.1
),
the list of resource bundles to load would look like this:
DatabasePropertyResourceBundles
.
The properties files used by DatabasePropertyResourceBundle
may use the enhanced syntax supported by
EProperties
This method tries to load a .properties
file with the names
by replacing dots in the base name with a slash and by appending
".properties
" to the end of the string. If such a resource can be
found by calling ClassLoader.getResource(String)
it is used to
initialize a DatabasePropertyResourceBundle
. The resource loader
will also load all of the ancestors of this resource bundle (as
described above).
baseName
- the base name of the resource bundle, including the full
package nameresourceBundleExtension
- the database-specific localization of the
resource bundle, or null
if no localized bundle should
be searched forclassLoader
- the ClassLoader to use when locating the requested
resource, or null
to use the default ClassLoadernull
if no resource bundle for the specified base name
can be found.java.lang.NullPointerException
- if baseName
is null