Class SingleLocaleMultiResourceBundle

java.lang.Object
java.util.ResourceBundle
church.i18n.resources.bundles.SingleLocaleMultiResourceBundle
All Implemented Interfaces:
MultiResourceBundle

public class SingleLocaleMultiResourceBundle extends ResourceBundle implements MultiResourceBundle
Extension of a simple resource bundle able to load, and work with multiple message resource files.
  • Constructor Details

    • SingleLocaleMultiResourceBundle

      public SingleLocaleMultiResourceBundle(@NotNull @NotNull Locale locale)
      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: MultiResourceBundle
      Add message sources into multiple resource bundle.
      Specified by:
      addMessageSources in interface MultiResourceBundle
      Parameters:
      resourceBundleDescriptors - Resource bundles locations.
      Returns:
      Returns current resource bundle with all previously added resource bundles.
    • getLocale

      @NotNull public @NotNull Locale getLocale()
      Overrides:
      getLocale in class ResourceBundle
    • handleGetObject

      @Nullable protected @Nullable Object handleGetObject(@NotNull @NotNull String key)
      Gets an object for the given key from this resource bundle. Returns null if 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:
      handleGetObject in class ResourceBundle
      Parameters:
      key - The key for the desired object.
      Returns:
      The object for the given key, or null.
      Throws:
      NullPointerException - If key is null.
    • getKeys

      @NotNull public @NotNull Enumeration<String> getKeys()
      Returns an enumeration of the keys.
      Specified by:
      getKeys in class ResourceBundle
      Returns:
      An @{code Enumeration} of the keys contained in this @{code ResourceBundle} and its parent bundles.