Package de.xima.fc.gui.bean
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ResourceBundleBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getMessage(Object classLoaderProviding, String bundleName, String key, Locale locale)
Gets the message for the given key from the resource bundle of the resource bundle and locale.String
getPlaceholder(Object classLoaderProviding, String bundleName, String key, Locale locale)
Gets the placeholder for the given key.
-
-
-
Method Detail
-
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 interfaceIResourceBundle
- Parameters:
classLoaderProviding
- the object providing the class loader. May be aclass loader
itself, aclass
or aclass name
.bundleName
- the name of the resource bundlekey
- the key of the messagelocale
- 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 loaderbundleName
- the name of the resource bundlekey
- the key to get the placeholder forlocale
- the locale- Returns:
- the placeholder for the given key or
null
if the placeholder could not be read
-
-