Class CompositeResourceBundle

java.lang.Object
java.util.ResourceBundle
de.hybris.platform.servicelayer.i18n.impl.CompositeResourceBundle

public class CompositeResourceBundle extends ResourceBundle
A ResourceBundle which is a composition of two or more decorated bundles. Generally a ResourceBundle already can manage an internal parent bundle. In that case whenever a PropertyResourceBundle is created the parent bundle is set according specified language, country etc. However disadvantage is that fallback options can't be specified and parent bundles can't be set manually.
This implementation of a ResourceBundle allows free choice of parent bundles as well as control over events, when the fallback bundle shall be used (e.g. when key exists but value is empty).
  • Field Details

  • Constructor Details

    • CompositeResourceBundle

      public CompositeResourceBundle(Collection<ResourceBundle> bundles)
      Constructor. Creates a composition of bundles and sets a default fallback behavior with KEY_FALLBACK.
      Parameters:
      bundles - collection of ResourceBundle which are used to compose this bundle
    • CompositeResourceBundle

      public CompositeResourceBundle(Collection<ResourceBundle> bundles, int fallback)
      Constructor. Creates a composition of bundles.
      Parameters:
      bundles - collection of ResourceBundle which are used to compose this bundle
      fallback - fallback options
  • Method Details