Assembly: OptimaJet.Workflow.Core

Class SystemTextStringTypeConverter

OptimaJet.Workflow.Core.Designer.SystemTextStringTypeConverter

Provides a JsonConverter<T> that serializes Type values as URL-encoded names produced by ParsedType.GetFriendlyName(Type) and deserializes those names.

public class SystemTextStringTypeConverter : JsonConverter<Type?>

Type Hierarchy

Methods

public override Type? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) #
Reads a JSON string containing a URL-encoded type name in the syntax accepted by ParsedType.Parse(string) and resolves it to a Type.

Parameters

Name
Type
Description
reader
Utf8JsonReader
The Utf8JsonReader positioned at the value to read.
typeToConvert
Type
The Type being converted.
options
JsonSerializerOptions
The JsonSerializerOptions for the deserialization operation.

Returns

Type
Description
Type
The resolved Type, or null when reader is positioned at JsonTokenType.Null.

Exceptions

Type
Description
JsonException
The current Utf8JsonReader.TokenType is neither JsonTokenType.String nor JsonTokenType.Null, or the string does not identify a resolvable Type.
public override void Write(Utf8JsonWriter writer, Type? value, JsonSerializerOptions options) #
Writes a Type as a JSON string containing the URL-encoded result of ParsedType.GetFriendlyName(Type), or writes JSON null for a null value.

Parameters

Name
Type
Description
writer
Utf8JsonWriter
The Utf8JsonWriter that receives the JSON value.
value
Type
The Type to serialize, or null.
options
JsonSerializerOptions
The JsonSerializerOptions for the serialization operation.