public class PluginAwareResourceBundleMessageSource extends ReloadableResourceBundleMessageSource
A ReloadableResourceBundleMessageSource that is capable of loading message sources from plugins.
Modifiers | Name | Description |
---|---|---|
protected GrailsApplication |
application |
|
protected java.util.List<java.lang.String> |
pluginBaseNames |
|
protected GrailsPluginManager |
pluginManager |
Fields inherited from class | Fields |
---|---|
class ReloadableResourceBundleMessageSource |
cacheMillis, fileCacheMillis |
Constructor and description |
---|
PluginAwareResourceBundleMessageSource
() |
PluginAwareResourceBundleMessageSource
(GrailsApplication application, GrailsPluginManager pluginManager) |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
afterPropertiesSet() |
|
protected ReloadableResourceBundleMessageSource.PropertiesHolder |
getMergedBinaryPluginProperties(java.util.Locale locale) |
|
protected ReloadableResourceBundleMessageSource.PropertiesHolder |
getMergedPluginProperties(java.util.Locale locale) Get a PropertiesHolder that contains the actually visible properties for a Locale, after merging all specified resource bundles. |
|
protected void |
mergeBinaryPluginProperties(java.util.Locale locale, java.util.Properties mergedProps) |
|
protected java.text.MessageFormat |
resolveCode(java.lang.String code, java.util.Locale locale) |
|
protected java.text.MessageFormat |
resolveCodeFromPlugins(java.lang.String code, java.util.Locale locale) Attempts to resolve a MessageFormat for the code from the list of plugin base names |
|
protected java.lang.String |
resolveCodeWithoutArguments(java.lang.String code, java.util.Locale locale) |
|
protected java.lang.String |
resolveCodeWithoutArgumentsFromPlugins(java.lang.String code, java.util.Locale locale) Attempts to resolve a String for the code from the list of plugin base names |
|
void |
setGrailsApplication(GrailsApplication grailsApplication) |
|
void |
setMessageBundleLocationPattern(java.lang.String messageBundleLocationPattern) The location pattern for message bundles |
|
void |
setPluginCacheSeconds(int pluginCacheSeconds) Set the number of seconds to cache the list of matching properties files loaded from plugin. |
|
void |
setPluginManager(GrailsPluginManager pluginManager) |
|
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) |
|
void |
setResourceResolver(org.springframework.core.io.support.PathMatchingResourcePatternResolver resourceResolver) |
|
void |
setSearchClasspath(boolean searchClasspath) Whether to search the full classpath for message bundles. |
Methods inherited from class | Name |
---|---|
class ReloadableResourceBundleMessageSource |
calculateAllFilenames, calculateFilenamesForLocale, clearCache, clearCacheIncludingAncestors, getBundleCodes, getMergedProperties, getProperties, getValidBasenames, loadProperties, locateResource, locateResourceWithoutCache, resolveCode, resolveCodeWithoutArguments, setBasename, setBasenames, setCacheSeconds, setDefaultEncoding, setFallbackToSystemLocale, setFileCacheSeconds, setFileEncodings, setPropertiesPersister, setResourceLoader, toString |
class org.springframework.context.support.AbstractMessageSource |
org.springframework.context.support.AbstractMessageSource#getParentMessageSource(), org.springframework.context.support.AbstractMessageSource#setParentMessageSource(org.springframework.context.MessageSource), org.springframework.context.support.AbstractMessageSource#setCommonMessages(java.util.Properties), org.springframework.context.support.AbstractMessageSource#setUseCodeAsDefaultMessage(boolean), org.springframework.context.support.AbstractMessageSource#getMessage(java.lang.String, [Ljava.lang.Object;, java.util.Locale), org.springframework.context.support.AbstractMessageSource#getMessage(java.lang.String, [Ljava.lang.Object;, java.lang.String, java.util.Locale), org.springframework.context.support.AbstractMessageSource#getMessage(org.springframework.context.MessageSourceResolvable, java.util.Locale), org.springframework.context.support.AbstractMessageSource#setAlwaysUseMessageFormat(boolean), org.springframework.context.support.AbstractMessageSource#wait(long, int), org.springframework.context.support.AbstractMessageSource#wait(long), org.springframework.context.support.AbstractMessageSource#wait(), org.springframework.context.support.AbstractMessageSource#equals(java.lang.Object), org.springframework.context.support.AbstractMessageSource#toString(), org.springframework.context.support.AbstractMessageSource#hashCode(), org.springframework.context.support.AbstractMessageSource#getClass(), org.springframework.context.support.AbstractMessageSource#notify(), org.springframework.context.support.AbstractMessageSource#notifyAll() |
Get a PropertiesHolder that contains the actually visible properties for a Locale, after merging all specified resource bundles. Either fetches the holder from the cache or freshly loads it.
Only used when caching resource bundle contents forever, i.e. with cacheSeconds < 0. Therefore, merged properties are always cached forever.
Attempts to resolve a MessageFormat for the code from the list of plugin base names
code
- The codelocale
- The localeAttempts to resolve a String for the code from the list of plugin base names
code
- The codelocale
- The localeThe location pattern for message bundles
messageBundleLocationPattern
- The message bundle location patternSet the number of seconds to cache the list of matching properties files loaded from plugin.
Whether to search the full classpath for message bundles. Enabling this will degrade startup performance. The default is to only search for message bundles relative to the application classes directory.
searchClasspath
- True if the entire classpath should be searched