de.caff.i18n

## Class ResourceBundleCollection

- java.lang.Object
- - java.util.ResourceBundle
  - - de.caff.i18n.ResourceBundleCollection

-     public class ResourceBundleCollection
      extends java.util.ResourceBundle

  Handle a collection of resource bundles. This allows parts of an application (e.g. beans) to maintain their own resource bundle but access to all these bundles is handled as an unit.
  Author:
    Rammi

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.util.ResourceBundle

      `java.util.ResourceBundle.Control`

  - ### Field Summary

    - ### Fields inherited from class java.util.ResourceBundle

      `parent`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResourceBundleCollection(java.util.Locale locale)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addResourceBundle(java.util.ResourceBundle bundle)` Add an resource bundle.
    `java.util.Enumeration<java.lang.String>` | `getKeys()` Return an iterator of the keys.
    `java.util.Locale` | `getLocale()` Returns the locale of this resource bundle.
    `protected java.lang.Object` | `handleGetObject(java.lang.String key)` Must have method for getting the value for a key.
    `void` | `removeResourceBundle(java.util.ResourceBundle bundle)` Remove a resource bundle.
    `(package private) void` | `setParentBundle(java.util.ResourceBundle parent)` Set the parent collection.

    - ### Methods inherited from class java.util.ResourceBundle

      `clearCache, clearCache, containsKey, getBaseBundleName, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getObject, getString, getStringArray, handleKeySet, keySet, setParent`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ResourceBundleCollection

          public ResourceBundleCollection(java.util.Locale locale)

      Constructor.
      Parameters:
        `locale` - locale of this bundle

  - ### Method Detail

    - #### getLocale

          public java.util.Locale getLocale()

      Returns the locale of this resource bundle. This method can be used after a call to getBundle() to determine whether the resource bundle returned really corresponds to the requested locale or is a fallback.
      Overrides:
        `getLocale` in class `java.util.ResourceBundle`
      Returns:
        the locale of this resource bundle

    - #### addResourceBundle

          public void addResourceBundle(java.util.ResourceBundle bundle)

      Add an resource bundle. If this bundle defines an already defined resource, the old resource will be overwritten!
      Parameters:
        `bundle` - resource bundle to add

    - #### removeResourceBundle

          public void removeResourceBundle(java.util.ResourceBundle bundle)

      Remove a resource bundle.
      Parameters:
        `bundle` - resource bundle to remove

    - #### setParentBundle

          void setParentBundle(java.util.ResourceBundle parent)

      Set the parent collection.
      Parameters:
        `parent` - parent

    - #### handleGetObject

          protected java.lang.Object handleGetObject(@NotNull
                                                     java.lang.String key)

      Must have method for getting the value for a key.
      Specified by:
        `handleGetObject` in class `java.util.ResourceBundle`
      Parameters:
        `key` - see description of java.util.ResourceBundle
      Returns:
        the value for the given key or `null`

    - #### getKeys

          @NotNull
          public java.util.Enumeration<java.lang.String> getKeys()

      Return an iterator of the keys.
      Specified by:
        `getKeys` in class `java.util.ResourceBundle`
      Returns:
        iterator of all keys from the collected tables.