Show / Hide Table of Contents

Class InnerObjectListConverter<T>

Reads and writes an STArray of inner objects as a plain list of those objects.

Inheritance
object
JsonConverter
JsonConverter<List<T>>
InnerObjectListConverter<T>
AMMVoteEntryListConverter
AuthAccountEntryListConverter
DisabledValidatorListConverter
MajorityListConverter
Namespace: Xrpl.Models.Ledger
Assembly: Xrpl.dll
Syntax
public abstract class InnerObjectListConverter<T> : JsonConverter<List<T>>
Type Parameters
Name Description
T

The inner object type.

Remarks

rippled renders every member of an STArray wrapped in an object named after the inner object's field ([{"Majority": {...}}, ...]), so binding the array straight to a list of the inner type yields elements with every field left at its default. This converter unwraps on read and wraps again on write. An element that is not wrapped is read as the inner object itself, so a list built by hand in the flat shape still binds.

Constructors

| Edit this page View Source

InnerObjectListConverter(string)

Declaration
protected InnerObjectListConverter(string wrapperName)
Parameters
Type Name Description
string wrapperName

The field name rippled wraps each element in.

Methods

| Edit this page View Source

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts the JSON to type System.Collections.Generic.List{`0}.

Declaration
public override List<T> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
Type Name Description
Utf8JsonReader reader

The reader.

Type typeToConvert

The type to convert.

JsonSerializerOptions options

An object that specifies serialization options to use.

Returns
Type Description
List<T>

The converted value.

Overrides
System.Text.Json.Serialization.JsonConverter<System.Collections.Generic.List<T>>.Read(ref System.Text.Json.Utf8JsonReader, System.Type, System.Text.Json.JsonSerializerOptions)
Exceptions
Type Condition
JsonException

The value is neither null nor an array.

| Edit this page View Source

Write(Utf8JsonWriter, List<T>, JsonSerializerOptions)

Writes a specified value as JSON.

Declaration
public override void Write(Utf8JsonWriter writer, List<T> value, JsonSerializerOptions options)
Parameters
Type Name Description
Utf8JsonWriter writer

The writer to write to.

List<T> value

The value to convert to JSON.

JsonSerializerOptions options

An object that specifies serialization options to use.

Overrides
System.Text.Json.Serialization.JsonConverter<System.Collections.Generic.List<T>>.Write(System.Text.Json.Utf8JsonWriter, System.Collections.Generic.List<T>, System.Text.Json.JsonSerializerOptions)
Exceptions
Type Condition
JsonException

The list holds a null element, which no STArray can carry.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX