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
Constructor and Description |
---|
CharacterEditor(boolean allowEmpty)
Create a new CharacterEditor instance.
|
Modifier and Type | Method and Description |
---|---|
String |
getAsText() |
void |
setAsText(String text) |
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
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(String text) throws IllegalArgumentException
setAsText
in interface PropertyEditor
setAsText
in class PropertyEditorSupport
IllegalArgumentException
public String getAsText()
getAsText
in interface PropertyEditor
getAsText
in class PropertyEditorSupport