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.
org.springframework.util.StringUtils#delimitedListToStringArray , org.springframework.util.StringUtils#arrayToDelimitedString
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| public static final String | DEFAULT_SEPARATOR
Default separator for splitting a String: a comma (","). |
| private final boolean | |
| private final String | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | StringArrayPropertyEditor()
Create a new |
| public | StringArrayPropertyEditor(String
the separator to use for splitting a separator)StringCreate a new |
| public | StringArrayPropertyEditor(String
the separator to use for splitting a separator, boolean Stringtrue if an empty String array
is to be transformed into nullCreate a new |
| public | StringArrayPropertyEditor(String
the separator to use for splitting a separator, boolean Stringtrue if an empty String array
is to be transformed into nulltrue if the values in the parsed arrays
are to be trimmed of whitespace (default is true)Create a new |
| public | StringArrayPropertyEditor(String
the separator to use for splitting a separator, String Stringa 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. charsToDelete, boolean true if an empty String array
is to be transformed into nullCreate a new |
| public | StringArrayPropertyEditor(String
the separator to use for splitting a separator, String Stringa 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. charsToDelete, boolean true if an empty String array
is to be transformed into nulltrue if the values in the parsed arrays
are to be trimmed of whitespace (default is true)Create a new |
| Modifier and Type | Method and Description |
|---|---|
| public String | getAsText()
Overrides java. Implements java. Gets the property value as a string suitable for presentation to a human to edit. |
| public void | setAsText(String
The string to be parsed. text)Overrides java. Implements java. Sets the property value by parsing a given String. |
| charsToDelete | back to summary |
|---|---|
| private final String charsToDelete
| |
| DEFAULT_SEPARATOR | back to summary |
|---|---|
| public static final String DEFAULT_SEPARATOR Default separator for splitting a String: a comma (","). | |
| emptyArrayAsNull | back to summary |
|---|---|
| private final boolean emptyArrayAsNull | |
| separator | back to summary |
|---|---|
| private final String separator | |
| trimValues | back to summary |
|---|---|
| private final boolean trimValues | |
| StringArrayPropertyEditor | back to summary |
|---|---|
| public StringArrayPropertyEditor() Create a new An empty text (without elements) will be turned into an empty array. | |
| StringArrayPropertyEditor | back to summary |
|---|---|
| public StringArrayPropertyEditor(String separator) Create a new An empty text (without elements) will be turned into an empty array. | |
| StringArrayPropertyEditor | back to summary |
|---|---|
| public StringArrayPropertyEditor(String separator, boolean emptyArrayAsNull) Create a new | |
| StringArrayPropertyEditor | back to summary |
|---|---|
| public StringArrayPropertyEditor(String separator, boolean emptyArrayAsNull, boolean trimValues) Create a new | |
| StringArrayPropertyEditor | back to summary |
|---|---|
| public StringArrayPropertyEditor(String separator, String charsToDelete, boolean emptyArrayAsNull) Create a new
| |
| StringArrayPropertyEditor | back to summary |
|---|---|
| public StringArrayPropertyEditor(String separator, String charsToDelete, boolean emptyArrayAsNull, boolean trimValues) Create a new
| |
| getAsText | back to summary |
|---|---|
| public String getAsText() Overrides java. Implements java. Doc from java. Gets the property value as a string suitable for presentation to a human to edit. | |
| setAsText | back to summary |
|---|---|
| public void setAsText(String text) throws IllegalArgumentException Overrides java. Implements java. Doc from java. Sets the property value by parsing a given String. May raise java.lang.IllegalArgumentException if either the String is badly formatted or if this kind of property can't be expressed as text. | |