-
- All Known Implementing Classes:
AbstractResourceBundleProvider
public interface ResourceBundleProvider
ResourceBundleProvider
is a provider interface that is used for loading resource bundles for named modules. Implementation classes of this interface are loaded withServiceLoader
during a call to theResourceBundle.getBundle
method. The provider service type is determined by<package name> + ".spi." + <simple name> + "Provider"
.For example, if the base name is "com.example.app.MyResources",
com.example.app.spi.MyResourcesProvider
will be the provider service type:public interface MyResourcesProvider extends ResourceBundleProvider { }
This providers's
getBundle
method is called through the resource bundle loading process instead ofResourceBundle.Control.newBundle()
. Refer toResourceBundle
for details.- Since:
- 9
- See Also:
- Resource Bundles in Named Modules, ResourceBundleProvider Service Providers
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ResourceBundle
getBundle(String baseName, Locale locale)
Returns aResourceBundle
for the given bundle name and locale.
-
-
-
Method Detail
-
getBundle
ResourceBundle getBundle(String baseName, Locale locale)
Returns aResourceBundle
for the given bundle name and locale. This method returnsnull
if there is noResourceBundle
found for the given parameters.- Parameters:
baseName
- the base bundle name of the resource bundle, a fully qualified class namelocale
- the locale for which the resource bundle should be loaded- Returns:
- the ResourceBundle created for the given parameters, or null if no
ResourceBundle
for the given parameters is found
-
-