ResourceBundleProvider (Java SE 9 & JDK 9 ) (original) (raw)
- All Known Implementing Classes:
[AbstractResourceBundleProvider](../../../java/util/spi/AbstractResourceBundleProvider.html "class in java.util.spi")
public interface ResourceBundleProviderResourceBundleProvider
is a provider interface that is used for loading resource bundles for named modules. Implementation classes of this interface are loaded with ServiceLoader 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 of ResourceBundle.Control.newBundle(). Refer to ResourceBundle 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 a ResourceBundle for the given bundle name and locale. Method Detail
* #### getBundle [ResourceBundle](../../../java/util/ResourceBundle.html "class in java.util") getBundle([String](../../../java/lang/String.html "class in java.lang") baseName, [Locale](../../../java/util/Locale.html "class in java.util") locale) Returns a `ResourceBundle` for the given bundle name and locale. This method returns `null` if there is no `ResourceBundle` found for the given parameters. Parameters: `baseName` \- the base bundle name of the resource bundle, a fully qualified class name `locale` \- 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
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2017, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.