类 URLEditor
- java.lang.Object
- java.beans.PropertyEditorSupport
- org.springframework.beans.propertyeditors.URLEditor
- 所有已实现的接口:
PropertyEditor
public class URLEditor extends PropertyEditorSupport
Editor forjava.net.URL
, to directly populate a URL property instead of using a String property as bridge.Supports Spring-style URL notation: any fully qualified standard URL ("file:", "http:", etc) and Spring's special "classpath:" pseudo-URL, as well as Spring's context-specific relative file paths.
Note: A URL must specify a valid protocol, else it will be rejected upfront. However, the target resource does not necessarily have to exist at the time of URL creation; this depends on the specific resource type.
- 从以下版本开始:
- 15.12.2003
- 作者:
- Juergen Hoeller
- 另请参阅:
URL
,ResourceEditor
,ResourceLoader
,FileEditor
,InputStreamEditor
构造器概要
构造器 构造器 说明 URLEditor()
Create a new URLEditor, using a default ResourceEditor underneath.URLEditor(ResourceEditor resourceEditor)
Create a new URLEditor, using the given ResourceEditor underneath.
构造器详细资料
URLEditor
public URLEditor()
Create a new URLEditor, using a default ResourceEditor underneath.
URLEditor
public URLEditor(ResourceEditor resourceEditor)
Create a new URLEditor, 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