CrossClj

0.2.6 docs

SourceDocs



RECENT
    VARS
    *bigdec*
    *escape-js-separators*
    *escape-slash*
    *escape-unicode*
    *key-fn*
    *value-fn*
    -read
    codepoint
    codepoint-case
    codepoint-clause
    default-value-fn
    default-write-key-fn
    json-str
    JSONWriter
    pprint
    pprint-array
    pprint-dispatch
    pprint-generic
    pprint-json
    pprint-object
    print-json
    read
    read-array
    read-decimal
    read-escaped-char
    read-hex-char
    read-integer
    read-json
    read-number
    read-object
    read-quoted-string
    read-str
    write
    write-array
    write-bignum
    write-double
    write-float
    write-generic
    write-json
    write-named
    write-null
    write-object
    write-plain
    write-ratio
    write-str
    write-string

    « Index of all namespaces of this project

    JavaScript Object Notation (JSON) parser/generator.
    See http://www.json.org/

    — Stuart Sierra

    PrivateDynamic
    PrivateDynamic
    Private
    (-read stream eof-error? eof-value)
    macroPrivate
    (codepoint c)
    macroPrivate
    (codepoint-case e & clauses)
    Private
    (codepoint-clause [test result])
    Private
    (default-value-fn k v)
    Private
    (default-write-key-fn x)
    (json-str x & options)
    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.
    protocol
    (-write object out)
    Print object to PrintWriter out as JSON
    
    (pprint x & options)
    Pretty-prints JSON representation of x to *out*. Options are the
    same as for write except :value-fn, which is not supported.
    Private
    (pprint-array s)
    Private
    (pprint-dispatch x)
    Private
    (pprint-generic x)
    (pprint-json x & options)
    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.
    Private
    (pprint-object m)
    (print-json x & options)
    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.
    (read reader & options)
    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.
    Private
    (read-array stream)
    Private
    (read-decimal string)
    Private
    (read-escaped-char stream)
    Private
    (read-hex-char stream)
    Private
    (read-integer string)
    (read-json input)(read-json input keywordize?)(read-json input keywordize? eof-error? eof-value)
    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.
    Private
    (read-number stream)
    Private
    (read-object stream)
    Private
    (read-quoted-string stream)
    (read-str string & options)
    Reads one JSON value from input String. Options are the same as for
    read.
    (write x writer & options)
    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.
    Private
    (write-array s out)
    Private
    (write-bignum x out)
    Private
    (write-double x out)
    Private
    (write-float x out)
    Private
    (write-generic x out)
    (write-json x out escape-unicode?)
    DEPRECATED; replaced by 'write'.
    
    Print object to PrintWriter out as JSON
    Private
    (write-named x out)
    Private
    (write-null x out)
    Private
    (write-object m out)
    Private
    (write-plain x out)
    Private
    (write-ratio x out)
    (write-str x & options)
    Converts x to a JSON-formatted string. Options are the same as
    write.
    Private
    (write-string s out)