Class BundleLocator

  • Direct Known Subclasses:
    LocalizedUIBundle

    public abstract class BundleLocator
    extends java.lang.Object
    This class permits to deal easily with bundles.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String bundleName  
      private static java.lang.ClassLoader loader  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected BundleLocator​(java.lang.String bundleName)
      Hidden constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.util.ResourceBundle getBundle​(java.util.Locale locale)
      Gets the right bundle.
      A cache is handled as well as the concurrent accesses.
      protected java.lang.String getBundleKeyValue​(java.util.Locale locale, java.lang.String key, java.lang.Object... parameters)
      Method that centralizes the way to get the value associated to a bundle key.
      • Methods inherited from class java.lang.Object

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

      • bundleName

        private final java.lang.String bundleName
      • loader

        private static final java.lang.ClassLoader loader
    • Constructor Detail

      • BundleLocator

        protected BundleLocator​(java.lang.String bundleName)
        Hidden constructor.
        Parameters:
        bundleName - the name of the bundle.
    • Method Detail

      • getBundleKeyValue

        protected java.lang.String getBundleKeyValue​(java.util.Locale locale,
                                                     java.lang.String key,
                                                     java.lang.Object... parameters)
        Method that centralizes the way to get the value associated to a bundle key.
        Parameters:
        locale - the locale.
        key - the key searched for.
        parameters - the parameters to apply to the value associated to the key.
        Returns:
        the formatted value associated to the given key. Empty string if no value exists for the given key.
      • getBundle

        private java.util.ResourceBundle getBundle​(java.util.Locale locale)
        Gets the right bundle.
        A cache is handled as well as the concurrent accesses.
        Parameters:
        locale - the locale.
        Returns:
        the instance of the bundle.