Share via


SystemTextJsonFormatter Class

Definition

A formatter that emits UTF-8 encoded JSON where user data should be serializable via the JsonSerializer.

public class SystemTextJsonFormatter : StreamJsonRpc.FormatterBase, StreamJsonRpc.IJsonRpcMessageFactory, StreamJsonRpc.IJsonRpcMessageTextFormatter, StreamJsonRpc.Reflection.IJsonRpcFormatterTracingCallbacks
type SystemTextJsonFormatter = class
    inherit FormatterBase
    interface IJsonRpcMessageFormatter
    interface IJsonRpcMessageTextFormatter
    interface IJsonRpcInstanceContainer
    interface IJsonRpcMessageFactory
    interface IJsonRpcFormatterTracingCallbacks
Public Class SystemTextJsonFormatter
Inherits FormatterBase
Implements IJsonRpcFormatterTracingCallbacks, IJsonRpcMessageFactory, IJsonRpcMessageTextFormatter
Inheritance
SystemTextJsonFormatter
Implements

Constructors

SystemTextJsonFormatter()

Initializes a new instance of the SystemTextJsonFormatter class.

Properties

ApplicableMethodAttributeOnDeserializingMethod

Gets the JsonRpcMethodAttribute that is present on the method that may be invoked to serve the incoming request, when applicable.

(Inherited from FormatterBase)
DuplexPipeTracker

Gets the helper for marshaling pipes as RPC method arguments.

(Inherited from FormatterBase)
Encoding

Gets or sets the encoding used for serialization for methods that do not take an explicit Encoding.

EnumerableTracker

Gets the helper for marshaling IAsyncEnumerable<T> in RPC method arguments or return values.

(Inherited from FormatterBase)
FormatterProgressTracker

Gets the MessageFormatterProgressTracker instance containing useful methods to help on the implementation of message formatters.

(Inherited from FormatterBase)
JsonRpc

Gets the JsonRpc that is associated with this formatter.

(Inherited from FormatterBase)
JsonSerializerOptions

Gets or sets the options to use when serializing and deserializing JSON containing user data.

MultiplexingStream

Gets or sets the MultiplexingStream that may be used to establish out of band communication (e.g. marshal IDuplexPipe arguments).

(Inherited from FormatterBase)

Methods

Deserialize(ReadOnlySequence<Byte>, Encoding)

Deserializes a sequence of bytes to a JsonRpcMessage.

Deserialize(ReadOnlySequence<Byte>)

Deserializes a JsonRpcMessage.

Dispose() (Inherited from FormatterBase)
Dispose(Boolean)

Disposes managed and native resources held by this instance.

(Inherited from FormatterBase)
GetJsonText(JsonRpcMessage)

Gets a JSON representation for a given message for tracing purposes.

Serialize(IBufferWriter<Byte>, JsonRpcMessage)

Serializes a JsonRpcMessage.

TrackDeserialization(JsonRpcMessage, ReadOnlySpan<ParameterInfo>)

Sets up state to track deserialization of a message.

(Inherited from FormatterBase)
TrackSerialization(JsonRpcMessage)

Sets up state to track serialization of a message.

(Inherited from FormatterBase)

Explicit Interface Implementations

IJsonRpcFormatterState.DeserializingMessageWithId

Gets the ID of the response currently being deserialized.

(Inherited from FormatterBase)
IJsonRpcFormatterState.SerializingMessageWithId

Gets the id of the request or response currently being serialized.

(Inherited from FormatterBase)
IJsonRpcFormatterState.SerializingRequest

Gets a value indicating whether a JsonRpcRequest is being serialized.

(Inherited from FormatterBase)
IJsonRpcFormatterTracingCallbacks.OnSerializationComplete(JsonRpcMessage, ReadOnlySequence<Byte>)
IJsonRpcInstanceContainer.Rpc

Sets the JsonRpc instance.

(Inherited from FormatterBase)
IJsonRpcMessageFactory.CreateErrorMessage()
IJsonRpcMessageFactory.CreateRequestMessage()
IJsonRpcMessageFactory.CreateResultMessage()

Applies to