org.springframework.beans.propertyeditors

## 类 StringArrayPropertyEditor

- java.lang.Object
- - java.beans.PropertyEditorSupport
  - - org.springframework.beans.propertyeditors.StringArrayPropertyEditor

- 所有已实现的接口:
    PropertyEditor

      public class StringArrayPropertyEditor
      extends PropertyEditorSupport

  Custom `PropertyEditor` for String arrays.

  Strings must be in CSV format, with a customizable separator. By default values in the result are trimmed of whitespace.

  作者:
    Rod Johnson, Juergen Hoeller, Dave Syer
  另请参阅:
    `StringUtils.delimitedListToStringArray(java.lang.String, java.lang.String)`, `StringUtils.arrayToDelimitedString(java.lang.Object[], java.lang.String)`

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `static String` | `DEFAULT_SEPARATOR` Default separator for splitting a String: a comma (",")

  - ### 构造器概要

    构造器
    构造器和说明
    `StringArrayPropertyEditor()` Create a new StringArrayPropertyEditor with the default separator (a comma).
    `StringArrayPropertyEditor(String separator)` Create a new StringArrayPropertyEditor with the given separator.
    `StringArrayPropertyEditor(String separator, boolean emptyArrayAsNull)` Create a new StringArrayPropertyEditor with the given separator.
    `StringArrayPropertyEditor(String separator, boolean emptyArrayAsNull, boolean trimValues)` Create a new StringArrayPropertyEditor with the given separator.
    `StringArrayPropertyEditor(String separator, String charsToDelete, boolean emptyArrayAsNull)` Create a new StringArrayPropertyEditor with the given separator.
    `StringArrayPropertyEditor(String separator, String charsToDelete, boolean emptyArrayAsNull, boolean trimValues)` Create a new StringArrayPropertyEditor with the given separator.

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `String` | `getAsText()`
    `void` | `setAsText(String text)`

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

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

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

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

- - ### 字段详细资料

    - #### DEFAULT_SEPARATOR

          public static final String DEFAULT_SEPARATOR

      Default separator for splitting a String: a comma (",")
      另请参阅:
        常量字段值

  - ### 构造器详细资料

    - #### StringArrayPropertyEditor

          public StringArrayPropertyEditor()

      Create a new StringArrayPropertyEditor with the default separator (a comma).

      An empty text (without elements) will be turned into an empty array.

    - #### StringArrayPropertyEditor

          public StringArrayPropertyEditor(String separator)

      Create a new StringArrayPropertyEditor with the given separator.

      An empty text (without elements) will be turned into an empty array.

      参数:
        `separator` - the separator to use for splitting a `String`

    - #### StringArrayPropertyEditor

          public StringArrayPropertyEditor(String separator,
                                           boolean emptyArrayAsNull)

      Create a new StringArrayPropertyEditor with the given separator.
      参数:
        `separator` - the separator to use for splitting a `String`
        `emptyArrayAsNull` - `true` if an empty String array is to be transformed into `null`

    - #### StringArrayPropertyEditor

          public StringArrayPropertyEditor(String separator,
                                           boolean emptyArrayAsNull,
                                           boolean trimValues)

      Create a new StringArrayPropertyEditor with the given separator.
      参数:
        `separator` - the separator to use for splitting a `String`
        `emptyArrayAsNull` - `true` if an empty String array is to be transformed into `null`
        `trimValues` - `true` if the values in the parsed arrays are to be trimmed of whitespace (default is true).

    - #### StringArrayPropertyEditor

          public StringArrayPropertyEditor(String separator,
                                           @Nullable
                                           String charsToDelete,
                                           boolean emptyArrayAsNull)

      Create a new StringArrayPropertyEditor with the given separator.
      参数:
        `separator` - the separator to use for splitting a `String`
        `charsToDelete` - a set of characters to delete, in addition to trimming an input String. Useful for deleting unwanted line breaks: e.g. "\r\n\f" will delete all new lines and line feeds in a String.
        `emptyArrayAsNull` - `true` if an empty String array is to be transformed into `null`

    - #### StringArrayPropertyEditor

          public StringArrayPropertyEditor(String separator,
                                           @Nullable
                                           String charsToDelete,
                                           boolean emptyArrayAsNull,
                                           boolean trimValues)

      Create a new StringArrayPropertyEditor with the given separator.
      参数:
        `separator` - the separator to use for splitting a `String`
        `charsToDelete` - a set of characters to delete, in addition to trimming an input String. Useful for deleting unwanted line breaks: e.g. "\r\n\f" will delete all new lines and line feeds in a String.
        `emptyArrayAsNull` - `true` if an empty String array is to be transformed into `null`
        `trimValues` - `true` if the values in the parsed arrays are to be trimmed of whitespace (default is true).

  - ### 方法详细资料

    - #### setAsText

          public void setAsText(String text)
                         throws IllegalArgumentException

      指定者:
        `setAsText` 在接口中 `PropertyEditor`
      覆盖:
        `setAsText` 在类中 `PropertyEditorSupport`
      抛出:
        `IllegalArgumentException`

    - #### getAsText

          public String getAsText()

      指定者:
        `getAsText` 在接口中 `PropertyEditor`
      覆盖:
        `getAsText` 在类中 `PropertyEditorSupport`