public class ResourceBundleMessageResolver
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
cacheResourceBundles |
protected java.util.List<java.lang.String> |
defaultBundles |
protected java.lang.String |
fallbackBundlename |
protected java.util.Locale |
fallbackLocale |
protected java.util.Set<java.lang.String> |
misses |
protected java.util.Map<java.lang.String,java.util.ResourceBundle> |
notmisses |
Constructor and Description |
---|
ResourceBundleMessageResolver() |
Modifier and Type | Method and Description |
---|---|
void |
addDefaultBundle(java.lang.String bundleName) |
void |
deleteAllDefaultBundles() |
java.lang.String |
findDefaultMessage(java.util.Locale locale,
java.lang.String key)
Finds message in default bundles only, starting from fallback bundlename.
|
java.lang.String |
findMessage(java.lang.String bundleName,
java.util.Locale locale,
java.lang.String key)
Finds messages in the provided bundle.
|
java.util.ResourceBundle |
findResourceBundle(java.lang.String bundleName,
java.util.Locale locale)
Finds resource bundle by it's name.
|
protected java.util.ResourceBundle |
getBundle(java.lang.String bundleName,
java.util.Locale locale,
java.lang.ClassLoader classLoader)
Returns specified bundle.
|
java.lang.String |
getFallbackBundlename() |
java.util.Locale |
getFallbackLocale() |
java.lang.String |
getMessage(java.lang.String bundleName,
java.util.Locale locale,
java.lang.String key)
Gets the message from the named resource bundle.
|
boolean |
isCacheResourceBundles() |
void |
setCacheResourceBundles(boolean cacheResourceBundles) |
void |
setFallbackBundlename(java.lang.String fallbackBundlename) |
void |
setFallbackLocale(java.util.Locale fallbackLocale) |
void |
setFallbackLocale(java.lang.String localeCode) |
protected java.util.Locale fallbackLocale
protected java.lang.String fallbackBundlename
protected java.util.List<java.lang.String> defaultBundles
protected boolean cacheResourceBundles
protected final java.util.Set<java.lang.String> misses
protected final java.util.Map<java.lang.String,java.util.ResourceBundle> notmisses
public void addDefaultBundle(java.lang.String bundleName)
public void deleteAllDefaultBundles()
public java.lang.String findMessage(java.lang.String bundleName, java.util.Locale locale, java.lang.String key)
null
if key is not found.public java.lang.String findDefaultMessage(java.util.Locale locale, java.lang.String key)
public java.lang.String getMessage(java.lang.String bundleName, java.util.Locale locale, java.lang.String key)
null
).public java.util.ResourceBundle findResourceBundle(java.lang.String bundleName, java.util.Locale locale)
null
if resource bundle is missing.protected java.util.ResourceBundle getBundle(java.lang.String bundleName, java.util.Locale locale, java.lang.ClassLoader classLoader)
public java.lang.String getFallbackBundlename()
public void setFallbackBundlename(java.lang.String fallbackBundlename)
public java.util.Locale getFallbackLocale()
public void setFallbackLocale(java.util.Locale fallbackLocale)
public void setFallbackLocale(java.lang.String localeCode)
public boolean isCacheResourceBundles()
public void setCacheResourceBundles(boolean cacheResourceBundles)
Copyright © 2003-present Jodd Team