Converter for URLs and URL parameters.
This class contains functions for converting a String to the
application/x-www-form-urlencoded MIME format. It also contains functions
for decoding a String from the application/x-www-form-urlencoded MIME format.
For more information about HTML form encoding, consult
the HTML specification.
Decode parameter name/value pairs in the specified string.
Decode parameter name/value pairs in the specified string.
The character encoding used for decode is always utf-8.
If no parameter name/value pairs are found, the returned sequence will
have zero elements. If the syntax of a potential, encoded name/value
pair in the string is illegal, it will be silently ignored. If the
spedified string is of zero length or null, a zero-length sequence is
returned. The parameter delimiter is specified by paramDelimiter.
The name/value delimiter is specified by nameValDelimiter.
If the specified string contains a URL with parameters, the character
assumed to delimit the start of parameters is
PARAM_START_DELIMITER.
Parameters
url
the String containing the parameter name/value pair(s) to be decoded (can be a URL with trailing parameters)
The parameter delimiter is specified by paramDelimiter.
The name/value delimiter is specified by nameValDelimiter.
The returned string is suitable for appending to URLs.
The character encoding used for encode is always utf-8.
If the sequence of Pairs specified is of zero length or null,
a zero-length string is returned. If the both delimiter fields contain the
same string, or if either of these fields contains a zero-length or a null
string, or if either contains other than a single character, a zero-length
string is returned. If any Pair in the sequence specified
has a null or zero-length string as a name and/or value, the resulting
encoded string will have illegal syntax (missing name and/or value).
Encoding is affected by the values of encodeAsterisk and
encodeSpaceAsPercent.
Encodes a String to the application/x-www-form-urlencoded MIME format.
Encoding is affected by the values of encodeAsterisk and
encodeSpaceAsPercent.
For more information about HTML form encoding, consult
the HTML specification.
This function does not attempt to treat the string as a URL.
For encoding URL strings, use encodeURL(String)
If there are any parameters
included in the URL, the names and values of those parameters
are encoded appropriately. No other part of the URL is encoded.
Encoding is affected by the values of encodeAsterisk and
encodeSpaceAsPercent.
The parameter delimiter is specified by paramDelimiter.
The name/value delimiter is specified by nameValDelimiter.
url is assumed be a URL and the URL parameter
start delimiter is assumed to be PARAM_START_DELIMITER.
This function treats parameters in the same way as
encodeParameters(Pair[]) and
decodeParameters(String) with respect to validity and syntax.
If there are no URL parameters included in url (no
occurance of PARAM_START_DELIMITER) then this function behaves
exactly like encodeString(String).
Converts the string provided into an object defined by the specific converter.
Converts the string provided into an object defined by the specific converter.
Format of the string and type of the resulting object is defined by the specific converter.