org.springframework.core.io.support

## 类 ResourceArrayPropertyEditor

- java.lang.Object
- - java.beans.PropertyEditorSupport
  - - org.springframework.core.io.support.ResourceArrayPropertyEditor

- 所有已实现的接口:
    PropertyEditor

      public class ResourceArrayPropertyEditor
      extends PropertyEditorSupport

  Editor for `Resource` arrays, to automatically convert `String` location patterns (e.g. `"file:C:/my*.txt"` or `"classpath*:myfile.txt"`) to `Resource` array properties. Can also translate a collection or array of location patterns into a merged Resource array.

  A path may contain `${...}` placeholders, to be resolved as `Environment` properties: e.g. `${user.dir}`. Unresolvable placeholders are ignored by default.

  Delegates to a `ResourcePatternResolver`, by default using a `PathMatchingResourcePatternResolver`.

  从以下版本开始:
    1.1.2
  作者:
    Juergen Hoeller, Chris Beams
  另请参阅:
    `Resource`, `ResourcePatternResolver`, `PathMatchingResourcePatternResolver`

- - ### 构造器概要

    构造器
    构造器和说明
    `ResourceArrayPropertyEditor()` Create a new ResourceArrayPropertyEditor with a default `PathMatchingResourcePatternResolver` and `StandardEnvironment`.
    `ResourceArrayPropertyEditor(ResourcePatternResolver resourcePatternResolver, PropertyResolver propertyResolver)` Create a new ResourceArrayPropertyEditor with the given `ResourcePatternResolver` and `PropertyResolver` (typically an `Environment`).
    `ResourceArrayPropertyEditor(ResourcePatternResolver resourcePatternResolver, PropertyResolver propertyResolver, boolean ignoreUnresolvablePlaceholders)` Create a new ResourceArrayPropertyEditor with the given `ResourcePatternResolver` and `PropertyResolver` (typically an `Environment`).

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected String` | `resolvePath(String path)` Resolve the given path, replacing placeholders with corresponding system property values if necessary.
    `void` | `setAsText(String text)` Treat the given text as a location pattern and convert it to a Resource array.
    `void` | `setValue(Object value)` Treat the given value as a collection or array and convert it to a Resource array.

    - ### 从类继承的方法 java.beans.PropertyEditorSupport

      `addPropertyChangeListener, firePropertyChange, getAsText, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, supportsCustomEditor`

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

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

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

    - #### ResourceArrayPropertyEditor

          public ResourceArrayPropertyEditor()

      Create a new ResourceArrayPropertyEditor with a default `PathMatchingResourcePatternResolver` and `StandardEnvironment`.
      另请参阅:
        `PathMatchingResourcePatternResolver`, `Environment`

    - #### ResourceArrayPropertyEditor

          public ResourceArrayPropertyEditor(ResourcePatternResolver resourcePatternResolver,
                                             @Nullable
                                             PropertyResolver propertyResolver)

      Create a new ResourceArrayPropertyEditor with the given `ResourcePatternResolver` and `PropertyResolver` (typically an `Environment`).
      参数:
        `resourcePatternResolver` - the ResourcePatternResolver to use
        `propertyResolver` - the PropertyResolver to use

    - #### ResourceArrayPropertyEditor

          public ResourceArrayPropertyEditor(ResourcePatternResolver resourcePatternResolver,
                                             @Nullable
                                             PropertyResolver propertyResolver,
                                             boolean ignoreUnresolvablePlaceholders)

      Create a new ResourceArrayPropertyEditor with the given `ResourcePatternResolver` and `PropertyResolver` (typically an `Environment`).
      参数:
        `resourcePatternResolver` - the ResourcePatternResolver to use
        `propertyResolver` - the PropertyResolver to use
        `ignoreUnresolvablePlaceholders` - whether to ignore unresolvable placeholders if no corresponding system property could be found

  - ### 方法详细资料

    - #### setAsText

          public void setAsText(String text)

      Treat the given text as a location pattern and convert it to a Resource array.
      指定者:
        `setAsText` 在接口中 `PropertyEditor`
      覆盖:
        `setAsText` 在类中 `PropertyEditorSupport`

    - #### setValue

          public void setValue(Object value)
                        throws IllegalArgumentException

      Treat the given value as a collection or array and convert it to a Resource array. Considers String elements as location patterns and takes Resource elements as-is.
      指定者:
        `setValue` 在接口中 `PropertyEditor`
      覆盖:
        `setValue` 在类中 `PropertyEditorSupport`
      抛出:
        `IllegalArgumentException`

    - #### resolvePath

          protected String resolvePath(String path)

      Resolve the given path, replacing placeholders with corresponding system property values if necessary.
      参数:
        `path` - the original file path
      返回:
        the resolved file path
      另请参阅:
        `PropertyResolver.resolvePlaceholders(java.lang.String)`, `PropertyResolver.resolveRequiredPlaceholders(String)`