Package org.springframework.beans.factory.config

# Class PreferencesPlaceholderConfigurer

java.lang.Object
org.springframework.core.io.support.PropertiesLoaderSupport
org.springframework.beans.factory.config.PropertyResourceConfigurer
org.springframework.beans.factory.config.PlaceholderConfigurerSupport
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer

All Implemented Interfaces:
  `Aware`, `BeanFactoryAware`, `BeanNameAware`, `BeanFactoryPostProcessor`, `InitializingBean`, `org.springframework.core.Ordered`, `org.springframework.core.PriorityOrdered`

@Deprecated public class PreferencesPlaceholderConfigurer extends PropertyPlaceholderConfigurer implements InitializingBean
Deprecated.
as of 5.2, along with `PropertyPlaceholderConfigurer`
Subclass of PropertyPlaceholderConfigurer that supports JDK 1.4's Preferences API (`java.util.prefs`).

Tries to resolve placeholders as keys first in the user preferences, then in the system preferences, then in this configurer's properties. Thus, behaves like PropertyPlaceholderConfigurer if no corresponding preferences defined.

Supports custom paths for the system and user preferences trees. Also supports custom paths specified in placeholders ("myPath/myPlaceholderKey"). Uses the respective root node if not specified.

Since:
  16.02.2004
Author:
  Juergen Hoeller
See Also:
  - `setSystemTreePath(java.lang.String)`
  - `setUserTreePath(java.lang.String)`
  - `Preferences`

## Field Summary

### Fields inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer

`SYSTEM_PROPERTIES_MODE_FALLBACK, SYSTEM_PROPERTIES_MODE_NEVER, SYSTEM_PROPERTIES_MODE_OVERRIDE`

### Fields inherited from class org.springframework.beans.factory.config.PlaceholderConfigurerSupport

`DEFAULT_ESCAPE_CHARACTER, DEFAULT_PLACEHOLDER_PREFIX, DEFAULT_PLACEHOLDER_SUFFIX, DEFAULT_VALUE_SEPARATOR, escapeCharacter, ignoreUnresolvablePlaceholders, nullValue, placeholderPrefix, placeholderSuffix, trimValues, valueSeparator`

### Fields inherited from class org.springframework.core.io.support.PropertiesLoaderSupport

`localOverride, localProperties, logger`

### Fields inherited from interface org.springframework.core.Ordered

`HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

## Constructor Summary

Constructors
Constructor
Description
`PreferencesPlaceholderConfigurer()`
Deprecated.

## Method Summary

Modifier and Type
Method
Description
`void`
`afterPropertiesSet()`
Deprecated.
This implementation eagerly fetches the Preferences instances for the required system and user tree nodes.
`protected String`
`resolvePlaceholder(String path, String key, Preferences preferences)`
Deprecated.
Resolve the given path and key against the given Preferences.
`protected String`
`resolvePlaceholder(String placeholder, Properties props)`
Deprecated.
This implementation tries to resolve placeholders as keys first in the user preferences, then in the system preferences, then in the passed-in properties.
`void`
`setSystemTreePath(String systemTreePath)`
Deprecated.
Set the path in the system preferences tree to use for resolving placeholders.
`void`
`setUserTreePath(String userTreePath)`
Deprecated.
Set the path in the system preferences tree to use for resolving placeholders.

### Methods inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer

`processProperties, resolvePlaceholder, resolveSystemProperty, setSearchSystemEnvironment, setSystemPropertiesMode, setSystemPropertiesModeName`

### Methods inherited from class org.springframework.beans.factory.config.PlaceholderConfigurerSupport

`doProcessProperties, setBeanFactory, setBeanName, setEscapeCharacter, setIgnoreUnresolvablePlaceholders, setNullValue, setPlaceholderPrefix, setPlaceholderSuffix, setTrimValues, setValueSeparator`

### Methods inherited from class org.springframework.beans.factory.config.PropertyResourceConfigurer

`convertProperties, convertProperty, convertPropertyValue, getOrder, postProcessBeanFactory, setOrder`

### Methods inherited from class org.springframework.core.io.support.PropertiesLoaderSupport

`loadProperties, mergeProperties, setFileEncoding, setIgnoreResourceNotFound, setLocalOverride, setLocation, setLocations, setProperties, setPropertiesArray, setPropertiesPersister`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### PreferencesPlaceholderConfigurer

public PreferencesPlaceholderConfigurer()
Deprecated.

## Method Details

### setSystemTreePath

public void setSystemTreePath(String systemTreePath)
Deprecated.
Set the path in the system preferences tree to use for resolving placeholders. Default is the root node.

### setUserTreePath

public void setUserTreePath(String userTreePath)
Deprecated.
Set the path in the system preferences tree to use for resolving placeholders. Default is the root node.

### afterPropertiesSet

public void afterPropertiesSet()
Deprecated.
This implementation eagerly fetches the Preferences instances for the required system and user tree nodes.

Specified by:
  `afterPropertiesSet` in interface `InitializingBean`

### resolvePlaceholder

protected String resolvePlaceholder(String placeholder, Properties props)
Deprecated.
This implementation tries to resolve placeholders as keys first in the user preferences, then in the system preferences, then in the passed-in properties.

Overrides:
  `resolvePlaceholder` in class `PropertyPlaceholderConfigurer`
Parameters:
  `placeholder` - the placeholder to resolve
  `props` - the merged properties of this configurer
Returns:
  the resolved value, of `null` if none
See Also:
  - `PropertyPlaceholderConfigurer.setSystemPropertiesMode(int)`

### resolvePlaceholder

@Nullable protected String resolvePlaceholder(@Nullable String path, String key, Preferences preferences)
Deprecated.
Resolve the given path and key against the given Preferences.

Parameters:
  `path` - the preferences path (placeholder part before '/')
  `key` - the preferences key (placeholder part after '/')
  `preferences` - the Preferences to resolve against
Returns:
  the value for the placeholder, or `null` if none found