org.springframework.beans.factory.config

## 类 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

- 所有已实现的接口:
    Aware, BeanFactoryAware, BeanNameAware, BeanFactoryPostProcessor, InitializingBean, org.springframework.core.Ordered, org.springframework.core.PriorityOrdered

      public class PreferencesPlaceholderConfigurer
      extends PropertyPlaceholderConfigurer
      implements InitializingBean

  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.

  从以下版本开始:
    16.02.2004
  作者:
    Juergen Hoeller
  另请参阅:
    `setSystemTreePath(java.lang.String)`, `setUserTreePath(java.lang.String)`, `Preferences`

- - ### 字段概要

    - ### 从类继承的字段 org.springframework.beans.factory.config.PropertyPlaceholderConfigurer

      `SYSTEM_PROPERTIES_MODE_FALLBACK, SYSTEM_PROPERTIES_MODE_NEVER, SYSTEM_PROPERTIES_MODE_OVERRIDE`

    - ### 从类继承的字段 org.springframework.beans.factory.config.PlaceholderConfigurerSupport

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

    - ### 从类继承的字段 org.springframework.core.io.support.PropertiesLoaderSupport

      `localOverride, localProperties, logger`

    - ### 从接口继承的字段 org.springframework.core.Ordered

      `HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

  - ### 构造器概要

    构造器
    构造器和说明
    `PreferencesPlaceholderConfigurer()`

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `afterPropertiesSet()` This implementation eagerly fetches the Preferences instances for the required system and user tree nodes.
    `protected String` | `resolvePlaceholder(String placeholder, Properties props)` This implementation tries to resolve placeholders as keys first in the user preferences, then in the system preferences, then in the passed-in properties.
    `protected String` | `resolvePlaceholder(String path, String key, Preferences preferences)` Resolve the given path and key against the given Preferences.
    `void` | `setSystemTreePath(String systemTreePath)` Set the path in the system preferences tree to use for resolving placeholders.
    `void` | `setUserTreePath(String userTreePath)` Set the path in the system preferences tree to use for resolving placeholders.

    - ### 从类继承的方法 org.springframework.beans.factory.config.PropertyPlaceholderConfigurer

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

    - ### 从类继承的方法 org.springframework.beans.factory.config.PlaceholderConfigurerSupport

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

    - ### 从类继承的方法 org.springframework.beans.factory.config.PropertyResourceConfigurer

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

    - ### 从类继承的方法 org.springframework.core.io.support.PropertiesLoaderSupport

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

    - ### 从类继承的方法 java.lang.Object

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

- - ### 构造器详细资料

    - #### PreferencesPlaceholderConfigurer

          public PreferencesPlaceholderConfigurer()

  - ### 方法详细资料

    - #### setSystemTreePath

          public void setSystemTreePath(String systemTreePath)

      Set the path in the system preferences tree to use for resolving placeholders. Default is the root node.

    - #### setUserTreePath

          public void setUserTreePath(String userTreePath)

      Set the path in the system preferences tree to use for resolving placeholders. Default is the root node.

    - #### afterPropertiesSet

          public void afterPropertiesSet()

      This implementation eagerly fetches the Preferences instances for the required system and user tree nodes.
      指定者:
        `afterPropertiesSet` 在接口中 `InitializingBean`

    - #### resolvePlaceholder

          protected String resolvePlaceholder(String placeholder,
                                              Properties props)

      This implementation tries to resolve placeholders as keys first in the user preferences, then in the system preferences, then in the passed-in properties.
      覆盖:
        `resolvePlaceholder` 在类中 `PropertyPlaceholderConfigurer`
      参数:
        `placeholder` - the placeholder to resolve
        `props` - the merged properties of this configurer
      返回:
        the resolved value, of `null` if none
      另请参阅:
        `PropertyPlaceholderConfigurer.setSystemPropertiesMode(int)`

    - #### resolvePlaceholder

          @Nullable
          protected String resolvePlaceholder(@Nullable
                                                         String path,
                                                         String key,
                                                         Preferences preferences)

      Resolve the given path and key against the given Preferences.
      参数:
        `path` - the preferences path (placeholder part before '/')
        `key` - the preferences key (placeholder part after '/')
        `preferences` - the Preferences to resolve against
      返回:
        the value for the placeholder, or `null` if none found