string. Converting Parser object into JSON-string
|
|
Default
|
Value
|
$.skip-unknown(true|false)
|
false
|
By default (false) only the objects of classes void, bool, string, int, double, date, table, hash è file are accepted. Other objects will cause an exception.
If this option is set to true, these objects will be skipped silently. |
$.indent(true|false)
$.indent[string] |
false
|
If this option is set to true the resulting JSON-string will be formatted using tab characters.
The option is also can be specified as user-predefined indent's prefix string. [3.4.3] |
$.date[sql-string|gmt-string|iso-string|unix-timestamp]
|
sql-string
|
Defines format of objects of class date (see the methods of class date with the same names).
|
$.void[null|string]
|
null
|
Defines format of objects of class void. By default it is null, but can be also serialized as an empty string. [3.4.4]
|
$.table[object|array|compact]
|
object
|
Defines format of objects of class table.
object: [{"col1":"val11","col2":"val12",...},{"col1":"val21","col2":"val22",...},...] array: [["col1","col2",...] || null (for nameless òàáëèö),["val11","val12",...],...] compact: ["value11" || ["val11","val12",...],...] |
$.file[text|base64|stat]
|
not defined
|
Defines format of bodies of objects of class file.
By default (if the option is not specified of or equal "stat") the files' bodies will be omited. |
$.xdoc[options for converting into text]
|
not defined
|
Options for converting xdoc object into text [3.4.2]
|
$.class-name[method name]
|
not defined
|
Objects of any class (including mentioned date, table and file) could be serialized with user's method. The method must accept three parameters-object's name, value and options. The options is needed for serializing user's objects recursively.
Parser searches for the specified method in all ancestors classes. [3.4.2] |
$._default[method reference]
|
not defined
|
If specified the method will be called for all objects of user-defined classes (other than are handled with option $.class-name[method name]). The method must accept three parameters - key, value and options. [3.4.2]
|
$._default[method name]
|
not defined
|
If specified and a method with specified name exists in a object of user-defined class, this method will be called for the object serialization (for classes other than are handled with option $.class-name[method name]). The method must accept two parameters - key and options. [3.4.4]
|
$.one-line(true|false)
|
false
|
If this option is set to true, the result will be returned as single line. [3.4.5]
|
Copyright © 19972021 Art. Lebedev Studio | http://www.artlebedev.com | Last updated: 25.01.2021 |