|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.portal.common.i18n.ResourceBundleManager
public class ResourceBundleManager
Manage a set of resource bundles. Obtaining bundles is done using a ResourceBundleFactory object. A bundle obtained successfully is cached in order to avoid the potential expensive cost of bundle retrieval.
The manager can also be used to build LocalizedString object from the loaded bundles.
Constructor Summary | |
---|---|
ResourceBundleManager(java.util.ResourceBundle defaultBundle,
ResourceBundleFactory resourceBundleFactory)
|
Method Summary | |
---|---|
LocalizedString |
getLocalizedValue(java.lang.String key,
java.lang.String defaultValue)
Return a localized value constructed from the various resource bundles. |
java.util.ResourceBundle |
getResourceBundle(java.util.Locale locale)
Return a bundle for the given locale. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourceBundleManager(java.util.ResourceBundle defaultBundle, ResourceBundleFactory resourceBundleFactory) throws java.lang.IllegalArgumentException
defaultBundle
- the default bundle returned when no bundle has been obtained for the localeresourceBundleFactory
- the resource bundle factory
java.lang.IllegalArgumentException
- IllegalArgumentException if the resource bundle factory is nullMethod Detail |
---|
public LocalizedString getLocalizedValue(java.lang.String key, java.lang.String defaultValue) throws java.lang.IllegalArgumentException
Locale.ENGLISH
. Two successive calls to this method may not return identical results since the
returned LocalizedString
is built using the bundles known by the manager.
key
- the key to lookup in the bundlesdefaultValue
- the default value
java.lang.IllegalArgumentException
- if the key of the default value is nullpublic java.util.ResourceBundle getResourceBundle(java.util.Locale locale) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the locale is null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |