Overview
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.
Profile: common
Script Variable Summary
access | name | type | Can Read | Can Init | Can Write | Default Value | description |
---|---|---|---|---|---|---|---|
public | DEFAULT_NAME_VAL_DELIMITER | String | "=" |
Default URL Parameter name/value delimiter used by URLConverter |
|||
public | DEFAULT_PARAM_DELIMITER | String | "&" |
Default URL Parameter delimiter used by URLConverter |
|||
public | PARAM_START_DELIMITER | String | "?" |
URL Parameter start delimiter used by URLConverter |
Variable Summary
access | name | type | Can Read | Can Init | Can Write | Default Value | description |
---|---|---|---|---|---|---|---|
public-init | encodeAsterisk | Boolean | false |
Indicates if an asterisk should be encoded as "%2A". Indicates if an asterisk should be encoded as "%2A".
If false
Profile: common |
|||
public-init | encodeSpaceAsPercent | Boolean | false |
Indicates if a space should be encoded as "%20". Indicates if a space should be encoded as "%20".
If false
Profile: common |
|||
public-init | nameValDelimiter | String | "=" |
URL Parameter name/value delimiter. |
|||
public-init | paramDelimiter | String | "&" |
URL Parameter delimiter. |
Inherited Variables
Function Summary
- public decodeParameters(url: java.lang.String) : java.lang.Object[]
-
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 alwaysutf-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)
-
Returns
- Object[]
- a Sequence of Pair, s
Profile: common
- public decodeString(encodedString: java.lang.String) : java.lang.String
-
Decodes a string.
Decodes a string.
Exactly the reverse of encodeString(String). IfencodedString
is already decoded, the return value will be no different thanencodedString
.See Also:
encodeString(String)-
Parameters
- encodedString
- a string assumed to be an encoded
-
Returns
- String
- a decoded string
Profile: common
- public decodeURL(encodedURL: java.lang.String) : java.lang.String
-
Decodes a URL.
Decodes a URL.
Exactly the reverse of encodeURL(String). IfencodedURL
is already a decoded URL, the return value will be no different thanencodedURL
.See Also:
encodeURL(String)-
Parameters
- encodedURL
- a string assumed to be an encoded URL
-
Returns
- String
- a decoded URL
Profile: common
- public encodeParameters(parameters: Pair[]) : java.lang.String
-
Encode a sequence of Pair objects.
Encode a sequence of Pair objects.
The parameter delimiter is specified by paramDelimiter. The name/value delimiter is specified by nameValDelimiter. The returned string is suitable for appending toURL
s. The character encoding used for encode is alwaysutf-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.See Also:
encodeAsterisk, encodeSpaceAsPercent-
Parameters
- parameters
-
sequence of Pairs to be encoded
-
Returns
- String
- a String containing the encoded parameter name/value pair(s)
Profile: common
- public encodeString(s: java.lang.String) : java.lang.String
-
Encodes a string.
Encodes a string.
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)See Also:
encodeURL(String), encodeAsterisk, encodeSpaceAsPercent-
Parameters
- s
- a string to be encoded.
-
Returns
- String
- an encoded string
Profile: common
- public encodeURL(url: java.lang.String) : java.lang.String
-
Encodes a URL.
Encodes a URL.
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 inurl
(no occurance of PARAM_START_DELIMITER) then this function behaves exactly like encodeString(String).See Also:
decodeParameters(String), encodeParameters(String), encodeParameters(Pair[]), decodeURL(String), encodeAsterisk, encodeSpaceAsPercent-
Parameters
- url
- a string assumed to be a URL
-
Returns
- String
- an encoded URL
Profile: common
- public fromString(string: java.lang.String) : java.lang.Object
-
Decodes an encoded URL exactly like decodeURL(String).
Decodes an encoded URL exactly like decodeURL(String). Treats
string
as if it were an encoded URL.See Also:
decodeURL(String)-
Parameters
- string
- a string assumed to be a URL
-
Returns
- Object
- an encoded URL
Profile: common
- public toString(object: java.lang.Object) : java.lang.String
-
Encodes objects of type:
Encodes objects of type:
String - exactly like encodeURL(String)
Pair - exactly like encodeParameters(Pair[])
Will throw a java.lang.ClassCastException if the object is of a type other than those mentioned.-
Parameters
- object
- an object of the types mentioned above
-
Returns
- String
- a string encoded appropriately
Profile: common
Inherited Functions
javafx.data.Converter
- public abstract fromString(string: java.lang.String) : java.lang.Object
-
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.
-
Parameters
- string
-
Returns
- Object
- an object representation of the string passed in.
- public abstract toString(object: java.lang.Object) : java.lang.String