Wiki

Clone wiki

Manatee.Json / Architecture

ARCHITECTURE

Each of the JSON constructs can be mapped to a .Net construct as follows:

JSON .Net
object Dictionary
array List
boolean Boolean
numeric Double
string String

This JSON structure is implemented in .Net through three classes: JsonValue, JsonObject, and JsonArray.

The JsonValue class is a container class for all of the JSON types. In order for everything to remain strongly typed, the class exposes a property for each JSON type. To implement the JSON null value, the static member JsonValue.Null was created.

The JsonObject class is implemented as Dictionary<string, JsonValue>. As such it can be navigated and manipulated as any other dictionary instance would be.

Similarly to the JsonObject class, the JsonArray class is implemented as List<JsonValue>, which can be navigated and manipulated directly as a list instance.

Each of these three classes override the ToString() method to correctly output in a JSON format.

Implicit casts from JsonObject, JsonArray, string, double, and bool were created in JsonValue to simplify coding and readability. Also, comparison operators were overridden for the JsonValue class.

Home | Architecture | Usage | Serialization | Schema | JSONPath | XML Conversion | Support

Updated