Class ResourceBundleThemeSource
- All Implemented Interfaces:
- Aware,- BeanClassLoaderAware,- HierarchicalThemeSource,- ThemeSource
ThemeSource implementation that looks up an individual
 ResourceBundle per theme. The theme name gets
 interpreted as ResourceBundle basename, supporting a common
 basename prefix for all themes.- Author:
- Jean-Pierre Pawlak, Juergen Hoeller
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected MessageSourcecreateMessageSource(String basename) Deprecated.Create a MessageSource for the given basename, to be used as MessageSource for the corresponding theme.Deprecated.Return the parent of this ThemeSource, ornullif none.Deprecated.This implementation returns a SimpleTheme instance, holding a ResourceBundle-based MessageSource whose basename corresponds to the given theme name (prefixed by the configured "basenamePrefix").protected voidinitParent(Theme theme) Deprecated.Initialize the MessageSource of the given theme with the one from the corresponding parent of this ThemeSource.voidsetBasenamePrefix(String basenamePrefix) Deprecated.Set the prefix that gets applied to the ResourceBundle basenames, i.e.voidsetBeanClassLoader(ClassLoader beanClassLoader) Deprecated.Callback that supplies the beanclass loaderto a bean instance.voidsetDefaultEncoding(String defaultEncoding) Deprecated.Set the default charset to use for parsing resource bundle files.voidsetFallbackToSystemLocale(boolean fallbackToSystemLocale) Deprecated.Set whether to fall back to the system Locale if no files for a specific Locale have been found.voidsetParentThemeSource(ThemeSource parent) Deprecated.Set the parent that will be used to try to resolve theme messages that this object can't resolve.
- 
Field Details- 
loggerDeprecated.
 
- 
- 
Constructor Details- 
ResourceBundleThemeSourcepublic ResourceBundleThemeSource()Deprecated.
 
- 
- 
Method Details- 
setParentThemeSourceDeprecated.Description copied from interface:HierarchicalThemeSourceSet the parent that will be used to try to resolve theme messages that this object can't resolve.- Specified by:
- setParentThemeSourcein interface- HierarchicalThemeSource
- Parameters:
- parent- the parent ThemeSource that will be used to resolve messages that this object can't resolve. May be- null, in which case no further resolution is possible.
 
- 
getParentThemeSourceDeprecated.Description copied from interface:HierarchicalThemeSourceReturn the parent of this ThemeSource, ornullif none.- Specified by:
- getParentThemeSourcein interface- HierarchicalThemeSource
 
- 
setBasenamePrefixDeprecated.Set the prefix that gets applied to the ResourceBundle basenames, i.e. the theme names. For example: basenamePrefix="test.", themeName="theme" → basename="test.theme".Note that ResourceBundle names are effectively classpath locations: As a consequence, the JDK's standard ResourceBundle treats dots as package separators. This means that "test.theme" is effectively equivalent to "test/theme", just like it is for programmatic java.util.ResourceBundleusage.- See Also:
 
- 
setDefaultEncodingDeprecated.Set the default charset to use for parsing resource bundle files.ResourceBundleMessageSource's default is thejava.util.ResourceBundledefault encoding: ISO-8859-1.- Since:
- 4.2
- See Also:
 
- 
setFallbackToSystemLocalepublic void setFallbackToSystemLocale(boolean fallbackToSystemLocale) Deprecated.Set whether to fall back to the system Locale if no files for a specific Locale have been found.ResourceBundleMessageSource's default is "true".- Since:
- 4.2
- See Also:
 
- 
setBeanClassLoaderDeprecated.Description copied from interface:BeanClassLoaderAwareCallback that supplies the beanclass loaderto a bean instance.Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean'sInitializingBean.afterPropertiesSet()method or a custom init-method.- Specified by:
- setBeanClassLoaderin interface- BeanClassLoaderAware
- Parameters:
- beanClassLoader- the owning class loader
 
- 
getThemeDeprecated.This implementation returns a SimpleTheme instance, holding a ResourceBundle-based MessageSource whose basename corresponds to the given theme name (prefixed by the configured "basenamePrefix").SimpleTheme instances are cached per theme name. Use a reloadable MessageSource if themes should reflect changes to the underlying files. - Specified by:
- getThemein interface- ThemeSource
- Parameters:
- themeName- the name of the theme
- Returns:
- the corresponding Theme, or nullif none defined. Note that, by convention, a ThemeSource should at least be able to return a default Theme for the default theme name "theme" but may also return default Themes for other theme names.
- See Also:
 
- 
createMessageSourceDeprecated.Create a MessageSource for the given basename, to be used as MessageSource for the corresponding theme.Default implementation creates a ResourceBundleMessageSource. for the given basename. A subclass could create a specifically configured ReloadableResourceBundleMessageSource, for example. - Parameters:
- basename- the basename to create a MessageSource for
- Returns:
- the MessageSource
- See Also:
 
- 
initParentDeprecated.Initialize the MessageSource of the given theme with the one from the corresponding parent of this ThemeSource.- Parameters:
- theme- the Theme to (re-)initialize
 
 
-