Class Bundle


  • public class Bundle
    extends Bundle
    Provides standard access for resource bundles in a package. Convention is to provide a subclass of this name in each package, working off the local resource bundle name.
    Since:
    3.3.1
    • Constructor Summary

      Constructors 
      Constructor Description
      Bundle()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String bundleName()  
      protected static Bundle getBundle()  
      (package private) static java.lang.String getMessage​(java.lang.String key)
      Provides a translated string for a given key from the package resource bundle or parent.
      (package private) static java.lang.String getMessage​(java.lang.String key, java.lang.Object... subs)
      Merges user data with a translated string for a given key from the package resource bundle or parent.
      (package private) static java.lang.String getMessage​(java.util.Locale locale, java.lang.String key, java.lang.Object... subs)
      Merges user data with a translated string for a given key in a given locale from the package resource bundle or parent.
      protected java.lang.String retry​(java.util.Locale locale, java.lang.String key)  
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • getMessage

        static java.lang.String getMessage​(java.lang.String key)
        Provides a translated string for a given key from the package resource bundle or parent.

        Note that this is intentionally package-local access.

        Parameters:
        key - Bundle key to be translated
        Returns:
        Internationalized text
      • getMessage

        static java.lang.String getMessage​(java.lang.String key,
                                           java.lang.Object... subs)
        Merges user data with a translated string for a given key from the package resource bundle or parent.

        Uses the transformation conventions of the Java MessageFormat utility.

        Note that this is intentionally package-local access.

        Parameters:
        key - Bundle key to be translated
        subs - One or more objects to be inserted into the message
        Returns:
        Internationalized text
        See Also:
        MessageFormat
      • getMessage

        static java.lang.String getMessage​(java.util.Locale locale,
                                           java.lang.String key,
                                           java.lang.Object... subs)
        Merges user data with a translated string for a given key in a given locale from the package resource bundle or parent.

        Uses the transformation conventions of the Java MessageFormat utility.

        Note that this is intentionally package-local access.

        Parameters:
        locale - The locale to be used
        key - Bundle key to be translated
        subs - One or more objects to be inserted into the message
        Returns:
        Internationalized text
        See Also:
        MessageFormat
      • retry

        protected java.lang.String retry​(java.util.Locale locale,
                                         java.lang.String key)
        Overrides:
        retry in class Bundle