API for json - clojure-contrib v1.3 (in development)

by Stuart Sierra

Full namespace name: clojure.contrib.json

Overview

JavaScript Object Notation (JSON) parser/writer.
See http://www.json.org/
To write JSON, use json-str, write-json, or write-json.
To read JSON, use read-json.

Public Variables and Functions



json-str

function
Usage: (json-str x & options)
Converts x to a JSON-formatted string.

Valid options are:
  :escape-unicode false
      to turn of \uXXXX escapes of Unicode characters.
Source


pprint-json

function
Usage: (pprint-json x & options)
Pretty-prints JSON representation of x to *out*.

Valid options are:
  :escape-unicode false
      to turn off \uXXXX escapes of Unicode characters.
Source


print-json

function
Usage: (print-json x & options)
Write JSON-formatted output to *out*.

Valid options are:
  :escape-unicode false
      to turn off \uXXXX escapes of Unicode characters.
Source


read-json

function
Usage: (read-json input)
       (read-json input keywordize?)
       (read-json input keywordize? eof-error? eof-value)
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. 
Source


read-json-from

function
Usage: (read-json-from input keywordize? eof-error? eof-value)
Reads one JSON value from input String or Reader.
If keywordize? is true, object keys will be converted to keywords.
If eof-error? is true, empty input will throw an EOFException; if
false EOF will return eof-value. 


write-json

function
Usage: (write-json object out escape-unicode?)
Print object to PrintWriter out as JSON
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber.