spring-framework / org.springframework.beans.propertyeditors / StringArrayPropertyEditor

StringArrayPropertyEditor

open class StringArrayPropertyEditor : PropertyEditorSupport

Custom java.beans.PropertyEditor for String arrays.

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

Author
Rod Johnson

Author
Juergen Hoeller

Author
Dave Syer

See Also
org.springframework.util.StringUtils#delimitedListToStringArrayorg.springframework.util.StringUtils#arrayToDelimitedString

Constructors

<init>

StringArrayPropertyEditor()

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

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

StringArrayPropertyEditor(separator: String)

Create a new StringArrayPropertyEditor with the given separator.

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

StringArrayPropertyEditor(separator: String, emptyArrayAsNull: Boolean)
StringArrayPropertyEditor(separator: String, emptyArrayAsNull: Boolean, trimValues: Boolean)
StringArrayPropertyEditor(separator: String, charsToDelete: String, emptyArrayAsNull: Boolean)
StringArrayPropertyEditor(separator: String, charsToDelete: String, emptyArrayAsNull: Boolean, trimValues: Boolean)

Create a new StringArrayPropertyEditor with the given separator.

Properties

DEFAULT_SEPARATOR

static val DEFAULT_SEPARATOR: String

Default separator for splitting a String: a comma (",")

Functions

getAsText

open fun getAsText(): String

setAsText

open fun setAsText(text: String): Unit