Package church.i18n.resources.bundles
Class SingleLocaleMultiResourceBundle
java.lang.Object
java.util.ResourceBundle
church.i18n.resources.bundles.SingleLocaleMultiResourceBundle
- All Implemented Interfaces:
MultiResourceBundle
Extension of a simple resource bundle able to load, and work with multiple message resource files.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.ResourceBundle
ResourceBundle.Control -
Field Summary
Fields inherited from class java.util.ResourceBundle
parent -
Constructor Summary
ConstructorsConstructorDescriptionSingleLocaleMultiResourceBundle(@NotNull Locale locale) Creates an instance of this class without reading any message resource files. -
Method Summary
Modifier and TypeMethodDescription@NotNull MultiResourceBundleaddMessageSources(@Nullable ResourceBundleDescriptor... resourceBundleDescriptors) Add message sources into multiple resource bundle.@NotNull Enumeration<String> getKeys()Returns an enumeration of the keys.@NotNull Localeprotected @Nullable ObjecthandleGetObject(@NotNull String key) Gets an object for the given key from this resource bundle.Methods inherited from class java.util.ResourceBundle
clearCache, clearCache, containsKey, getBaseBundleName, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getObject, getString, getStringArray, handleKeySet, keySet, setParentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface church.i18n.resources.bundles.MultiResourceBundle
addMessageSources
-
Constructor Details
-
SingleLocaleMultiResourceBundle
Creates an instance of this class without reading any message resource files.- Parameters:
locale- A locale of this resource bundle.
-
-
Method Details
-
addMessageSources
@NotNull public @NotNull MultiResourceBundle addMessageSources(@Nullable @Nullable ResourceBundleDescriptor... resourceBundleDescriptors) Description copied from interface:MultiResourceBundleAdd message sources into multiple resource bundle.- Specified by:
addMessageSourcesin interfaceMultiResourceBundle- Parameters:
resourceBundleDescriptors- Resource bundles locations.- Returns:
- Returns current resource bundle with all previously added resource bundles.
-
getLocale
- Overrides:
getLocalein classResourceBundle
-
handleGetObject
Gets an object for the given key from this resource bundle. Returnsnullif this resource bundle does not contain an object for the given key. In the case multiple files has contained the same key, there is no guarantee of what message will be returned.- Specified by:
handleGetObjectin classResourceBundle- Parameters:
key- The key for the desired object.- Returns:
- The object for the given key, or
null. - Throws:
NullPointerException- Ifkeyisnull.
-
getKeys
Returns an enumeration of the keys.- Specified by:
getKeysin classResourceBundle- Returns:
- An @{code Enumeration} of the keys contained in this @{code ResourceBundle} and its parent bundles.
-