cheshire.custom documentation

DEPRECATED

Methods used for extending JSON generation to different Java classes.
Has the same public API as core.clj so they can be swapped in and out.

add-encoder

(add-encoder cls encoder)
Provide an encoder for a type not handled by Cheshire.

ex. (add-encoder java.net.URL encode-string)

See encode-str, encode-map, etc, in the cheshire.custom
namespace for encoder examples.

encode-bool

(encode-bool b jg)
Encode a Boolean object to the json generator.

encode-date

(encode-date d jg)
Encode a date object to the json generator.

encode-int

(encode-int n jg)
Encode anything implementing java.lang.Number to the json generator.

encode-long

(encode-long n jg)
Encode anything implementing java.lang.Number to the json generator.

encode-map

(encode-map m jg)
Encode a clojure map to the json generator.

encode-named

(encode-named k jg)
Encode a keyword to the json generator.

encode-nil

(encode-nil _ jg)
Encode null to the json generator.

encode-number

(encode-number n jg)
Encode anything implementing java.lang.Number to the json generator.

encode-ratio

(encode-ratio n jg)
Encode a clojure.lang.Ratio to the json generator.

encode-seq

(encode-seq s jg)
Encode a seq to the json generator.

encode-str

(encode-str s jg)
Encode a string to the json generator.

encode-symbol

(encode-symbol s jg)
Encode a clojure symbol to the json generator.