ListJsonSerializationAdapter class final

Handles serialization and deserialization of List objects in Jetleaf’s JSON subsystem.

The ListJsonSerializationAdapter provides a reflection-aware adapter for converting JSON arrays into Dart List instances and vice versa.

Core Responsibilities

  • Deserialize JSON arrays into strongly-typed Dart List objects.
  • Serialize Dart List objects into JSON arrays.
  • Recursively handle nested arrays and objects by delegating to the appropriate deserializers in JsonDeserializationContext.
  • Skip null values during deserialization if they appear in the JSON.
  • Resolve element types via componentType metadata or runtime type.

Example

final adapter = ListJsonSerializationAdapter();

final parser = JsonParser('[1, 2, 3]');
final list = adapter.deserialize(parser, context, Class.forType(List));

final generator = JsonGenerator();
adapter.serialize(list, generator, serializerContext);

Notes

See also

Inheritance

Constructors

ListJsonSerializationAdapter()
Creates a constant instance of ListJsonSerializationAdapter.
const

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

canDeserialize(Class type) → bool
Returns whether the given type can be deserialized by the system.
override
canSerialize(Class type) → bool
Returns whether the given type can be serialized by the system.
override
deserialize(JsonParser parser, JsonDeserializationContext ctxt, Class toClass) → List?
Deserializes an object of type T using the given P and DeserializationContext.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
serialize(List value, JsonGenerator generator, JsonSerializationContext serializer) → void
Serializes an object of type T into an object using the provided Generator and SerializationContext.
override
supports(DeserializationContext<Parser> context) → bool
Determines whether this deserializer supports the given deserialization context.
inherited
supportsContext(SerializationContext<Generator> context) → bool
Determines whether this serializer supports the given serialization context.
inherited
toClass() → Class<List>
Provides a contract for types capable of exposing their associated runtime Class metadata representation within the Jetleaf reflection system.
toString() → String
A string representation of this object.
inherited

Operators

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