public class ResourceBundleMessageProvider extends Object implements MessageProvider
MessageProvider that reads messages
from ResourceBundles with a specific base name.| Constructor and Description |
|---|
ResourceBundleMessageProvider(String baseName)
Creates a new
ResourceBundleMessageProvider with the given base name and UTF-8 encoding. |
ResourceBundleMessageProvider(String baseName,
String encoding)
Creates a new
ResourceBundleMessageProvider with the given base name and encoding. |
| Modifier and Type | Method and Description |
|---|---|
void |
clearCache()
Clears any internal caches, forcing the message provider to resolve the codes from the original message source.
|
MessageFormat |
resolveCode(String s,
Locale locale)
Attempts to resolve the specified code for the specified locale.
|
public ResourceBundleMessageProvider(String baseName)
ResourceBundleMessageProvider with the given base name and UTF-8 encoding.baseName - the base name to use, must not be null.public ResourceBundleMessageProvider(String baseName, String encoding)
ResourceBundleMessageProvider with the given base name and encoding.baseName - the base name to use, must not be null.encoding - the encoding to use when reading the resource bundle, must not be null.public MessageFormat resolveCode(String s, Locale locale)
MessageProviderresolveCode in interface MessageProviders - the code of the message, must not be null.locale - the locale, must not be null.MessageFormat for the message, or null if not found.public void clearCache()
MessageProviderclearCache in interface MessageProviderCopyright © 2017. All rights reserved.