JsonMessageFormatter Class

Definition

Uses Newtonsoft.Json serialization to serialize JsonRpcMessage as JSON (text).

public class JsonMessageFormatter : StreamJsonRpc.IJsonRpcMessageTextFormatter
public class JsonMessageFormatter : StreamJsonRpc.IJsonRpcAsyncMessageTextFormatter
public class JsonMessageFormatter : IDisposable, StreamJsonRpc.IJsonRpcAsyncMessageTextFormatter, StreamJsonRpc.IJsonRpcInstanceContainer
public class JsonMessageFormatter : IDisposable, StreamJsonRpc.IJsonRpcAsyncMessageTextFormatter, StreamJsonRpc.IJsonRpcInstanceContainer, StreamJsonRpc.Reflection.IJsonRpcFormatterState
public class JsonMessageFormatter : IDisposable, StreamJsonRpc.IJsonRpcAsyncMessageTextFormatter, StreamJsonRpc.IJsonRpcInstanceContainer, StreamJsonRpc.IJsonRpcMessageFactory, StreamJsonRpc.Reflection.IJsonRpcFormatterState
type JsonMessageFormatter = class
    interface IJsonRpcMessageTextFormatter
    interface IJsonRpcMessageFormatter
type JsonMessageFormatter = class
    interface IJsonRpcAsyncMessageTextFormatter
    interface IJsonRpcAsyncMessageFormatter
    interface IJsonRpcMessageFormatter
    interface IJsonRpcMessageTextFormatter
type JsonMessageFormatter = class
    interface IJsonRpcAsyncMessageTextFormatter
    interface IJsonRpcAsyncMessageFormatter
    interface IJsonRpcMessageFormatter
    interface IJsonRpcMessageTextFormatter
    interface IJsonRpcInstanceContainer
    interface IDisposable
type JsonMessageFormatter = class
    interface IJsonRpcAsyncMessageTextFormatter
    interface IJsonRpcAsyncMessageFormatter
    interface IJsonRpcMessageFormatter
    interface IJsonRpcMessageTextFormatter
    interface IJsonRpcFormatterState
    interface IJsonRpcInstanceContainer
    interface IDisposable
type JsonMessageFormatter = class
    interface IJsonRpcAsyncMessageTextFormatter
    interface IJsonRpcAsyncMessageFormatter
    interface IJsonRpcMessageFormatter
    interface IJsonRpcMessageTextFormatter
    interface IJsonRpcFormatterState
    interface IJsonRpcInstanceContainer
    interface IJsonRpcMessageFactory
    interface IDisposable
Public Class JsonMessageFormatter
Implements IJsonRpcMessageTextFormatter
Public Class JsonMessageFormatter
Implements IJsonRpcAsyncMessageTextFormatter
Public Class JsonMessageFormatter
Implements IDisposable, IJsonRpcAsyncMessageTextFormatter, IJsonRpcInstanceContainer
Public Class JsonMessageFormatter
Implements IDisposable, IJsonRpcAsyncMessageTextFormatter, IJsonRpcFormatterState, IJsonRpcInstanceContainer
Public Class JsonMessageFormatter
Implements IDisposable, IJsonRpcAsyncMessageTextFormatter, IJsonRpcFormatterState, IJsonRpcInstanceContainer, IJsonRpcMessageFactory
Inheritance
JsonMessageFormatter
Implements

Remarks

Each instance of this class may only be used with a single JsonRpc instance.

Constructors

JsonMessageFormatter()

Initializes a new instance of the JsonMessageFormatter class that uses JsonProgress (without the preamble) for its text encoding.

JsonMessageFormatter(Encoding)

Initializes a new instance of the JsonMessageFormatter class.

Properties

Encoding

Gets or sets the encoding to use for transmitted messages.

JsonSerializer

Gets the Newtonsoft.Json.JsonSerializer used when serializing and deserializing method arguments and return values.

MultiplexingStream

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

ProtocolVersion

Gets or sets the version of the JSON-RPC protocol emulated by this instance.

Methods

Deserialize(JToken)

Deserializes a Newtonsoft.Json.Linq.JToken to a JsonRpcMessage.

Deserialize(ReadOnlySequence<Byte>)

Deserializes a JsonRpcMessage.

Deserialize(ReadOnlySequence<Byte>, Encoding)

Deserializes a sequence of bytes to a JsonRpcMessage.

DeserializeAsync(PipeReader, CancellationToken)

Deserializes a JsonRpcMessage.

DeserializeAsync(PipeReader, Encoding, CancellationToken)

Deserializes a sequence of bytes to a JsonRpcMessage.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Dispose(Boolean)

Disposes managed and native resources held by this instance.

GetJsonText(JsonRpcMessage)

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

Serialize(IBufferWriter<Byte>, JsonRpcMessage)

Serializes a JsonRpcMessage.

Serialize(JsonRpcMessage)

Serializes a JsonRpcMessage to a Newtonsoft.Json.Linq.JToken.

Explicit Interface Implementations

IJsonRpcFormatterState.DeserializingMessageWithId

Gets the ID of the response currently being deserialized.

IJsonRpcFormatterState.SerializingMessageWithId

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

IJsonRpcFormatterState.SerializingRequest

Gets a value indicating whether a JsonRpcRequest is being serialized.

IJsonRpcInstanceContainer.Rpc

Sets the JsonRpc instance.

IJsonRpcMessageFactory.CreateErrorMessage()

Creates an instance of JsonRpcError suitable for transmission over the IJsonRpcMessageFormatter.

IJsonRpcMessageFactory.CreateRequestMessage()

Creates an instance of JsonRpcRequest suitable for transmission over the IJsonRpcMessageFormatter.

IJsonRpcMessageFactory.CreateResultMessage()

Creates an instance of JsonRpcResult suitable for transmission over the IJsonRpcMessageFormatter.

Applies to