This is the yason Reference Manual, version 0.8.3, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 08:07:54 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
yason
JSON parser/encoder
Hans Huebner <hans@huebner.org>
BSD
YASON is a Common Lisp library for encoding and
decoding data in the JSON interchange format. JSON is used as a
lightweight alternative to XML. YASON has the sole purpose of
encoding and decoding data and does not impose any object model on
the Common Lisp application that uses it.
0.8.3
alexandria
(system).
trivial-gray-streams
(system).
package.lisp
(file).
encode.lisp
(file).
parse.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
yason/encode.lisp
package.lisp
(file).
yason
(system).
*list-encoder*
(special variable).
*symbol-encoder*
(special variable).
*symbol-key-encoder*
(special variable).
encode
(generic function).
encode-alist
(function).
encode-array-element
(function).
encode-array-elements
(function).
encode-object
(generic function).
encode-object-element
(function).
encode-object-elements
(function).
encode-object-slots
(compiler macro).
encode-object-slots
(function).
encode-plain-list-to-array
(function).
encode-plist
(function).
encode-slots
(generic function).
encode-symbol-as-lowercase
(function).
encode-symbol-as-string
(function).
initialize-instance
(method).
make-json-output-stream
(generic function).
no-json-output-context
(condition).
stream-write-char
(method).
with-array
(macro).
with-object
(macro).
with-object-element
(macro).
with-output
(macro).
with-output-to-string*
(macro).
*char-replacements*
(special variable).
*default-indent*
(special variable).
*default-indent-width*
(special variable).
*json-output*
(special variable).
change-indentation
(generic function).
copy-raw-json-output
(function).
encode-assoc-key/value
(function).
encode-key/value
(function).
encode-symbol-error
(function).
encode-symbol-key-error
(function).
escape-string-to-stream
(function).
indent
(reader method).
indent%
(reader method).
(setf indent%)
(writer method).
indent-depth
(reader method).
(setf indent-depth)
(writer method).
json-output-stream
(class).
make-raw-json-output
(function).
next-aggregate-element
(function).
output-stream
(reader method).
raw-json-output
(structure).
raw-json-output-p
(function).
raw-json-output-stg
(reader).
(setf raw-json-output-stg)
(writer).
stack
(reader method).
(setf stack)
(writer method).
unicode-char
(function).
unicode-code
(function).
with-aggregate/object
(macro).
with-aggregate/stream
(macro).
write-delimiter
(generic function).
write-indentation
(generic function).
write-surrogate-pair-escape
(function).
yason/parse.lisp
package.lisp
(file).
yason
(system).
*parse-json-arrays-as-vectors*
(special variable).
*parse-json-booleans-as-symbols*
(special variable).
*parse-json-null-as-keyword*
(special variable).
*parse-object-as*
(special variable).
*parse-object-as-alist*
(special variable).
*parse-object-key-fn*
(special variable).
false
(special variable).
parse
(function).
true
(special variable).
%parse-array
(function).
+default-string-length+
(constant).
+initial-array-size+
(constant).
add-attribute
(function).
cannot-convert-key
(condition).
create-container
(function).
duplicate-key
(condition).
expected-colon
(condition).
key-string
(reader method).
key-string
(reader method).
key-string
(reader method).
make-adjustable-string
(function).
parse%
(generic function).
parse-array
(function).
parse-constant
(function).
parse-number
(function).
parse-object
(function).
parse-string
(function).
parse-unicode-escape
(function).
peek-char-skipping-whitespace
(function).
skip-whitespace
(function).
whitespace-p
(function).
Packages are listed by definition order.
yason
common-lisp
.
*list-encoder*
(special variable).
*parse-json-arrays-as-vectors*
(special variable).
*parse-json-booleans-as-symbols*
(special variable).
*parse-json-null-as-keyword*
(special variable).
*parse-object-as*
(special variable).
*parse-object-as-alist*
(special variable).
*parse-object-key-fn*
(special variable).
*symbol-encoder*
(special variable).
*symbol-key-encoder*
(special variable).
encode
(generic function).
encode-alist
(function).
encode-array-element
(function).
encode-array-elements
(function).
encode-object
(generic function).
encode-object-element
(function).
encode-object-elements
(function).
encode-object-slots
(compiler macro).
encode-object-slots
(function).
encode-plain-list-to-array
(function).
encode-plist
(function).
encode-slots
(generic function).
encode-symbol-as-lowercase
(function).
encode-symbol-as-string
(function).
false
(special variable).
make-json-output-stream
(generic function).
no-json-output-context
(condition).
parse
(function).
true
(special variable).
with-array
(macro).
with-object
(macro).
with-object-element
(macro).
with-output
(macro).
with-output-to-string*
(macro).
%parse-array
(function).
*char-replacements*
(special variable).
*default-indent*
(special variable).
*default-indent-width*
(special variable).
*json-output*
(special variable).
+default-string-length+
(constant).
+initial-array-size+
(constant).
add-attribute
(function).
cannot-convert-key
(condition).
change-indentation
(generic function).
copy-raw-json-output
(function).
create-container
(function).
duplicate-key
(condition).
encode-assoc-key/value
(function).
encode-key/value
(function).
encode-symbol-error
(function).
encode-symbol-key-error
(function).
escape-string-to-stream
(function).
expected-colon
(condition).
indent
(generic reader).
indent%
(generic reader).
(setf indent%)
(generic writer).
indent-depth
(generic reader).
(setf indent-depth)
(generic writer).
json-output-stream
(class).
key-string
(generic reader).
make-adjustable-string
(function).
make-raw-json-output
(function).
next-aggregate-element
(function).
output-stream
(generic reader).
parse%
(generic function).
parse-array
(function).
parse-constant
(function).
parse-number
(function).
parse-object
(function).
parse-string
(function).
parse-unicode-escape
(function).
peek-char-skipping-whitespace
(function).
raw-json-output
(structure).
raw-json-output-p
(function).
raw-json-output-stg
(reader).
(setf raw-json-output-stg)
(writer).
skip-whitespace
(function).
stack
(generic reader).
(setf stack)
(generic writer).
unicode-char
(function).
unicode-code
(function).
whitespace-p
(function).
with-aggregate/object
(macro).
with-aggregate/stream
(macro).
write-delimiter
(generic function).
write-indentation
(generic function).
write-surrogate-pair-escape
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
The actual function used to encode a LIST.
Can be changed to encode ALISTs or PLISTs as dictionaries by
setting it to ENCODE-ALIST or ENCODE-PLIST.
If set to a true value, JSON arrays will be parsed as vectors, not as lists.
If set to a true value, JSON booleans will be read as the symbols TRUE and FALSE, not as T and NIL, respectively. The actual symbols can be customized via the TRUE and FALSE special variables.
If set to a true value, JSON nulls will be read as the keyword :NULL, not as NIL.
Set to either :hash-table, :plist or :alist to determine the data structure that objects are parsed to.
DEPRECATED, provided for backward compatibility
Function to call to convert a key string in a JSON array to a key in the CL hash produced.
The actual function used to encode a SYMBOL. You might want ENCODE-SYMBOL-AS-LOWERCASE or ENCODE-SYMBOL-AS-STRING here.
The actual function used to encode a SYMBOL when seen as a key.
You might want ENCODE-SYMBOL-AS-LOWERCASE or
ENCODE-SYMBOL-AS-STRING here.
The function returns just a string - the quotes are added when writing the key.
Symbol representing the JSON value false.
Symbol representing the JSON value true.
Open a JSON array, then run BODY. Inside the body, ENCODE-ARRAY-ELEMENT or nested WITH-ARRAY resp. WITH-OBJECT must be used to encode elements to the opened array. Must be called within an existing JSON encoder context, see WITH-OUTPUT and WITH-OUTPUT-TO-STRING*.
Open a JSON object, then run BODY. Inside the body, ENCODE-OBJECT-ELEMENT or WITH-OBJECT-ELEMENT must be called to encode elements to the object. Must be called within an existing JSON encoder context, see WITH-OUTPUT and WITH-OUTPUT-TO-STRING*.
Open a new encoding context to encode a JSON object element. KEY is the key of the element. The value will be whatever BODY serializes to the current JSON output context using one of the stream encoding functions. This can be used to stream out nested object structures.
Set up a JSON streaming encoder context on STREAM, then evaluate BODY.
Set up a JSON streaming encoder context, then evaluate BODY. Return a string with the generated JSON output.
Compiler macro to allow open-coding with ENCODE-OBJECT-SLOTS when slots are a literal list.
Encode OBJECT as next array element to the last JSON array opened with WITH-ARRAY in the dynamic context. OBJECT is encoded using the ENCODE generic function, so it must be of a type for which an ENCODE method is defined.
Encode OBJECTS, a list of JSON encodable objects, as array elements.
Encode KEY and VALUE as object element to the last JSON object opened with WITH-OBJECT in the dynamic context. KEY and VALUE are encoded using the ENCODE generic function, so they both must be of a type for which an ENCODE method is defined.
Encode plist ELEMENTS as object elements.
For each slot in SLOTS, encode that slot on OBJECT as an object element. Equivalent to calling ENCODE-OBJECT-ELEMENT for each slot where the key is the slot name, and the value is the (SLOT-VALUE OBJECT slot). LOWERCASE-KEYS? says whether the key should be in lowercase.
Encodes a symbol KEY as a lowercase string.
Ensure that there’s no intentional lower-case character lost.
Encodes a symbol SYM as string PACKAGE:SYMBOL-NAME.
Always prints a double colon, as exportedness
might not make sense for the receiver;
this way reading the input in again is consistent.
Preserves case.
Breaks if the package name includes colons.
Parse INPUT, which needs to be a string or a stream, as JSON. Returns the lisp representation of the JSON structure parsed. The keyword arguments can be used to override the parser settings as defined by the respective special variables.
Encode OBJECT to STREAM in JSON format. May be
specialized by applications to perform specific rendering.
STREAM must be a JSON-OUTPUT-STREAM; you can get one via
MAKE-JSON-OUTPUT-STREAM, WITH-OUTPUT, or WITH-OUTPUT-TO-STRING*.
(eql nil)
) &optional stream) ¶(eql t)
) &optional stream) ¶(eql :null)
) &optional stream) ¶(eql yason:false)
) &optional stream) ¶(eql yason:true)
) &optional stream) ¶symbol
) &optional stream) ¶list
) &optional stream) ¶vector
) &optional stream) ¶hash-table
) &optional stream) ¶integer
) &optional stream) ¶float
) &optional stream) ¶ratio
) &optional stream) ¶raw-json-output
) &optional stream) ¶string
) &optional stream) ¶Generic function to encode an object. The default implementation opens a new object encoding context and calls ENCODE-SLOTS on the argument.
Generic function to encode object slots. It should be called in an object encoding context. It uses PROGN combination with MOST-SPECIFIC-LAST order, so that base class slots are encoded before derived class slots.
progn
.
:most-specific-last
Create a JSON output stream with indentation enabled.
json-output-stream
) &key indent) ¶json-output-stream
) char) ¶sb-gray
.
This condition is signalled when one of the stream encoding function is used outside the dynamic context of a WITH-OUTPUT or WITH-OUTPUT-TO-STRING* body.
error
.
Default length of strings that are created while reading json input.
Initial size of JSON arrays read, they will grow as needed.
Set to T or an numeric indentation width in order to have YASON indent its output by default.
Default indentation width for output if indentation is selected with no indentation width specified.
Set up serialization context for aggregate serialization with the object encoder.
Set up context for aggregate serialization for the stream encoder.
Parse JSON array from input, calling ADD-ELEMENT-FUNCTION for each array element parsed.
Return an adjustable empty string, usable as a buffer for parsing strings and numbers.
stg
.
json-output-stream
) increment) ¶json-output-stream
)) ¶automatically generated reader method
json-output-stream
)) ¶automatically generated reader method
json-output-stream
)) ¶automatically generated writer method
json-output-stream
)) ¶automatically generated reader method
json-output-stream
)) ¶automatically generated writer method
expected-colon
)) ¶duplicate-key
)) ¶cannot-convert-key
)) ¶json-output-stream
)) ¶automatically generated reader method
json-output-stream
)) ¶automatically generated reader method
json-output-stream
)) ¶automatically generated writer method
json-output-stream
)) ¶json-output-stream
)) ¶error
.
:key-string
This slot is read-only.
error
.
:key-string
This slot is read-only.
error
.
:key-string
This slot is read-only.
Escape mechanism to allow more intricate JSON exports.
(MAKE-RAW-JSON-OUTPUT X)
causes the string X to be written to the JSON output verbatim,
ie. without any encoding.
(Bad) example:
(yason:encode (vector 1 2 (make-raw-json-output "{}")
structure-object
.
string
Objects of this class capture the state of a JSON stream encoder.
fundamental-character-output-stream
.
Initarg | Value |
---|---|
:indent | *default-indent* |
:output-stream
This slot is read-only.
0
:indent
Jump to: | %
(
A C E F G I K M N O P R S U W |
---|
Jump to: | %
(
A C E F G I K M N O P R S U W |
---|
Jump to: | *
+
C F I K O S T |
---|
Jump to: | *
+
C F I K O S T |
---|
Jump to: | C D E F J N P R S Y |
---|
Jump to: | C D E F J N P R S Y |
---|