|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.beans.PropertyEditorSupport
org.springframework.beans.propertyeditors.URIEditor
public class URIEditor
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.
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.
URI
,
URLEditor
Constructor Summary | |
---|---|
URIEditor()
Create a new URIEditor, converting "classpath:" locations into standard URIs (not trying to resolve them into physical resources). |
|
URIEditor(java.lang.ClassLoader classLoader)
Create a new URIEditor, using the given ClassLoader to resolve "classpath:" locations into physical resource URLs. |
Method Summary | |
---|---|
protected java.net.URI |
createURI(java.lang.String value)
Create a URI instance for the given (resolved) String value. |
java.lang.String |
getAsText()
|
void |
setAsText(java.lang.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 URIEditor()
public URIEditor(java.lang.ClassLoader classLoader)
classLoader
- the ClassLoader to use for resolving "classpath:" locations
(may be null
to indicate the default ClassLoader)Method Detail |
---|
public void setAsText(java.lang.String text) throws java.lang.IllegalArgumentException
setAsText
in interface java.beans.PropertyEditor
setAsText
in class java.beans.PropertyEditorSupport
java.lang.IllegalArgumentException
protected java.net.URI createURI(java.lang.String value) throws java.net.URISyntaxException
The default implementation uses the URI(String)
constructor, replacing spaces with "%20" quotes first.
value
- the value to convert into a URI instance
java.net.URISyntaxException
- if URI conversion failedpublic java.lang.String getAsText()
getAsText
in interface java.beans.PropertyEditor
getAsText
in class java.beans.PropertyEditorSupport
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |