类 FileEditor
- java.lang.Object
- java.beans.PropertyEditorSupport
- org.springframework.beans.propertyeditors.FileEditor
- 所有已实现的接口:
PropertyEditor
public class FileEditor extends PropertyEditorSupport
Editor forjava.io.File
, to directly populate a File property from a Spring resource location.Supports Spring-style URL notation: any fully qualified standard URL ("file:", "http:", etc) and Spring's special "classpath:" pseudo-URL.
NOTE: The behavior of this editor has changed in Spring 2.0. Previously, it created a File instance directly from a filename. As of Spring 2.0, it takes a standard Spring resource location as input; this is consistent with URLEditor and InputStreamEditor now.
NOTE: In Spring 2.5 the following modification was made. If a file name is specified without a URL prefix or without an absolute path then we try to locate the file using standard ResourceLoader semantics. If the file was not found, then a File instance is created assuming the file name refers to a relative file location.
- 从以下版本开始:
- 09.12.2003
- 作者:
- Juergen Hoeller, Thomas Risberg
- 另请参阅:
File
,ResourceEditor
,ResourceLoader
,URLEditor
,InputStreamEditor
构造器概要
构造器 构造器 说明 FileEditor()
Create a new FileEditor, using a default ResourceEditor underneath.FileEditor(ResourceEditor resourceEditor)
Create a new FileEditor, using the given ResourceEditor underneath.
构造器详细资料
FileEditor
public FileEditor()
Create a new FileEditor, using a default ResourceEditor underneath.
FileEditor
public FileEditor(ResourceEditor resourceEditor)
Create a new FileEditor, using the given ResourceEditor underneath.- 参数:
resourceEditor
- the ResourceEditor to use
方法详细资料
setAsText
public void setAsText(String text) throws IllegalArgumentException
- 指定者:
setAsText
在接口中PropertyEditor
- 覆盖:
setAsText
在类中PropertyEditorSupport
- 抛出:
IllegalArgumentException
getAsText
public String getAsText()
- 指定者:
getAsText
在接口中PropertyEditor
- 覆盖:
getAsText
在类中PropertyEditorSupport