6.3.2 CustomContent.simt
Provides methods that manipulate the Simt data; the following table shows the methods provided by CustomContent.simt:
No. |
Method name |
Description |
---|---|---|
1 |
encodeValue |
The method to URL-encode and return a character string. |
2 |
decodeValue |
The method to URL-decode a URL-encoded character string and return the character string. |
3 |
filter |
The method to return an SID that contains a specified structured identifier as well as its value value. |
4 |
get |
The method to return an SID that matches a specified structured identifier as well as its value value. |
5 |
pack |
The method to join the class and name of a structured identifier and to return the generated structured identifier. |
6 |
packHost |
The method to join the class and host name of a structured identifier and return the generated structured identifier. |
7 |
unpack |
The method to split the structured identifier into classes and names and to return them. |
8 |
join |
The method to join structured identifiers and return the generated structured identifier. |
9 |
split |
The method to split the SID into structured identifiers and return them. |
10 |
parse |
The method to split the SID into structured identifiers, further split the split structured identifiers into classes and URL-decoded names, and then to return the classes and the URL-decoded names. |
11 |
data |
The method to generate an object from an SID and value value and to return the object. |
- Organization of this subsection
(1) encodeValue method
- Functionality
-
The method to URL-encode and return symbols other than ., ~, -, and :, and non-alphanumeric characters in the string specified by the parameter.
- Format
-
encodeValue(value)
- Argument
-
- value
-
The character string to be URL-encoded
- Return value
-
The URL-encoded character string
(2) decodeValue method
- Functionality
-
This method decodes the character string specified in the parameter and then returns the character string.
- Format
-
decodeValue(value)
- Argument
-
- value
-
The URL-encoded character string
- Return value
-
The URL-decoded character string
(3) filter method
- Functionality
-
This method generates, from the array of SimtData objects (objects that summarize SIDs and value information) specified for the first parameter, a SimtData object whose SID includes the structured ID specified for the second parameter, and returns that generated SimtData object.
- Format
-
filter(array, pattern)
- Argument
-
- array
-
The array of the SimtData object#
- pattern
-
The structured identifier
- Return value
-
The array of the SimtData object#
The SimtData# that has an SID that contains a structured identifier
If no object exists, an empty array is returned.
- #: The SimtData object contains the following properties.
-
-
sid: The character string that indicates an SID
-
value: The object that stores the value of the SID
-
(4) get method
- Functionality
-
This method generates, from the array of SimtData objects (objects that summarize SIDs and value information) specified for the first parameter, a SimtData object whose SID matches the SID specified for the second parameter, and returns that generated SimtData object.
- Format
-
get(array, sid)
- Argument
-
- array
-
The array of the SimtData object#
- pattern
-
SID
- Return value
-
The SimtData object#
This SimtData# object has an SID that matches the specified SID.
If no object exists, an empty null is returned.
- #: The SimtData object contains the following properties.
-
-
sid: The character string that indicates an SID
-
value: The object that stores the value of the SID
-
(5) pack method
- Functionality
-
This method encloses classes (without underscores) of the structured identifier specified by the first parameter with underscores (_), URL-encodes symbols other than ., ~, -, and :, and non-alphanumeric characters in the name specified by the second parameter, joins the class and the name in this order, and then returns the generated structured identifier.
- Format
-
pack(key, value)
- Argument
-
- key
-
The structured identifier class
- value
-
The name of the structured identifier
- Return value
-
The character string of the structured identifier
(6) packHost method
- Functionality
-
This method encloses classes (without underscores) of the structured identifier specified by the first parameter with underscores (_), URL-encodes symbols other than ., ~, -, and :, and non-alphanumeric characters in the name (host name) specified by the second parameter, joins the class and the name in this order, and then returns the generated structured identifier.
If you create a structured identifier with a name other than a host name, use the CustomContent.simt.pack method.
- Format
-
packHost(key, value)
- Argument
-
- key
-
The structured identifier class
- value
-
The name of the structured identifier (host)
- Return value
-
The character string of the structured identifier
(7) unpack method
- Functionality
-
This method splits the specified structured identifier into classes (without underscores) and URL-decoded names, and then returns the SimtIdUnit object that stores both.
- Format
-
unpack(simtId)
- Argument
-
- simtId
-
The structured identifier
- Return value
-
The SimtIdUnit object#
- #: The SimtIdUnit object contains the following properties.
-
-
key: The class of a structured identifier (without underscores)
-
value: The URL-decoded name of a structured identifier
-
(8) join method
- Functionality
-
This method joins multiple structured identifiers, which are specified in the parameter, with a forward slash (/), and then returns the generated SID.
- Format
-
join(...simtId)
- Argument
-
- simtId
-
The structured identifier.
- Return value
-
The character string of the SID
(9) split method
- Functionality
-
This method splits the SID, which is specified to the parameter, with a forward slash (/), and then returns the structured identifiers.
- Format
-
split(sid)
- Argument
-
- sid
-
SID
- Return value
-
The array of the character string of the structured identifier.
(10) parse method
- Functionality
-
The method to store information (the SID, which is specified to the parameter, is split into structured identifiers, and the split structured identifiers are further split into classes and URL-decoded names from which underscores are eliminated) as a SimtIdUnit object, and then to return the array of stored SimtIdUnit object.
- Format
-
parse(sid)
- Argument
-
- sid
-
SID
- Return value
-
The array of the SimtIdUnit object#
- #: The SimtIdUnit object contains the following properties.
-
-
key: The class of a structured identifier (without underscores)
-
value: The URL-decoded name of a structured identifier
-
(11) data method
- Functionality
-
This method generates and returns a SimtData object from the SID and the value value that are specified for the parameters.
- Format
-
data(sid, value)
- Argument
-
- sid
-
SID
- value
-
The value value
- Return value
-
The SimtData object# that put together the information of the SID and the value value
- #: The SimtData object contains the following properties.
-
-
sid: The character string that indicates an SID
-
value: The object that stores the value value of the SID
-