org.hibernate.validator.resourceloading

## Class AggregateResourceBundleLocator

- java.lang.Object
- - org.hibernate.validator.resourceloading.DelegatingResourceBundleLocator
  - - org.hibernate.validator.resourceloading.AggregateResourceBundleLocator

- All Implemented Interfaces:
    ResourceBundleLocator

      public class AggregateResourceBundleLocator
      extends DelegatingResourceBundleLocator

  A `ResourceBundleLocator` implementation that provides access to multiple source `ResourceBundle`s by merging them into one aggregated bundle.
  Author:
    Gunnar Morling

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AggregateResourceBundleLocator.AggregateBundle` A `ResourceBundle` whose content is aggregated from multiple source bundles.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AggregateResourceBundleLocator(List<String> bundleNames)` Creates a locator that delivers a resource bundle merged from the given list of source bundles.
    `AggregateResourceBundleLocator(List<String> bundleNames, ResourceBundleLocator delegate)` Creates a locator that delivers a resource bundle merged from the given list of source bundles.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ResourceBundle` | `getResourceBundle(Locale locale)` Returns a resource bundle for the given locale.

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

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

- - ### Constructor Detail

    - #### AggregateResourceBundleLocator

          public AggregateResourceBundleLocator(List<String> bundleNames)

      Creates a locator that delivers a resource bundle merged from the given list of source bundles.
      Parameters:
        `bundleNames` - A list with source bundle names. The returned bundle will contain all entries from all source bundles. In case a key occurs in multiple source bundles, the value will be taken from the first bundle containing the key.

    - #### AggregateResourceBundleLocator

          public AggregateResourceBundleLocator(List<String> bundleNames,
                                        ResourceBundleLocator delegate)

      Creates a locator that delivers a resource bundle merged from the given list of source bundles.
      Parameters:
        `bundleNames` - A list with source bundle names. The returned bundle will contain all keys from all source bundles. In case a key occurs in multiple source bundles, the value will be taken from the first bundle containing the key.
        `delegate` - A delegate resource bundle locator. The bundle returned by this locator will be added to the aggregate bundle after all source bundles.

  - ### Method Detail

    - #### getResourceBundle

          public ResourceBundle getResourceBundle(Locale locale)

      Description copied from interface: `ResourceBundleLocator`
      Returns a resource bundle for the given locale.
      Specified by:
        `getResourceBundle` in interface `ResourceBundleLocator`
      Overrides:
        `getResourceBundle` in class `DelegatingResourceBundleLocator`
      Parameters:
        `locale` - A locale, for which a resource bundle shall be retrieved. Must not be null.
      Returns:
        A resource bundle for the given locale. May be null, if no such bundle exists.

Copyright © 2007-2014 Red Hat, Inc. All Rights Reserved