Package org.springframework.ui.context.support

# Class ResourceBundleThemeSource

java.lang.Object
org.springframework.ui.context.support.ResourceBundleThemeSource

All Implemented Interfaces:
  `org.springframework.beans.factory.Aware`, `org.springframework.beans.factory.BeanClassLoaderAware`, `HierarchicalThemeSource`, `ThemeSource`

@Deprecated(since="6.0") public class ResourceBundleThemeSource extends Object implements HierarchicalThemeSource, org.springframework.beans.factory.BeanClassLoaderAware
Deprecated.
as of 6.0 in favor of using CSS, without direct replacement
`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:
  - `setBasenamePrefix(java.lang.String)`
  - `ResourceBundle`
  - `ResourceBundleMessageSource`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final org.apache.commons.logging.Log`
`logger`
Deprecated.

## Constructor Summary

Constructors
Constructor
Description
`ResourceBundleThemeSource()`
Deprecated.

## Method Summary

Modifier and Type
Method
Description
`protected MessageSource`
`createMessageSource(String basename)`
Deprecated.
Create a MessageSource for the given basename, to be used as MessageSource for the corresponding theme.
`ThemeSource`
`getParentThemeSource()`
Deprecated.
Return the parent of this ThemeSource, or `null` if none.
`Theme`
`getTheme(String themeName)`
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 void`
`initParent(Theme theme)`
Deprecated.
Initialize the MessageSource of the given theme with the one from the corresponding parent of this ThemeSource.
`void`
`setBasenamePrefix(String basenamePrefix)`
Deprecated.
Set the prefix that gets applied to the ResourceBundle basenames, i.e.
`void`
`setBeanClassLoader(ClassLoader beanClassLoader)`
Deprecated.
`void`
`setDefaultEncoding(String defaultEncoding)`
Deprecated.
Set the default charset to use for parsing resource bundle files.
`void`
`setFallbackToSystemLocale(boolean fallbackToSystemLocale)`
Deprecated.
Set whether to fall back to the system Locale if no files for a specific Locale have been found.
`void`
`setParentThemeSource(ThemeSource parent)`
Deprecated.
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 Details

### logger

protected final org.apache.commons.logging.Log logger
Deprecated.

## Constructor Details

### ResourceBundleThemeSource

public ResourceBundleThemeSource()
Deprecated.

## Method Details

### setParentThemeSource

public void setParentThemeSource(@Nullable ThemeSource parent)
Deprecated.
Description copied from interface: `HierarchicalThemeSource`
Set the parent that will be used to try to resolve theme messages that this object can't resolve.

Specified by:
  `setParentThemeSource` in 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.

### getParentThemeSource

@Nullable public ThemeSource getParentThemeSource()
Deprecated.
Description copied from interface: `HierarchicalThemeSource`
Return the parent of this ThemeSource, or `null` if none.

Specified by:
  `getParentThemeSource` in interface `HierarchicalThemeSource`

### setBasenamePrefix

public void setBasenamePrefix(@Nullable String basenamePrefix)
Deprecated.
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.ResourceBundle` usage.

See Also:
  - `ResourceBundle.getBundle(String)`

### setDefaultEncoding

public void setDefaultEncoding(@Nullable String defaultEncoding)
Deprecated.
Set the default charset to use for parsing resource bundle files.

`ResourceBundleMessageSource`'s default is the `java.util.ResourceBundle` default encoding: ISO-8859-1.

Since:
  4.2
See Also:
  - `AbstractResourceBasedMessageSource.setDefaultEncoding(java.lang.String)`

### setFallbackToSystemLocale

public 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:
  - `AbstractResourceBasedMessageSource.setFallbackToSystemLocale(boolean)`

### setBeanClassLoader

public void setBeanClassLoader(@Nullable ClassLoader beanClassLoader)
Deprecated.

Specified by:
  `setBeanClassLoader` in interface `org.springframework.beans.factory.BeanClassLoaderAware`

### getTheme

@Nullable public Theme getTheme(String themeName)
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").

SimpleTheme instances are cached per theme name. Use a reloadable MessageSource if themes should reflect changes to the underlying files.

Specified by:
  `getTheme` in interface `ThemeSource`
Parameters:
  `themeName` - the name of the theme
Returns:
  the corresponding Theme, or `null` if 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:
  - `setBasenamePrefix(java.lang.String)`
  - `createMessageSource(java.lang.String)`

### createMessageSource

protected MessageSource createMessageSource(String basename)
Deprecated.
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:
  - `ResourceBundleMessageSource`
  - `ReloadableResourceBundleMessageSource`

### initParent

protected void initParent(Theme theme)
Deprecated.
Initialize the MessageSource of the given theme with the one from the corresponding parent of this ThemeSource.

Parameters:
  `theme` - the Theme to (re-)initialize