Class ResourceBundleBean

java.lang.Object
de.xima.fc.gui.bean.ResourceBundleBean
All Implemented Interfaces:
IResourceBundle, Serializable

@Named @RequestScoped public class ResourceBundleBean extends Object implements Serializable, IResourceBundle
Bean to read resource bundles.
Since:
8.4.0
Author:
XIMA MEDIA GmbH
See Also:
  • Constructor Details

    • ResourceBundleBean

      public ResourceBundleBean()
  • Method Details

    • getMessage

      public String getMessage(Object classLoaderProviding, String bundleName, String key, Locale locale)
      Description copied from interface: IResourceBundle
      Gets the message for the given key from the resource bundle of the resource bundle and locale. The resource bundle is defined by the class loader providing object and the bundle name.
      Specified by:
      getMessage in interface IResourceBundle
      Parameters:
      classLoaderProviding - the object providing the class loader. May be a class loader itself, a class or a class name.
      bundleName - the name of the resource bundle
      key - the key of the message
      locale - the locale
      Returns:
      the message or null if the resource bundle could not be read or the key does not exist.
    • getPlaceholder

      public String getPlaceholder(Object classLoaderProviding, String bundleName, String key, Locale locale)
      Gets the placeholder for the given key. The placeholder is used to display a message in the UI. If the key is not a placeholder key, the default key is used.
      Parameters:
      classLoaderProviding - the object providing the class loader
      bundleName - the name of the resource bundle
      key - the key to get the placeholder for
      locale - the locale
      Returns:
      the placeholder for the given key or null if the placeholder could not be read