Package church.i18n.resources.bundles
Class SingleLocaleMultiResourceBundle
- java.lang.Object
-
- java.util.ResourceBundle
-
- church.i18n.resources.bundles.SingleLocaleMultiResourceBundle
-
- All Implemented Interfaces:
MultiResourceBundle
public class SingleLocaleMultiResourceBundle extends java.util.ResourceBundle implements MultiResourceBundle
Extension of a simple resource bundle able to load, and work with multiple message resource files.
-
-
Constructor Summary
Constructors Constructor Description SingleLocaleMultiResourceBundle(@NotNull java.util.Locale locale)Creates an instance of this class without reading any message resource files.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull MultiResourceBundleaddMessageSources(@Nullable java.lang.String... fileLocations)Add message sources into multiple resource bundle.@NotNull java.util.Enumeration<java.lang.String>getKeys()Returns an enumeration of the keys.@NotNull java.util.LocalegetLocale()protected @Nullable java.lang.ObjecthandleGetObject(@NotNull java.lang.String key)Gets an object for the given key from this resource bundle.
-
-
-
Method Detail
-
addMessageSources
@NotNull public @NotNull MultiResourceBundle addMessageSources(@Nullable @Nullable java.lang.String... fileLocations)
Description copied from interface:MultiResourceBundleAdd message sources into multiple resource bundle.- Specified by:
addMessageSourcesin interfaceMultiResourceBundle- Parameters:
fileLocations- Resource bundles locations.- Returns:
- Returns current resource bundle with all previously added resource bundles.
-
getLocale
@NotNull public @NotNull java.util.Locale getLocale()
- Overrides:
getLocalein classjava.util.ResourceBundle
-
handleGetObject
@Nullable protected @Nullable java.lang.Object handleGetObject(@NotNull @NotNull java.lang.String key)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 classjava.util.ResourceBundle- Parameters:
key- The key for the desired object.- Returns:
- The object for the given key, or
null. - Throws:
java.lang.NullPointerException- Ifkeyisnull.
-
getKeys
@NotNull public @NotNull java.util.Enumeration<java.lang.String> getKeys()
Returns an enumeration of the keys.- Specified by:
getKeysin classjava.util.ResourceBundle- Returns:
- An @{code Enumeration} of the keys contained in this @{code ResourceBundle} and its parent bundles.
-
-