Package org.jboss.common.beans.property
Class URIEditor
- java.lang.Object
-
- java.beans.PropertyEditorSupport
-
- org.jboss.common.beans.property.PropertyEditorSupport<java.net.URI>
-
- org.jboss.common.beans.property.URIEditor
-
- All Implemented Interfaces:
java.beans.PropertyEditor,PropertyEditor<java.net.URI>
public class URIEditor extends PropertyEditorSupport<java.net.URI>
A property editor forURI.
-
-
Constructor Summary
Constructors Constructor Description URIEditor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAsText()Gets the property value as text.private static java.net.URImakeURIFromFilespec(java.lang.String filespec)voidsetAsText(java.lang.String text)Set the property value by parsing a given String.static java.net.URItoURI(java.lang.String urispec)-
Methods inherited from class org.jboss.common.beans.property.PropertyEditorSupport
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getType, getValue, removePropertyChangeListener, removePropertyChangeListener, setValue
-
-
-
-
Method Detail
-
setAsText
public void setAsText(java.lang.String text)
Description copied from interface:PropertyEditorSet 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.- Specified by:
setAsTextin interfacejava.beans.PropertyEditor- Specified by:
setAsTextin interfacePropertyEditor<java.net.URI>- Specified by:
setAsTextin classPropertyEditorSupport<java.net.URI>- Parameters:
text- The string to be parsed.
-
getAsText
public java.lang.String getAsText()
Description copied from interface:PropertyEditorGets the property value as text.- Specified by:
getAsTextin interfacejava.beans.PropertyEditor- Specified by:
getAsTextin interfacePropertyEditor<java.net.URI>- Overrides:
getAsTextin classPropertyEditorSupport<java.net.URI>- Returns:
- The property value as a human editable string.
Returns null if the value can't be expressed as an editable string.
If a non-null value is returned, then the PropertyEditor should be prepared to parse that string back in setAsText().
-
toURI
public static java.net.URI toURI(java.lang.String urispec) throws java.net.URISyntaxException, java.io.UnsupportedEncodingException- Throws:
java.net.URISyntaxExceptionjava.io.UnsupportedEncodingException
-
makeURIFromFilespec
private static java.net.URI makeURIFromFilespec(java.lang.String filespec) throws java.io.UnsupportedEncodingException- Throws:
java.io.UnsupportedEncodingException
-
-