com.ibm.portal.model
Interface LocalizedContextHome

All Known Subinterfaces:
CorLocalizedContextHome, PortalLocalizedContextHome, PortletLocalizedContextHome

public interface LocalizedContextHome

A home interface for lookups to LocalizedContext instances.

Since:
6.1.0

Method Summary
 LocalizedContext getLocalizedContext(java.util.Enumeration<java.util.Locale> aLanguageRangeEnumeration)
          Returns a context instance which uses the language ranges specified in the given locale enumeration.
 LocalizedContext getLocalizedContext(java.lang.String anAcceptLanguageString)
          Returns a context instance which uses the language ranges specified in the given language string.
 ResourceBundleProvider getResourceBundleProvider(java.lang.String baseName, java.lang.ClassLoader loader)
          Constructs a ResourceBundleProvider that can be used to load resource bundles in particular locales without providing a locale based fallback.
 

Method Detail

getLocalizedContext

LocalizedContext getLocalizedContext(java.util.Enumeration<java.util.Locale> aLanguageRangeEnumeration)
Returns a context instance which uses the language ranges specified in the given locale enumeration.

All desired fallback sequences must be explicitly provided in the given enumeration. E.g. the context returned for {de-DE} will not normally find resources for de; if this is desired, {de-DE,de} should be used as argument

Parameters:
aLanguageRangeEnumeration - an enumeration providing locales which are interpreted as language ranges, in descending priority order; must not be null.
Returns:
a localized context instance working on the specified language ranges

getLocalizedContext

LocalizedContext getLocalizedContext(java.lang.String anAcceptLanguageString)
Returns a context instance which uses the language ranges specified in the given language string.

Parameters:
anAcceptLanguageString - a string defining accepted language ranges as documented in RFC 2616; must not be null. Note: Currently, wildcards are ignored. This limitation may be removed in the future.
Returns:
a localized context instance working on the specified language ranges

getResourceBundleProvider

ResourceBundleProvider getResourceBundleProvider(java.lang.String baseName,
                                                 java.lang.ClassLoader loader)

Constructs a ResourceBundleProvider that can be used to load resource bundles in particular locales without providing a locale based fallback. In addition the provider exposes the list of locales the resource bundle is available in. The provider can be loaded once and stored as long as the class loader is valid.

Constructing a provider is considered to be a potentially expensive operation, so a provider should be stored and cached for the lifetime of the client of the provider.

Parameters:
baseName - basename of the bundle
loader - class loader for the bundle
Returns:
the provider, not null