encoding.json.stream Package

Function Description

The json.stream package is used for conversion between Cangjie objects and JSON data streams.

This package provides the JsonWriter and JsonReader classes. The JsonWriter class provides the serialization capability for converting Cangjie objects into JSON data streams. The JsonReader class provides the deserialization capability for converting JSON data streams into Cangjie objects.

Currently, the following types support the conversion with JSON data streams:

  • Basic data types: String, Int8, Int16, Int32, Int64, Float16, Float32, Float64, UInt8, UInt16, UInt32, and UInt64

  • Set type: Array<T>, ArrayList<T>, and HashMap<String, T>

  • Other types: Option<T>, BigInt, and Decimal

API List

Interface

NameDescription
JsonDeserializable<T>Reads a Cangjie object from JsonReader.
JsonSerializableProvides an interface for serializing a type to a JSON data stream.

Class

NameDescription
JsonReaderProvides the deserialization capability for converting a JSON data stream into a Cangjie object.
JsonWriterProvides the capability of serializing a Cangjie object to a JSON data stream.

Enumeration

NameDescription
JsonTokenIndicates the structure, name, or value type in a JSON-encoded string.

Struct

NameDescription
WriteConfigIndicates the serialization format of JsonWriter.