|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.beans.PropertyEditorSupport
org.springframework.core.io.ResourceEditor
public class ResourceEditor
Editor for Resource
descriptors, to automatically convert String locations
e.g. "file:C:/myfile.txt" or
"classpath:myfile.txt") to Resource
properties instead of using a String location property.
The path may contain ${...} placeholders, to be resolved
as system properties: e.g. ${user.dir}.
Delegates to a ResourceLoader to do the heavy lifting,
by default using a DefaultResourceLoader.
Resource,
ResourceLoader,
DefaultResourceLoader,
SystemPropertyUtils.resolvePlaceholders(java.lang.String),
System.getProperty(String)| Constructor Summary | |
|---|---|
ResourceEditor()
Create a new instance of the ResourceEditor class
using a DefaultResourceLoader. |
|
ResourceEditor(ResourceLoader resourceLoader)
Create a new instance of the ResourceEditor class
using the given ResourceLoader. |
|
| Method Summary | |
|---|---|
String |
getAsText()
|
protected String |
resolvePath(String path)
Resolve the given path, replacing placeholders with corresponding system property values if necessary. |
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 |
|---|
public ResourceEditor()
ResourceEditor class
using a DefaultResourceLoader.
public ResourceEditor(ResourceLoader resourceLoader)
ResourceEditor class
using the given ResourceLoader.
resourceLoader - the ResourceLoader to use| Method Detail |
|---|
public void setAsText(String text)
setAsText in interface PropertyEditorsetAsText in class PropertyEditorSupportprotected String resolvePath(String path)
path - the original file path
SystemPropertyUtils.resolvePlaceholders(java.lang.String)public String getAsText()
getAsText in interface PropertyEditorgetAsText in class PropertyEditorSupport
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||