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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetMessage(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.getPlaceholder(Object classLoaderProviding, String bundleName, String key, Locale locale) Gets the placeholder for the given key.
-
Constructor Details
-
ResourceBundleBean
public ResourceBundleBean()
-
-
Method Details
-
getMessage
Description copied from interface:IResourceBundleGets 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:
getMessagein interfaceIResourceBundle- Parameters:
classLoaderProviding- the object providing the class loader. May be aclass loaderitself, aclassor aclass name.bundleName- the name of the resource bundlekey- the key of the messagelocale- the locale- Returns:
- the message or
nullif 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
nullif the placeholder could not be read
-