类 CharacterEditor
- java.lang.Object
- java.beans.PropertyEditorSupport
- org.springframework.beans.propertyeditors.CharacterEditor
- 所有已实现的接口:
PropertyEditor
public class CharacterEditor extends PropertyEditorSupport
Editor for aCharacter
, to populate a property of typeCharacter
orchar
from a String value.Note that the JDK does not contain a default
property editor
forchar
!BeanWrapperImpl
will register this editor by default.Also supports conversion from a Unicode character sequence; e.g.
u0041
('A').- 从以下版本开始:
- 1.2
- 作者:
- Juergen Hoeller, Rob Harrop, Rick Evans
- 另请参阅:
Character
,BeanWrapperImpl
构造器概要
构造器 构造器 说明 CharacterEditor(boolean allowEmpty)
Create a new CharacterEditor instance.
构造器详细资料
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 whentext is being converted
. Iffalse
, anIllegalArgumentException
will be thrown at that time.- 参数:
allowEmpty
- if empty strings are to be allowed
方法详细资料
setAsText
public void setAsText(String text) throws IllegalArgumentException
- 指定者:
setAsText
在接口中PropertyEditor
- 覆盖:
setAsText
在类中PropertyEditorSupport
- 抛出:
IllegalArgumentException
getAsText
public String getAsText()
- 指定者:
getAsText
在接口中PropertyEditor
- 覆盖:
getAsText
在类中PropertyEditorSupport