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

CharacterEditor

open class CharacterEditor : PropertyEditorSupport

Editor for a Character, to populate a property of type Character or char from a String value.

Note that the JDK does not contain a default java.beans.PropertyEditor for char! org.springframework.beans.BeanWrapperImpl will register this editor by default.

Also supports conversion from a Unicode character sequence; e.g. u0041 ('A').

Author
Juergen Hoeller

Author
Rob Harrop

Author
Rick Evans

Since
1.2

See Also
Characterorg.springframework.beans.BeanWrapperImpl

Constructors

<init>

CharacterEditor(allowEmpty: Boolean)

Create a new CharacterEditor instance.

The "allowEmpty" parameter controls whether an empty String is to be allowed in parsing, i.e. be interpreted as the null value when text is being converted. If false, an IllegalArgumentException will be thrown at that time.

Functions

getAsText

open fun getAsText(): String

setAsText

open fun setAsText(text: String): Unit