public class URLEditor extends PropertyEditorSupport
java.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.
URL,
ResourceEditor,
ResourceLoader,
FileEditor,
InputStreamEditor| 构造器和说明 |
|---|
URLEditor()
Create a new URLEditor, using a default ResourceEditor underneath.
|
URLEditor(org.springframework.core.io.ResourceEditor resourceEditor)
Create a new URLEditor, using the given ResourceEditor underneath.
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getAsText() |
void |
setAsText(String text) |
public URLEditor()
public URLEditor(org.springframework.core.io.ResourceEditor resourceEditor)
resourceEditor - the ResourceEditor to usepublic void setAsText(String text) throws IllegalArgumentException
setAsText 在接口中 PropertyEditorsetAsText 在类中 PropertyEditorSupportIllegalArgumentExceptionpublic String getAsText()
getAsText 在接口中 PropertyEditorgetAsText 在类中 PropertyEditorSupport