站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.0.5 API 文档英文版

FileEditor (Spring Framework API 2.0) - Spring Framework 2.0.5 API 文档英文版

The Spring Framework

org.springframework.beans.propertyeditors
Class FileEditor

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by org.springframework.beans.propertyeditors.FileEditor
All Implemented Interfaces:
PropertyEditor

public class FileEditor
extends PropertyEditorSupport

Editor for java.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.

Since:
09.12.2003
Author:
Juergen Hoeller
See Also:
File, ResourceEditor, ResourceLoader, URLEditor, InputStreamEditor

Constructor Summary
FileEditor()
          Create a new FileEditor, using the default ResourceEditor underneath.
FileEditor(ResourceEditor resourceEditor)
          Create a new FileEditor, using the given ResourceEditor underneath.
 
Method Summary
 String getAsText()
           
 void setAsText(String text)
           
 
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
 

Constructor Detail

FileEditor

public FileEditor()
Create a new FileEditor, using the default ResourceEditor underneath.


FileEditor

public FileEditor(ResourceEditor resourceEditor)
Create a new FileEditor, using the given ResourceEditor underneath.

Parameters:
resourceEditor - the ResourceEditor to use
Method Detail

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

The Spring Framework

Copyright © 2002-2007 The Spring Framework.