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.
java.net.URI , URLEditor
| Modifier and Type | Field and Description |
|---|---|
| private final ClassLoader | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | URIEditor()
Create a new, encoding URIEditor, converting "classpath:" locations into standard URIs (not trying to resolve them into physical resources). |
| public | URIEditor(boolean
indicates whether Strings will be encoded or not encode)Create a new URIEditor, converting "classpath:" locations into standard URIs (not trying to resolve them into physical resources). |
| public | URIEditor(ClassLoader
the ClassLoader to use for resolving "classpath:" locations
(may be classLoader)null to indicate the default ClassLoader)Create a new URIEditor, using the given ClassLoader to resolve "classpath:" locations into physical resource URLs. |
| public | URIEditor(ClassLoader
the ClassLoader to use for resolving "classpath:" locations
(may be classLoader, boolean null to indicate the default ClassLoader)indicates whether Strings will be encoded or not encode)Create a new URIEditor, using the given ClassLoader to resolve "classpath:" locations into physical resource URLs. |
| Modifier and Type | Method and Description |
|---|---|
| protected URI | |
| public String | getAsText()
Overrides java. Implements java. Gets the property value as a string suitable for presentation to a human to edit. |
| public void | setAsText(String
The string to be parsed. text)Overrides java. Implements java. Sets the property value by parsing a given String. |
| classLoader | back to summary |
|---|---|
| private final ClassLoader classLoader
| |
| encode | back to summary |
|---|---|
| private final boolean encode | |
| URIEditor | back to summary |
|---|---|
| public URIEditor() Create a new, encoding URIEditor, converting "classpath:" locations into standard URIs (not trying to resolve them into physical resources). | |
| URIEditor | back to summary |
|---|---|
| public URIEditor(boolean encode) Create a new URIEditor, converting "classpath:" locations into standard URIs (not trying to resolve them into physical resources).
| |
| URIEditor | back to summary |
|---|---|
| public URIEditor(ClassLoader classLoader) Create a new URIEditor, using the given ClassLoader to resolve "classpath:" locations into physical resource URLs.
| |
| URIEditor | back to summary |
|---|---|
| public URIEditor(ClassLoader classLoader, boolean encode) Create a new URIEditor, using the given ClassLoader to resolve "classpath:" locations into physical resource URLs.
| |
| createURI | back to summary |
|---|---|
| protected URI createURI(String value) throws URISyntaxException Create a URI instance for the given user-specified String value. The default implementation encodes the value into an RFC-2396 compliant URI.
| |
| getAsText | back to summary |
|---|---|
| public String getAsText() Overrides java. Implements java. Doc from java. Gets the property value as a string suitable for presentation to a human to edit. | |
| setAsText | back to summary |
|---|---|
| public void setAsText(String text) throws IllegalArgumentException Overrides java. Implements java. Doc from java. Sets the property value by parsing a given String. May raise java.lang.IllegalArgumentException if either the String is badly formatted or if this kind of property can't be expressed as text. | |