JsonConverter<T> Třída

Definice

Převede objekt nebo hodnotu na JSON nebo.Converts an object or value to or from JSON.

generic <typename T>
public ref class JsonConverter abstract : System::Text::Json::Serialization::JsonConverter
public abstract class JsonConverter<T> : System.Text.Json.Serialization.JsonConverter
type JsonConverter<'T> = class
    inherit JsonConverter
Public MustInherit Class JsonConverter(Of T)
Inherits JsonConverter

Parametry typu

T

Typ objektu nebo hodnoty, kterou převaděč zpracovává.The type of object or value handled by the converter.

Dědičnost
JsonConverter<T>

Poznámky

Další informace najdete v tématu Postup zápisu vlastních převaděčů pro serializaci JSON.For more information, see How to write custom converters for JSON serialization.

Konstruktory

JsonConverter<T>()

Inicializuje novou JsonConverter<T> instanci.Initializes a new JsonConverter<T> instance.

Vlastnosti

HandleNull

Určuje, zda null má být předán převaděč při serializaci a zda Null má být předán při deserializaci.Indicates whether null should be passed to the converter on serialization, and whether Null should be passed on deserialization.

Metody

CanConvert(Type)

Určuje, zda lze zadaný typ převést.Determines whether the specified type can be converted.

Equals(Object)

Určí, zda se zadaný objekt rovná aktuálnímu objektu.Determines whether the specified object is equal to the current object.

(Zděděno od Object)
GetHashCode()

Slouží jako výchozí funkce hash.Serves as the default hash function.

(Zděděno od Object)
GetType()

Získá Type aktuální instanci.Gets the Type of the current instance.

(Zděděno od Object)
MemberwiseClone()

Vytvoří kopii aktuálního seznamu Object .Creates a shallow copy of the current Object.

(Zděděno od Object)
Read(Utf8JsonReader, Type, JsonSerializerOptions)

Přečte a převede kód JSON na typ T .Reads and converts the JSON to type T.

ToString()

Vrátí řetězec, který představuje aktuální objekt.Returns a string that represents the current object.

(Zděděno od Object)
Write(Utf8JsonWriter, T, JsonSerializerOptions)

Zapíše zadanou hodnotu jako JSON.Writes a specified value as JSON.

Platí pro