public class BroadleafMergeResourceBundleMessageSource
extends org.springframework.context.support.ReloadableResourceBundleMessageSource
Replaces the deprecated BLResourceBundleMessageSource
by using a ReloadableResourceBundleMessageSource
instead. The main advantage of using this is the out-of-the-box ability to merge multiple property files together. There
is one important difference: When there is a conflict for a property (declared in multiple files) this implementation
assumes that the later one in the list takes precedence. This follows with normal Broadleaf assumptions that bean
definitions declared later in the merge process win.
While this theoretically supports caching via the features provided in ReloadableResourceBundleMessageSource, this should not be used and instead should have cacheMillis always set to -1 (which is the default implementation). This ensures that codes are always obtained from a merged property list.
The basenames in this implementation are Spring path resources so if you need to refer to a resource on the classpath,
these should be prefixed with classpath:. This is slightly different from the ResourceBundleMessageSource
; see
ReloadableResourceBundleMessageSource.setBasenames(String...)
for more information.
ReloadableResourceBundleMessageSource}
,
ResourceLoader#getResource(String)}
,
#setBasenames(String...)}
Constructor and Description |
---|
BroadleafMergeResourceBundleMessageSource() |
Modifier and Type | Method and Description |
---|---|
void |
setBasenames(String... basenames)
The super implementation ensures the basenames defined at the beginning take precedence.
|
calculateAllFilenames, calculateFilenamesForLocale, clearCache, clearCacheIncludingAncestors, getMergedProperties, getProperties, loadProperties, refreshProperties, resolveCode, resolveCodeWithoutArguments, setBasename, setCacheSeconds, setDefaultEncoding, setFallbackToSystemLocale, setFileEncodings, setPropertiesPersister, setResourceLoader, toString
getCommonMessages, getDefaultMessage, getMessage, getMessage, getMessage, getMessageFromParent, getMessageInternal, getParentMessageSource, isUseCodeAsDefaultMessage, resolveArguments, setCommonMessages, setParentMessageSource, setUseCodeAsDefaultMessage
public BroadleafMergeResourceBundleMessageSource()
public void setBasenames(String... basenames)
setBasenames
in class org.springframework.context.support.ReloadableResourceBundleMessageSource
basenames
- resourceBundleExtensionPoint
- ReloadableResourceBundleMessageSource#setBasenames(String...)}
Copyright © 2014. All rights reserved.