Class EncodedURLStringConverter

java.lang.Object
org.tquadrat.foundation.util.stringconverter.URLStringConverter
org.tquadrat.foundation.util.stringconverter.EncodedURLStringConverter
All Implemented Interfaces:
Serializable, StringConverter<URL>

@ClassVersion(sourceVersion="$Id: EncodedURLStringConverter.java 1080 2024-01-03 11:05:21Z tquadrat $") @API(status=STABLE, since="0.1.0") public final class EncodedURLStringConverter extends URLStringConverter

An implementation of StringConverter for URL values. Different from URLStringConverter, this implementation expects an "application/x-www-form-url" encoded String as the argument for fromString(CharSequence) and returns such a String from toString(URL).

The method fromString(CharSequence) will use URLDecoder.decode(String, Charset) to get the decode URL String, then it calls URLStringConverter.fromString(CharSequence) to create a URL instance from it.

toString(URL) uses URLStringConverter.toString(URL) to get a String out of the URL and encodes it with a call to URLEncoder.encode(String, Charset).

Based on the World Wide Web Consortium Recommendation both methods (fromString() and toString()) are using UTF-8 as the charset argument.

Author:
Thomas Thrien (thomas.thrien@tquadrat.org)
Version:
$Id: EncodedURLStringConverter.java 1080 2024-01-03 11:05:21Z tquadrat $
Since:
0.1.0
See Also:
UML Diagram
UML Diagram for "org.tquadrat.foundation.util.stringconverter.EncodedURLStringConverter"

UML Diagram for "org.tquadrat.foundation.util.stringconverter.EncodedURLStringConverter"

UML Diagram for "org.tquadrat.foundation.util.stringconverter.EncodedURLStringConverter"