object JsonPrimitiveSerializer : KSerializer<JsonPrimitive>
External Serializer object providing SerializationStrategy and DeserializationStrategy for JsonPrimitive. It can only be used by with Json format an its input (JsonInput and JsonOutput).
(common, js, jvm, native)
descriptor |
Describes the structure of the serializable representation of T, produced by this serializer. Knowing the structure of the descriptor is required to determine the shape of the serialized form (e.g. what elements are encoded as lists and what as primitives) along with its metadata such as alternative names. val descriptor: SerialDescriptor |
(common, js, jvm, native)
deserialize |
Deserializes the value of type T using the format that is represented by the given decoder. deserialize method is format-agnostic and operates with a high-level structured Decoder API. As long as most of the formats imply an arbitrary order of properties, deserializer should be able to decode these properties in an arbitrary order and in a format-agnostic way. For that purposes, CompositeDecoder.decodeElementIndex-based loop is used: decoder firstly signals property at which index it is ready to decode and then expects caller to decode property with the given index. fun deserialize(decoder: Decoder): JsonPrimitive |
(common, js, jvm, native)
serialize |
Serializes the value of type T using the format that is represented by the given encoder. serialize method is format-agnostic and operates with a high-level structured Encoder API. Throws SerializationException if value cannot be serialized. fun serialize(encoder: Encoder, value: JsonPrimitive): Unit |