JsonSink class abstract interface

A generalized JSON visitor interface.

A JSON-like object structure (or just "JSON structure") is a recursive structure of either atomic values:

  • number
  • string
  • boolean
  • null

or composte structures which are either an array of one or more JSON structures, or an object with pairs of string keys and JSON structure values.

A JsonSink expects its members to be called in sequences corresponding to the JSON structure of a single value: Either a primitive value, addNumber, addString, addBool or addNull, or a startArray followed by JSON values and ended by an endArray, or a startObject followed by alternating addKey and values, and ended with an endObject.

In general, a JsonSink is not required or expected to work correctly if calls are performed out of order. Only call sequences corresponding to a correct JSON structure are guaranteed to give a meaningful result.

Implementers
Available Extensions

Constructors

JsonSink()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addBool(bool value) → void
Called for a boolean value.
addKey(String key) → void
Sets the key for the next value of an object.
addNull() → void
Called for a null value.
addNumber(num value) → void
Called for a number value.
addString(String value) → void
Called for a string value.
endArray() → void
Ends the current array.
endObject() → void
Ends the current object.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
startArray() → void
Called at the beginning of an array value.
startObject() → void
Called at the beginning of an object value.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited