new SuperMap.Format.JSON(options)
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
optional
parameter.
|
Extends
Members
-
dataObject
-
When the keepData attribute is set to true, This is the string that is passed to the read operation to be parsed.
-
indentstring
-
Format output. For every indent, the indent string will use one time.
- Default Value: " "
keepDataObject
Keep a reference to the data that is read recently (through the attribute). The default value is false
levelinteger
use formatted output, the indentation level is expressed.
nativeJSONboolean
Determine whether browsers are native to support JSON format data.
newlinestring
Format output. newline string will be used for each name value pair or the last number of array.
- Default Value: '\n'
prettyboolean
Whether to use words wrap and indent to control the output.
serialize
A method of providing a number of type objects to a JSON string.
spacestring
Format output. space string wil be added after the name value pair ":".
- Default Value: " "
Methods
-
inherited destroy()
Format.js, line 36 -
Disposes the resource. The property that references resource is set to null.
-
read(json, filter){Object}
JSON.js, line 216 -
Parsing a string conforming to the JSON structure.
Name Type Description json
string A string that conforms to the JSON structure.
filter
function The filtering method, each of the key value pairs of the final result will call the filter method and replace the value returned by the location of the corresponding value.
Returns:
Type Description Object Object, array, string, or number. -
write(value, pretty){string}
JSON.js, line 240 -
Serialize an object to a string that conforms to the JSON format.
Name Type Description value
object | string | Array | number | boolean object, array, string, number, boolean that needs to be serialized.
pretty
boolean optional Whether to use words wrap and indent to control the output.
Returns:
Type Description string String conforming to JSON format