Class HybrisResourceBundle

  • All Implemented Interfaces:
    java.io.Serializable

    public class HybrisResourceBundle
    extends java.util.ResourceBundle
    implements java.io.Serializable
    Resource bundle to store locale-specific objects in a serialized form. HybrisResourceBundle is a concrete subclass of ResourceBundle that manages resources for a locale using a set of objects from a serializable map.

    See ResourceBundle for more information about resource bundles.

    See Also:
    Serialized Form
    • 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 Description
      HybrisResourceBundle​(java.util.Locale locale)
      Creates a new HybrisResourceBundle instance for the specified Locale.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Enumeration getKeys()
      Implementation of ResourceBundle.getKeys().
      java.util.Locale getLocale()
      Return the Locale for this HybrisResourceBundle.
      protected java.lang.Object handleGetObject​(java.lang.String key)
      Implementation of ResourceBundle.handleGetObject(String).
      void setObject​(java.lang.String key, java.io.Serializable value)
      Puts a serializable object with the specified key into the resource bundle.
      void setParent​(java.util.ResourceBundle parent)
      Overrides setParent of ResourceBundle, but requires a HybrisResourceBundle as parameter.
      void setString​(java.lang.String key, java.lang.String value)
      Puts a String with the specified key into the resource bundle.
      • Methods inherited from class java.util.ResourceBundle

        clearCache, clearCache, containsKey, getBaseBundleName, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getObject, getString, getStringArray, handleKeySet, keySet
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HybrisResourceBundle

        public HybrisResourceBundle​(java.util.Locale locale)
        Creates a new HybrisResourceBundle instance for the specified Locale.
        Parameters:
        locale - the Locale
    • Method Detail

      • handleGetObject

        protected java.lang.Object handleGetObject​(java.lang.String key)
                                            throws java.util.MissingResourceException
        Implementation of ResourceBundle.handleGetObject(String).
        Specified by:
        handleGetObject in class java.util.ResourceBundle
        Parameters:
        key - the key of the Object, which should be returned. If there exists no resources for the specified key, Null is returned.
        Throws:
        java.util.MissingResourceException
        See Also:
        ResourceBundle.handleGetObject(String)
      • getKeys

        public java.util.Enumeration getKeys()
        Implementation of ResourceBundle.getKeys().
        Specified by:
        getKeys in class java.util.ResourceBundle
        See Also:
        ResourceBundle.getKeys()
      • setParent

        public void setParent​(java.util.ResourceBundle parent)
        Overrides setParent of ResourceBundle, but requires a HybrisResourceBundle as parameter. The parent will provide fall-back functionality if a resource is not found in the current bundle.
        Overrides:
        setParent in class java.util.ResourceBundle
        Parameters:
        parent - a HybrisResourceBundle object
        Throws:
        java.lang.IllegalArgumentException - if parent is not a HybrisResourceBundle instance.
      • getLocale

        public java.util.Locale getLocale()
        Return the Locale for this HybrisResourceBundle.
        Overrides:
        getLocale in class java.util.ResourceBundle
        Returns:
        the Locale of this HybrisResourceBundle
      • setObject

        public void setObject​(java.lang.String key,
                              java.io.Serializable value)
        Puts a serializable object with the specified key into the resource bundle. If there exists an entry for the specified key, this entry will be overwritten.
        Parameters:
        key - the key of the new entry
        value - the value of the new entry
        Throws:
        java.lang.IllegalArgumentException - if key is null
      • setString

        public void setString​(java.lang.String key,
                              java.lang.String value)
        Puts a String with the specified key into the resource bundle. If there exists an entry for the specified key, this entry will be overwritten.
        Parameters:
        key - the key of the new entry
        value - the String value of the new entry
        Throws:
        java.lang.IllegalArgumentException - if key is null