|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.ui.context.support.ResourceBundleThemeSource
public class ResourceBundleThemeSource
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.
setBasenamePrefix(java.lang.String),
ResourceBundle,
ResourceBundleMessageSource| Field Summary | |
|---|---|
protected Log |
logger
|
| Constructor Summary | |
|---|---|
ResourceBundleThemeSource()
|
|
| Method Summary | |
|---|---|
protected MessageSource |
createMessageSource(String basename)
Create a MessageSource for the given basename, to be used as MessageSource for the corresponding theme. |
ThemeSource |
getParentThemeSource()
Return the parent of this ThemeSource, or null if none. |
Theme |
getTheme(String themeName)
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 void |
initParent(Theme theme)
Initialize the MessageSource of the given theme with the one from the corresponding parent of this ThemeSource. |
void |
setBasenamePrefix(String basenamePrefix)
Set the prefix that gets applied to the ResourceBundle basenames, i.e. the theme names. |
void |
setParentThemeSource(ThemeSource parent)
Set the parent that will be used to try to resolve theme messages that this object can't resolve. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Log logger
| Constructor Detail |
|---|
public ResourceBundleThemeSource()
| Method Detail |
|---|
public void setParentThemeSource(ThemeSource parent)
HierarchicalThemeSource
setParentThemeSource in interface HierarchicalThemeSourceparent - 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.public ThemeSource getParentThemeSource()
HierarchicalThemeSourcenull if none.
getParentThemeSource in interface HierarchicalThemeSourcepublic void setBasenamePrefix(String basenamePrefix)
basenamePrefix - prefix for ResourceBundle basenamesResourceBundlepublic Theme getTheme(String themeName)
SimpleTheme instances are cached per theme name. Use a reloadable MessageSource if themes should reflect changes to the underlying files.
getTheme in interface ThemeSourcethemeName - name of the theme
null if none definedsetBasenamePrefix(java.lang.String),
createMessageSource(java.lang.String)protected MessageSource createMessageSource(String basename)
Default implementation creates a ResourceBundleMessageSource. for the given basename. A subclass could create a specifically configured ReloadableResourceBundleMessageSource, for example.
basename - the basename to create a MessageSource for
ResourceBundleMessageSource,
ReloadableResourceBundleMessageSourceprotected void initParent(Theme theme)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||