C# Класс Newtonsoft.Json.JsonSerializer

Serializes and deserializes objects into and from the JSON format. The JsonSerializer enables you to control how objects are encoded into JSON.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Create ( JsonSerializerSettings settings ) : JsonSerializer

Creates a new JsonSerializer instance using the specified JsonSerializerSettings.

Deserialize ( JsonReader reader ) : object

Deserializes the Json structure contained by the specified JsonReader.

Deserialize ( JsonReader reader, Type objectType ) : object

Deserializes the Json structure contained by the specified JsonReader into an instance of the specified type.

Deserialize ( TextReader reader, Type objectType ) : object

Deserializes the Json structure contained by the specified StringReader into an instance of the specified type.

Deserialize ( JsonReader reader ) : T

Deserializes the Json structure contained by the specified JsonReader into an instance of the specified type.

JsonSerializer ( ) : System

Initializes a new instance of the JsonSerializer class.

Populate ( JsonReader reader, object target ) : void

Populates the JSON values onto the target object.

Populate ( TextReader reader, object target ) : void

Populates the JSON values onto the target object.

Serialize ( JsonWriter jsonWriter, object value ) : void

Serializes the specified Object and writes the Json structure to a Stream using the specified JsonWriter.

Serialize ( TextWriter textWriter, object value ) : void

Serializes the specified Object and writes the Json structure to a Stream using the specified TextWriter.

Приватные методы

Метод Описание
DeserializeInternal ( JsonReader reader, Type objectType ) : object
GetMatchingConverter ( IList converters, Type objectType ) : JsonConverter
GetMatchingConverter ( Type type ) : JsonConverter
OnError ( ErrorEventArgs e ) : void
PopulateInternal ( JsonReader reader, object target ) : void
SerializeInternal ( JsonWriter jsonWriter, object value ) : void

Описание методов

Create() публичный статический Метод

Creates a new JsonSerializer instance using the specified JsonSerializerSettings.
public static Create ( JsonSerializerSettings settings ) : JsonSerializer
settings JsonSerializerSettings The settings to be applied to the .
Результат JsonSerializer

Deserialize() публичный Метод

Deserializes the Json structure contained by the specified JsonReader.
public Deserialize ( JsonReader reader ) : object
reader JsonReader The that contains the JSON structure to deserialize.
Результат object

Deserialize() публичный Метод

Deserializes the Json structure contained by the specified JsonReader into an instance of the specified type.
public Deserialize ( JsonReader reader, Type objectType ) : object
reader JsonReader The containing the object.
objectType Type The of object being deserialized.
Результат object

Deserialize() публичный Метод

Deserializes the Json structure contained by the specified StringReader into an instance of the specified type.
public Deserialize ( TextReader reader, Type objectType ) : object
reader TextReader The containing the object.
objectType Type The of object being deserialized.
Результат object

Deserialize() публичный Метод

Deserializes the Json structure contained by the specified JsonReader into an instance of the specified type.
public Deserialize ( JsonReader reader ) : T
reader JsonReader The containing the object.
Результат T

JsonSerializer() публичный Метод

Initializes a new instance of the JsonSerializer class.
public JsonSerializer ( ) : System
Результат System

Populate() публичный Метод

Populates the JSON values onto the target object.
public Populate ( JsonReader reader, object target ) : void
reader JsonReader The that contains the JSON structure to reader values from.
target object The target object to populate values onto.
Результат void

Populate() публичный Метод

Populates the JSON values onto the target object.
public Populate ( TextReader reader, object target ) : void
reader TextReader The that contains the JSON structure to reader values from.
target object The target object to populate values onto.
Результат void

Serialize() публичный Метод

Serializes the specified Object and writes the Json structure to a Stream using the specified JsonWriter.
public Serialize ( JsonWriter jsonWriter, object value ) : void
jsonWriter JsonWriter The used to write the Json structure.
value object The to serialize.
Результат void

Serialize() публичный Метод

Serializes the specified Object and writes the Json structure to a Stream using the specified TextWriter.
public Serialize ( TextWriter textWriter, object value ) : void
textWriter TextWriter The used to write the Json structure.
value object The to serialize.
Результат void