C# Class 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.
显示文件 Open project: neuromat/goalkeeper_restapi Class Usage Examples

Public Methods

Method Description
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.

Private Methods

Method Description
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

Method Details

Create() public static method

Creates a new JsonSerializer instance using the specified JsonSerializerSettings.
public static Create ( JsonSerializerSettings settings ) : JsonSerializer
settings JsonSerializerSettings The settings to be applied to the .
return JsonSerializer

Deserialize() public method

Deserializes the Json structure contained by the specified JsonReader.
public Deserialize ( JsonReader reader ) : object
reader JsonReader The that contains the JSON structure to deserialize.
return object

Deserialize() public method

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.
return object

Deserialize() public method

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.
return object

Deserialize() public method

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.
return T

JsonSerializer() public method

Initializes a new instance of the JsonSerializer class.
public JsonSerializer ( ) : System
return System

Populate() public method

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.
return void

Populate() public method

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.
return void

Serialize() public method

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.
return void

Serialize() public method

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.
return void