Class URIEditor
java.lang.Object
java.beans.PropertyEditorSupport
org.springframework.beans.propertyeditors.URIEditor
- All Implemented Interfaces:
- PropertyEditor
Editor for 
java.net.URI, to directly populate a URI property
 instead of using a String property as bridge.
 Supports Spring-style URI notation: any fully qualified standard URI ("file:", "http:", etc) and Spring's special "classpath:" pseudo-URL, which will be resolved to a corresponding URI.
By default, this editor will encode Strings into URIs. For instance,
 a space will be encoded into %20. This behavior can be changed
 by calling the URIEditor(boolean) constructor.
 
Note: A URI is more relaxed than a URL in that it does not require a valid protocol to be specified. Any scheme within a valid URI syntax is allowed, even without a matching protocol handler being registered.
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a new, encoding URIEditor, converting "classpath:" locations into standard URIs (not trying to resolve them into physical resources).URIEditor(boolean encode) Create a new URIEditor, converting "classpath:" locations into standard URIs (not trying to resolve them into physical resources).URIEditor(ClassLoader classLoader) Create a new URIEditor, using the given ClassLoader to resolve "classpath:" locations into physical resource URLs.URIEditor(ClassLoader classLoader, boolean encode) Create a new URIEditor, using the given ClassLoader to resolve "classpath:" locations into physical resource URLs.
- 
Method SummaryMethods inherited from class java.beans.PropertyEditorSupportaddPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
- 
Constructor Details- 
URIEditorpublic URIEditor()Create a new, encoding URIEditor, converting "classpath:" locations into standard URIs (not trying to resolve them into physical resources).
- 
URIEditorpublic URIEditor(boolean encode) Create a new URIEditor, converting "classpath:" locations into standard URIs (not trying to resolve them into physical resources).- Parameters:
- encode- indicates whether Strings will be encoded or not
- Since:
- 3.0
 
- 
URIEditorCreate a new URIEditor, using the given ClassLoader to resolve "classpath:" locations into physical resource URLs.- Parameters:
- classLoader- the ClassLoader to use for resolving "classpath:" locations (may be- nullto indicate the default ClassLoader)
 
- 
URIEditorCreate a new URIEditor, using the given ClassLoader to resolve "classpath:" locations into physical resource URLs.- Parameters:
- classLoader- the ClassLoader to use for resolving "classpath:" locations (may be- nullto indicate the default ClassLoader)
- encode- indicates whether Strings will be encoded or not
- Since:
- 3.0
 
 
- 
- 
Method Details- 
setAsText- Specified by:
- setAsTextin interface- PropertyEditor
- Overrides:
- setAsTextin class- PropertyEditorSupport
- Throws:
- IllegalArgumentException
 
- 
createURICreate a URI instance for the given user-specified String value.The default implementation encodes the value into an RFC-2396 compliant URI. - Parameters:
- value- the value to convert into a URI instance
- Returns:
- the URI instance
- Throws:
- URISyntaxException- if URI conversion failed
 
- 
getAsText- Specified by:
- getAsTextin interface- PropertyEditor
- Overrides:
- getAsTextin class- PropertyEditorSupport
 
 
-