public interface RepositoryResourceBundleMessageFormatProvider
This interface is responsible for creating and caching the resolved MessageFormat
instances
and refreshing outdated MessageFormat
instances.
Modifier and Type | Method and Description |
---|---|
MessageFormat |
getMessageFormat(ResourceBundle bundle,
String code,
Locale locale)
Return a MessageFormat for the given bundle and code,
fetching already generated MessageFormats from the cache.
|
void |
registerBundle(String basename,
Locale locale,
ResourceBundle bundle)
Register the live
bundle by the basename and locale
in order to be able to determine that the bundle was originated from repository. |
void |
registerPreviewBundle(String basename,
Locale locale,
ResourceBundle bundle)
Register the preview
bundle by the basename and locale
in order to be able to determine that the bundle was originated from repository. |
void registerBundle(String basename, Locale locale, ResourceBundle bundle)
bundle
by the basename
and locale
in order to be able to determine that the bundle
was originated from repository.
Note: Whenever retrieve a resource bundle from repository, this method should be invoked.
Then this implementation should register it if not yet done or clear any outdated
cache associated with the basename
and locale
for a refreshed bundle.
basename
- resource bundle basenamelocale
- resource bundle localebundle
- resource bundlevoid registerPreviewBundle(String basename, Locale locale, ResourceBundle bundle)
bundle
by the basename
and locale
in order to be able to determine that the bundle
was originated from repository.
Note: Whenever retrieve a resource bundle from repository, this method should be invoked.
Then this implementation should register it if not yet done or clear any outdated
cache associated with the basename
and locale
for a refreshed bundle.
basename
- resource bundle basenamelocale
- resource bundle localebundle
- resource bundleMessageFormat getMessageFormat(ResourceBundle bundle, String code, Locale locale)
bundle
- the ResourceBundle to work oncode
- the message code to retrievelocale
- the Locale to use to build the MessageFormatnull
if no message
defined for the given codeCopyright © 2019. All rights reserved.