类 StringTrimmerEditor
- java.lang.Object
- java.beans.PropertyEditorSupport
- org.springframework.beans.propertyeditors.StringTrimmerEditor
- 所有已实现的接口:
PropertyEditor
public class StringTrimmerEditor extends PropertyEditorSupport
Property editor that trims Strings.Optionally allows transforming an empty string into a
null
value. Needs to be explicitly registered, e.g. for command binding.- 作者:
- Juergen Hoeller
- 另请参阅:
DataBinder.registerCustomEditor(java.lang.Class<?>, java.beans.PropertyEditor)
构造器概要
构造器 构造器 说明 StringTrimmerEditor(boolean emptyAsNull)
Create a new StringTrimmerEditor.StringTrimmerEditor(String charsToDelete, boolean emptyAsNull)
Create a new StringTrimmerEditor.
构造器详细资料
StringTrimmerEditor
public StringTrimmerEditor(boolean emptyAsNull)
Create a new StringTrimmerEditor.- 参数:
emptyAsNull
-true
if an empty String is to be transformed intonull
StringTrimmerEditor
public StringTrimmerEditor(String charsToDelete, boolean emptyAsNull)
Create a new StringTrimmerEditor.- 参数:
charsToDelete
- a set of characters to delete, in addition to trimming an input String. Useful for deleting unwanted line breaks: e.g. "\r\n\f" will delete all new lines and line feeds in a String.emptyAsNull
-true
if an empty String is to be transformed intonull
方法详细资料
setAsText
public void setAsText(String text)
- 指定者:
setAsText
在接口中PropertyEditor
- 覆盖:
setAsText
在类中PropertyEditorSupport
getAsText
public String getAsText()
- 指定者:
getAsText
在接口中PropertyEditor
- 覆盖:
getAsText
在类中PropertyEditorSupport