Show / Hide Table of Contents

Class LenientXrplNumberConverter

Reads an XRPL Number field of a model that comes from a node - a ledger entry or a transaction response - so that a value this version cannot read costs that field, not the object around it.

Inheritance
object
JsonConverter
JsonConverter<XrplNumber?>
LenientXrplNumberConverter
Namespace: Xrpl.Client.Json.Converters
Assembly: Xrpl.dll
Syntax
public sealed class LenientXrplNumberConverter : JsonConverter<XrplNumber?>
Remarks

A node newer than this SDK may write a Number this version refuses (a wider mantissa, say). The strict XrplNumberJsonConverter would fail the whole entry, and with it an account_objects page or a transaction. Here the field reads as null instead; the node's text is still in the response's Raw. Writing is the same as the strict converter.

Properties

| Edit this page View Source

HandleNull

Gets a value that indicates whether null should be passed to the converter on serialization, and whether System.Text.Json.JsonTokenType.Null should be passed on deserialization.

Declaration
public override bool HandleNull { get; }
Property Value
Type Description
bool
Overrides
System.Text.Json.Serialization.JsonConverter<Xrpl.BinaryCodec.Numbers.XrplNumber?>.HandleNull

Methods

| Edit this page View Source

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts the JSON to type System.Nullable.

Declaration
public override XrplNumber? 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
Nullable

The converted value.

Overrides
System.Text.Json.Serialization.JsonConverter<Xrpl.BinaryCodec.Numbers.XrplNumber?>.Read(ref System.Text.Json.Utf8JsonReader, System.Type, System.Text.Json.JsonSerializerOptions)
| Edit this page View Source

Write(Utf8JsonWriter, XrplNumber?, JsonSerializerOptions)

Writes a specified value as JSON.

Declaration
public override void Write(Utf8JsonWriter writer, XrplNumber? value, JsonSerializerOptions options)
Parameters
Type Name Description
Utf8JsonWriter writer

The writer to write to.

Nullable value

The value to convert to JSON.

JsonSerializerOptions options

An object that specifies serialization options to use.

Overrides
System.Text.Json.Serialization.JsonConverter<Xrpl.BinaryCodec.Numbers.XrplNumber?>.Write(System.Text.Json.Utf8JsonWriter, Xrpl.BinaryCodec.Numbers.XrplNumber?, System.Text.Json.JsonSerializerOptions)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX