org.springframework.core.env

## 类 PropertySourcesPropertyResolver

- java.lang.Object
- - org.springframework.core.env.AbstractPropertyResolver
  - - org.springframework.core.env.PropertySourcesPropertyResolver

- 所有已实现的接口:
    ConfigurablePropertyResolver, PropertyResolver

      public class PropertySourcesPropertyResolver
      extends AbstractPropertyResolver

  `PropertyResolver` implementation that resolves property values against an underlying set of `PropertySources`.
  从以下版本开始:
    3.1
  作者:
    Chris Beams, Juergen Hoeller
  另请参阅:
    `PropertySource`, `PropertySources`, `AbstractEnvironment`

- - ### 字段概要

    - ### 从类继承的字段 org.springframework.core.env.AbstractPropertyResolver

      `logger`

  - ### 构造器概要

    构造器
    构造器和说明
    `PropertySourcesPropertyResolver(PropertySources propertySources)` Create a new resolver against the given property sources.

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `boolean` | `containsProperty(String key)` Return whether the given property key is available for resolution, i.e. if the value for the given key is not `null`.
    `String` | `getProperty(String key)` Return the property value associated with the given key, or `null` if the key cannot be resolved.
    `<T> T` | `getProperty(String key, Class<T> targetValueType)` Return the property value associated with the given key, or `null` if the key cannot be resolved.
    `protected <T> T` | `getProperty(String key, Class<T> targetValueType, boolean resolveNestedPlaceholders)`
    `protected String` | `getPropertyAsRawString(String key)` Retrieve the specified property as a raw String, i.e. without resolution of nested placeholders.
    `protected void` | `logKeyFound(String key, PropertySource<?> propertySource, Object value)` Log the given key as found in the given `PropertySource`, resulting in the given value.

    - ### 从类继承的方法 org.springframework.core.env.AbstractPropertyResolver

      `convertValueIfNecessary, getConversionService, getProperty, getProperty, getRequiredProperty, getRequiredProperty, resolveNestedPlaceholders, resolvePlaceholders, resolveRequiredPlaceholders, setConversionService, setIgnoreUnresolvableNestedPlaceholders, setPlaceholderPrefix, setPlaceholderSuffix, setRequiredProperties, setValueSeparator, validateRequiredProperties`

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

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

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

    - #### PropertySourcesPropertyResolver

          public PropertySourcesPropertyResolver(@Nullable
                                                 PropertySources propertySources)

      Create a new resolver against the given property sources.
      参数:
        `propertySources` - the set of `PropertySource` objects to use

  - ### 方法详细资料

    - #### containsProperty

          public boolean containsProperty(String key)

      从接口复制的说明: `PropertyResolver`
      Return whether the given property key is available for resolution, i.e. if the value for the given key is not `null`.
      指定者:
        `containsProperty` 在接口中 `PropertyResolver`
      覆盖:
        `containsProperty` 在类中 `AbstractPropertyResolver`

    - #### getProperty

          @Nullable
          public String getProperty(String key)

      从接口复制的说明: `PropertyResolver`
      Return the property value associated with the given key, or `null` if the key cannot be resolved.
      指定者:
        `getProperty` 在接口中 `PropertyResolver`
      覆盖:
        `getProperty` 在类中 `AbstractPropertyResolver`
      参数:
        `key` - the property name to resolve
      另请参阅:
        `PropertyResolver.getProperty(String, String)`, `PropertyResolver.getProperty(String, Class)`, `PropertyResolver.getRequiredProperty(String)`

    - #### getProperty

          @Nullable
          public <T> T getProperty(String key,
                                              Class<T> targetValueType)

      从接口复制的说明: `PropertyResolver`
      Return the property value associated with the given key, or `null` if the key cannot be resolved.
      参数:
        `key` - the property name to resolve
        `targetValueType` - the expected type of the property value
      另请参阅:
        `PropertyResolver.getRequiredProperty(String, Class)`

    - #### getPropertyAsRawString

          @Nullable
          protected String getPropertyAsRawString(String key)

      从类复制的说明: `AbstractPropertyResolver`
      Retrieve the specified property as a raw String, i.e. without resolution of nested placeholders.
      指定者:
        `getPropertyAsRawString` 在类中 `AbstractPropertyResolver`
      参数:
        `key` - the property name to resolve
      返回:
        the property value or `null` if none found

    - #### getProperty

          @Nullable
          protected <T> T getProperty(String key,
                                                 Class<T> targetValueType,
                                                 boolean resolveNestedPlaceholders)

    - #### logKeyFound

          protected void logKeyFound(String key,
                                     PropertySource<?> propertySource,
                                     Object value)

      Log the given key as found in the given `PropertySource`, resulting in the given value.

      The default implementation writes a debug log message with key and source. As of 4.3.3, this does not log the value anymore in order to avoid accidental logging of sensitive settings. Subclasses may override this method to change the log level and/or log message, including the property's value if desired.

      参数:
        `key` - the key found
        `propertySource` - the `PropertySource` that the key has been found in
        `value` - the corresponding value
      从以下版本开始:
        4.3.1