/
index.html
368 lines (294 loc) · 14.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>clojure.data.json - JSON Utilities 0.2.7 API documentation</title>
<link rel="icon" href="static/favicon.png" />
<link rel="shortcut icon" href="static/favicon.png" />
<link rel="stylesheet" href="static/clojure.css" type="text/css" media="all" />
<link rel="stylesheet" href="static/wiki.css" type="text/css" media="all" />
<link rel="stylesheet" href="static/internal.css" type="text/css" media="all" />
<style>.menuWrapper{height: 36px;}</style>
</head>
<!--
This document was auto-generated from the source by the clojure autodoc system.
To report errors or ask questions about the overall documentation structure, formatting,
etc., contact Tom Faulhaber (google mail name: tomfaulhaber).
For errors in the documentation of a particular namespace, contact the author of that
namespace.
-->
<body>
<div id="AllContentContainer">
<div id="Header">
<a href="index.html" id="Logo"><img src="static/clojure-icon.gif" width="100" height="100" alt="Clojure" /></a>
<h1><a href="index.html" id="page-header" title="page header title">data.json API Reference</a></h1>
</div>
<div id="leftcolumn"><div style="text-align: center;"></div>
<div class="menu">
<div class="WikiCustomNav WikiElement wiki">
<span class="toc-header"><span id="project-name">JSON Utilities</span> <span id="version">0.2.7</span> API</span><br />
<ul>
<li><a href="index.html" class="wiki_link">Overview</a></li>
<li><a href="api-index.html" class="wiki_link">API Index</a></li>
</ul>
<a class="wiki_link" href="http://clojure.org">Clojure Home</a>
</div>
</div>
</div>
<div id="rightcolumn">
<div id="Content">
<div class="contentBox"><div class="innerContentBox">
<div class="wiki wikiPage" id="content_view">
<div id="right-sidebar"><div id="toc">
<h1 class="nopad">Table of Contents</h1>
<div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#toc0">Overview</a>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#proto-section">Protocols</a>
<div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.data.json/JSONWriter" class="toc-entry-anchor">JSONWriter</a>
<div class="toc-subentry" style="margin-left: 1em;">
<a href="#clojure.data.json/-write" class="toc-subentry-anchor">-write</a>
</div>
</div>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#"></a>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#var-section">Vars and Functions</a>
<div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.data.json/json-str" class="toc-entry-anchor">json-str</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.data.json/pprint" class="toc-entry-anchor">pprint</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.data.json/pprint-json" class="toc-entry-anchor">pprint-json</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.data.json/print-json" class="toc-entry-anchor">print-json</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.data.json/read" class="toc-entry-anchor">read</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.data.json/read-json" class="toc-entry-anchor">read-json</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.data.json/read-str" class="toc-entry-anchor">read-str</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.data.json/write" class="toc-entry-anchor">write</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.data.json/write-json" class="toc-entry-anchor">write-json</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.data.json/write-str" class="toc-entry-anchor">write-str</a>
</div>
</div>
</div>
</div>
<div id="content-tag"><h1 id="overview">API for <span id="clojure.data.json">clojure.data.json</span>
- <span id="header-project">JSON Utilities</span> <span id="header-version">0.2.7</span><span id="header-status-block"> (<span id="header-status">in development</span>)</span>
</h1>
<span id="author-line">by <span id="author-name">Stuart Sierra</span><br /></span>
<br />Full namespace name: <span id="long-name">clojure.data.json</span>
<p></p>
<h2>Overview</h2>
<div id="home-page">Project home page is <a href="http://github.com/clojure/data.json/">http://github.com/clojure/data.json/</a></div>
<pre id="namespace-docstr">JavaScript Object Notation (JSON) parser/generator.
See <a href="http://www.json.org/">http://www.json.org/</a></pre>
<br />
<div id="proto-section">
<p></p>
<h2>Protocols</h2>
<div id="proto-entry">
<br />
<hr />
<h2 id="clojure.data.json/JSONWriter">JSONWriter</h2>
<span id="proto-type">Protocol</span><br />
<pre id="proto-docstr"></pre>
Known implementations: <span id="proto-impls">clojure.lang.BigInt, clojure.lang.Named, clojure.lang.Ratio, java.lang.Boolean, java.lang.Byte, java.lang.CharSequence, java.lang.Double, java.lang.Float, java.lang.Integer, java.lang.Long, java.lang.Short, java.math.BigDecimal, java.math.BigInteger, java.util.Collection, java.util.concurrent.atomic.AtomicInteger, java.util.concurrent.atomic.AtomicLong, java.util.Map, nil, Object</span>
<div id="proto-var-entry">
<br />
<h3 id="clojure.data.json/-write">-write</h3>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (-write object out)
</pre>
<pre id="var-docstr">Print object to PrintWriter out as JSON</pre>
</div>
<a id="proto-source" href="https://github.com/clojure/data.json/blob/b4ba1fc056d82b58979759f6c3ca817640c69b23/src/main/clojure/clojure/data/json.clj#L286">Source</a>
</div>
</div>
<div id="var-section">
<p></p>
<h2>Public Variables and Functions</h2>
<div id="var-entry">
<br />
<hr />
<h2 id="clojure.data.json/json-str">json-str</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (json-str x & options)
</pre>
<pre id="var-docstr">DEPRECATED; replaced by 'write-str'.
Converts x to a JSON-formatted string.
Valid options are:
:escape-unicode false
to turn of \uXXXX escapes of Unicode characters.</pre>
<a id="var-source" href="https://github.com/clojure/data.json/blob/d3cce5b200031cf22603c13a9a39e3939651d344/src/main/clojure/clojure/data/json_compat_0_1.clj#L42">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.data.json/pprint">pprint</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (pprint x & options)
</pre>
<pre id="var-docstr">Pretty-prints JSON representation of x to *out*. Options are the
same as for write except :value-fn, which is not supported.</pre>
<a id="var-source" href="https://github.com/clojure/data.json/blob/b4ba1fc056d82b58979759f6c3ca817640c69b23/src/main/clojure/clojure/data/json.clj#L509">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.data.json/pprint-json">pprint-json</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (pprint-json x & options)
</pre>
<pre id="var-docstr">DEPRECATED; replaced by 'pprint'.
Pretty-prints JSON representation of x to *out*.
Valid options are:
:escape-unicode false
to turn off \uXXXX escapes of Unicode characters.</pre>
<a id="var-source" href="https://github.com/clojure/data.json/blob/d3cce5b200031cf22603c13a9a39e3939651d344/src/main/clojure/clojure/data/json_compat_0_1.clj#L64">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.data.json/print-json">print-json</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (print-json x & options)
</pre>
<pre id="var-docstr">DEPRECATED; replaced by 'write' to *out*.
Write JSON-formatted output to *out*.
Valid options are:
:escape-unicode false
to turn off \uXXXX escapes of Unicode characters.</pre>
<a id="var-source" href="https://github.com/clojure/data.json/blob/d3cce5b200031cf22603c13a9a39e3939651d344/src/main/clojure/clojure/data/json_compat_0_1.clj#L53">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.data.json/read">read</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (read reader & options)
</pre>
<pre id="var-docstr">Reads a single item of JSON data from a java.io.Reader. Options are
key-value pairs, valid options are:
:eof-error? boolean
If true (default) will throw exception if the stream is empty.
:eof-value Object
Object to return if the stream is empty and eof-error? is
false. Default is nil.
:bigdec boolean
If true use BigDecimal for decimal numbers instead of Double.
Default is false.
:key-fn function
Single-argument function called on JSON property names; return
value will replace the property names in the output. Default
is clojure.core/identity, use clojure.core/keyword to get
keyword properties.
:value-fn function
Function to transform values in maps ("objects" in JSON) in
the output. For each JSON property, value-fn is called with
two arguments: the property name (transformed by key-fn) and
the value. The return value of value-fn will replace the value
in the output. If value-fn returns itself, the property will
be omitted from the output. The default value-fn returns the
value unchanged. This option does not apply to non-map
collections.</pre>
<a id="var-source" href="https://github.com/clojure/data.json/blob/b4ba1fc056d82b58979759f6c3ca817640c69b23/src/main/clojure/clojure/data/json.clj#L228">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.data.json/read-json">read-json</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (read-json input)
(read-json input keywordize?)
(read-json input keywordize? eof-error? eof-value)
</pre>
<pre id="var-docstr">DEPRECATED; replaced by read-str.
Reads one JSON value from input String or Reader. If keywordize? is
true (default), object keys will be converted to keywords. If
eof-error? is true (default), empty input will throw an
EOFException; if false EOF will return eof-value.</pre>
<a id="var-source" href="https://github.com/clojure/data.json/blob/d3cce5b200031cf22603c13a9a39e3939651d344/src/main/clojure/clojure/data/json_compat_0_1.clj#L10">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.data.json/read-str">read-str</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (read-str string & options)
</pre>
<pre id="var-docstr">Reads one JSON value from input String. Options are the same as for
read.</pre>
<a id="var-source" href="https://github.com/clojure/data.json/blob/b4ba1fc056d82b58979759f6c3ca817640c69b23/src/main/clojure/clojure/data/json.clj#L274">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.data.json/write">write</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (write x writer & options)
</pre>
<pre id="var-docstr">Write JSON-formatted output to a java.io.Writer. Options are
key-value pairs, valid options are:
:escape-unicode boolean
If true (default) non-ASCII characters are escaped as \uXXXX
:escape-js-separators boolean
If true (default) the Unicode characters U+2028 and U+2029 will
be escaped as \u2028 and \u2029 even if :escape-unicode is
false. (These two characters are valid in pure JSON but are not
valid in JavaScript strings.)
:escape-slash boolean
If true (default) the slash / is escaped as \/
:key-fn function
Single-argument function called on map keys; return value will
replace the property names in the output. Must return a
string. Default calls clojure.core/name on symbols and
keywords and clojure.core/str on everything else.
:value-fn function
Function to transform values in maps before writing. For each
key-value pair in an input map, called with two arguments: the
key (BEFORE transformation by key-fn) and the value. The
return value of value-fn will replace the value in the output.
If the return value is a number, boolean, string, or nil it
will be included literally in the output. If the return value
is a non-map collection, it will be processed recursively. If
the return value is a map, it will be processed recursively,
calling value-fn again on its key-value pairs. If value-fn
returns itself, the key-value pair will be omitted from the
output. This option does not apply to non-map collections.</pre>
<a id="var-source" href="https://github.com/clojure/data.json/blob/b4ba1fc056d82b58979759f6c3ca817640c69b23/src/main/clojure/clojure/data/json.clj#L424">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.data.json/write-json">write-json</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (write-json x out escape-unicode?)
</pre>
<pre id="var-docstr">DEPRECATED; replaced by 'write'.
Print object to PrintWriter out as JSON</pre>
<a id="var-source" href="https://github.com/clojure/data.json/blob/d3cce5b200031cf22603c13a9a39e3939651d344/src/main/clojure/clojure/data/json_compat_0_1.clj#L35">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.data.json/write-str">write-str</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (write-str x & options)
</pre>
<pre id="var-docstr">Converts x to a JSON-formatted string. Options are the same as
write.</pre>
<a id="var-source" href="https://github.com/clojure/data.json/blob/b4ba1fc056d82b58979759f6c3ca817640c69b23/src/main/clojure/clojure/data/json.clj#L477">Source</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="foot">
<div id="copyright" style="text-align: center;">Copyright 2007-2016 by Rich Hickey and the various contributors</div>
</div>
</div>
<div id="DesignedBy">Logo & site design by <a href="http://www.tomhickey.com" title="Visit Tom Hickey's website.">Tom Hickey</a>.<br />
Clojure auto-documentation system by Tom Faulhaber.</div>
</div>
<!-- /AllContentContainer -->
</body>
</html>