public class CharacterEditor extends PropertyEditorSupport
Character, to populate a property
of type Character or char from a String value.
Note that the JDK does not contain a default
property editor for char!
BeanWrapperImpl will register this
editor by default.
Also supports conversion from a Unicode character sequence; e.g.
u0041 ('A').
Character,
BeanWrapperImpl| 构造器和说明 |
|---|
CharacterEditor(boolean allowEmpty)
Create a new CharacterEditor instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getAsText() |
void |
setAsText(String text) |
public CharacterEditor(boolean allowEmpty)
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.
allowEmpty - if empty strings are to be allowedpublic void setAsText(@Nullable
String text)
throws IllegalArgumentException
setAsText 在接口中 PropertyEditorsetAsText 在类中 PropertyEditorSupportIllegalArgumentExceptionpublic String getAsText()
getAsText 在接口中 PropertyEditorgetAsText 在类中 PropertyEditorSupport