Class StringOrArrayConverter
string or array json converter
Inheritance
object
JsonConverter
JsonConverter<object>
StringOrArrayConverter
Namespace: Xrpl.Client.Json.Converters
Assembly: Xrpl.dll
Syntax
public class StringOrArrayConverter : JsonConverter<object>
Methods
| Edit this page View SourceCanConvert(Type)
Determines whether the specified type can be converted.
Declaration
public override bool CanConvert(Type typeToConvert)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | typeToConvert | The type to compare against. |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
System.Text.Json.Serialization.JsonConverter<object>.CanConvert(System.Type)
|
Edit this page
View Source
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
read string or array from json object
Declaration
public override object Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonReader | reader | json reader |
| Type | typeToConvert | target type |
| JsonSerializerOptions | options | json serializer options |
Returns
| Type | Description |
|---|---|
| object | string or array |
Overrides
System.Text.Json.Serialization.JsonConverter<object>.Read(ref System.Text.Json.Utf8JsonReader, System.Type, System.Text.Json.JsonSerializerOptions)
Exceptions
| Type | Condition |
|---|---|
| JsonException | Cannot convert value |
Write(Utf8JsonWriter, object, JsonSerializerOptions)
write string or array to json object
Declaration
public override void Write(Utf8JsonWriter writer, object value, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonWriter | writer | writer |
| object | value | string or array value |
| JsonSerializerOptions | options | json serializer options |
Overrides
System.Text.Json.Serialization.JsonConverter<object>.Write(System.Text.Json.Utf8JsonWriter, object, System.Text.Json.JsonSerializerOptions)
Exceptions
| Type | Condition |
|---|---|
| JsonException | Cannot write value |