org.springframework.beans.propertyeditors
Class CharacterEditor
java.lang.Object
java.beans.PropertyEditorSupport
org.springframework.beans.propertyeditors.CharacterEditor
- All Implemented Interfaces:
- PropertyEditor
public class CharacterEditor
- extends PropertyEditorSupport
Editor for a java.lang.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.
- Since:
- 1.2
- Author:
- Juergen Hoeller, Rob Harrop
- See Also:
Character
,
BeanWrapperImpl
Constructor Summary |
CharacterEditor(boolean allowEmpty)
Create a new CharacterEditor instance. |
Methods inherited from class java.beans.PropertyEditorSupport |
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CharacterEditor
public CharacterEditor(boolean allowEmpty)
- 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. Else, an IllegalArgumentException gets
thrown in that case.
- Parameters:
allowEmpty
- if empty strings are to be allowed
setAsText
public void setAsText(String text)
throws IllegalArgumentException
- Specified by:
setAsText
in interface PropertyEditor
- Overrides:
setAsText
in class PropertyEditorSupport
- Throws:
IllegalArgumentException
getAsText
public String getAsText()
- Specified by:
getAsText
in interface PropertyEditor
- Overrides:
getAsText
in class PropertyEditorSupport
Copyright (c) 2002-2007 The Spring Framework Project.