source: trunk/docs/api/zoo-format-json.txt @ 165

Last change on this file since 165 was 165, checked in by jmckenna, 13 years ago

add ZOO.Format.JSON doc

File size: 4.6 KB
Line 
1.. _api-zoo-format-json:
2
3ZOO.Format.JSON
4===============
5
6A parser to read/write JSON safely.
7
8Properties     
9----------
10
11.. list-table::
12   :widths: 12 50
13   :header-rows: 1
14
15   * - NAME
16     - DESCRIPTION
17   * - :ref:`indent <indent>`
18     - {String} For "pretty" printing, the indent string will be used once for each indentation level.
19   * - :ref:`space <space>`
20     - {String} For "pretty" printing, the space string will be used after the ":" separating a name/value pair.
21   * - :ref:`newline <newline>`
22     - {String} For "pretty" printing, the newline string will be used at the end of each name/value pair or array item.
23   * - :ref:`level <level>`
24     - {Integer} For "pretty" printing, this is incremented/decremented during serialization. 
25   * - :ref:`pretty <pretty>`
26     - {Boolean} Serialize with extra whitespace for structure.   
27     
28Functions       
29---------
30
31.. list-table::
32   :widths: 14 50
33   :header-rows: 1
34
35   * - NAME
36     - DESCRIPTION
37   * - :ref:`ZOO.Format.JSON <ZOO.Format.JSON>`
38     - Create a new parser for JSON.
39   * - :ref:`read <read>`
40     - Deserialize a json string.
41   * - :ref:`write <write>`
42     - Serialize an object into a JSON string.
43   * - :ref:`writeIndent <writeIndent>`
44     - Output an indentation string depending on the indentation level. 
45   * - :ref:`writeNewline <writeNewline>`
46     - Output a string representing a newline if in pretty printing mode.   
47   * - :ref:`writeSpace <writeSpace>`
48     - Output a string representing a space if in pretty printing mode.
49     
50Serialize Properties   
51--------------------
52
53.. list-table::
54   :widths: 14 50
55   :header-rows: 1
56
57   * - NAME
58     - DESCRIPTION
59   * - :ref:`serialize <serialize>`
60     - Object with properties corresponding to the serializable data types.
61     
62Serialize Functions     
63-------------------
64
65.. list-table::
66   :widths: 14 50
67   :header-rows: 1
68
69   * - NAME
70     - DESCRIPTION
71   * - :ref:`serialize.object <serialize.object>`
72     - Transform an object into a JSON string.
73   * - :ref:`serialize.array <serialize.array>`
74     - Transform an array into a JSON string.
75   * - :ref:`serialize.string <serialize.string>`
76     - Transform a string into a JSON string.
77   * - :ref:`serialize.number <serialize.number>`
78     - Transform a number into a JSON string. 
79   * - :ref:`serialize.boolean <serialize.boolean>`
80     - Transform a boolean into a JSON string.   
81   * - :ref:`serialize.date <serialize.date>`
82     - Transform a date into a JSON string.     
83       
84**Properties**
85
86.. _indent:   
87
88indent 
89  {String} For "pretty" printing, the indent string will be used once for each indentation level.
90 
91.. _space:     
92 
93space   
94  {String} For "pretty" printing, the space string will be used after the ":" separating a name/value pair.
95 
96.. _newline:       
97 
98newline
99  {String} For "pretty" printing, the newline string will be used at the end of each name/value pair or array item.
100 
101.. _level:       
102 
103level   
104  {Integer} For "pretty" printing, this is incremented/decremented during serialization.
105 
106.. _pretty:         
107 
108pretty 
109  {Boolean} Serialize with extra whitespace for structure.
110 
111**Functions**
112
113.. _ZOO.Format.JSON:         
114
115ZOO.Format.JSON
116  Create a new parser for JSON.
117 
118.. _read:           
119 
120read   
121  Deserialize a json string.
122 
123.. _write:             
124 
125write   
126  Serialize an object into a JSON string.
127 
128.. _writeIndent:               
129 
130writeIndent     
131  Output an indentation string depending on the indentation level.
132 
133.. _writeNewline:               
134 
135writeNewline   
136  Output a string representing a newline if in pretty printing mode.
137 
138.. _writeSpace:               
139 
140writeSpace     
141  Output a string representing a space if in pretty printing mode.
142 
143**Serialize Properties**
144
145.. _serialize:               
146
147serialize       
148  Object with properties corresponding to the serializable data types.
149 
150**Serialize Functions**
151
152.. _serialize.object:               
153
154serialize.object       
155  Transform an object into a JSON string.
156 
157.. _serialize.array:                 
158 
159serialize.array
160  Transform an array into a JSON string.
161 
162.. _serialize.string:                   
163 
164serialize.string       
165  Transform a string into a JSON string.
166 
167.. _serialize.number:                     
168 
169serialize.number       
170  Transform a number into a JSON string.
171 
172.. _serialize.boolean:                       
173 
174serialize.boolean       
175  Transform a boolean into a JSON string.
176 
177.. _serialize.date:                         
178 
179serialize.date 
180  Transform a date into a JSON string.
Note: See TracBrowser for help on using the repository browser.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png