public class AggregateResourceBundleLocator extends DelegatingResourceBundleLocator
ResourceBundleLocator
implementation that provides access
to multiple source ResourceBundle
s by merging them into one
aggregated bundle.Modifier and Type | Class and Description |
---|---|
static class |
AggregateResourceBundleLocator.AggregateBundle
A
ResourceBundle whose content is aggregated from multiple source bundles. |
Constructor and Description |
---|
AggregateResourceBundleLocator(java.util.List<java.lang.String> bundleNames)
Creates a locator that delivers a resource bundle merged from the given
list of source bundles.
|
AggregateResourceBundleLocator(java.util.List<java.lang.String> bundleNames,
ResourceBundleLocator delegate)
Creates a locator that delivers a resource bundle merged from the given
list of source bundles.
|
AggregateResourceBundleLocator(java.util.List<java.lang.String> bundleNames,
ResourceBundleLocator delegate,
java.lang.ClassLoader classLoader)
Creates a locator that delivers a resource bundle merged from the given
list of source bundles.
|
Modifier and Type | Method and Description |
---|---|
java.util.ResourceBundle |
getResourceBundle(java.util.Locale locale)
Returns a resource bundle for the given locale.
|
public AggregateResourceBundleLocator(java.util.List<java.lang.String> bundleNames)
bundleNames
- A list with source bundle names. The returned bundle will
contain all entries from all source bundles. In case a key occurs
in multiple source bundles, the value will be taken from the
first bundle containing the key.public AggregateResourceBundleLocator(java.util.List<java.lang.String> bundleNames, ResourceBundleLocator delegate)
bundleNames
- A list with source bundle names. The returned bundle will
contain all keys from all source bundles. In case a key occurs
in multiple source bundles, the value will be taken from the
first bundle containing the key.delegate
- A delegate resource bundle locator. The bundle returned by
this locator will be added to the aggregate bundle after all
source bundles.public AggregateResourceBundleLocator(java.util.List<java.lang.String> bundleNames, ResourceBundleLocator delegate, java.lang.ClassLoader classLoader)
bundleNames
- A list with source bundle names. The returned bundle will
contain all keys from all source bundles. In case a key occurs
in multiple source bundles, the value will be taken from the
first bundle containing the key.delegate
- A delegate resource bundle locator. The bundle returned by
this locator will be added to the aggregate bundle after all
source bundles.classLoader
- The classloader to use for loading the bundle.public java.util.ResourceBundle getResourceBundle(java.util.Locale locale)
ResourceBundleLocator
getResourceBundle
in interface ResourceBundleLocator
getResourceBundle
in class DelegatingResourceBundleLocator
locale
- A locale, for which a resource bundle shall be retrieved. Must
not be null.Copyright © 2007-2022 Red Hat, Inc. All Rights Reserved