~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/Newtonsoft.Json/Doc/SerializingJSON.aml

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
Import upstream version 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="utf-8"?>
 
2
<topic id="SerializingJSON" revisionNumber="1">
 
3
  <developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
 
4
    <!--
 
5
    <summary>
 
6
      <para>Optional summary abstract</para>
 
7
    </summary>
 
8
    -->
 
9
    <introduction>
 
10
      <para>The quickest method of converting between JSON text and a .NET object is using the
 
11
      <codeEntityReference>T:Newtonsoft.Json.JsonSerializer</codeEntityReference>.
 
12
      The JsonSerializer converts .NET objects into their JSON equivalent and back again by mapping the .NET object property names to the JSON property names
 
13
      and copies the values for you.</para>
 
14
    </introduction>
 
15
    <!-- Optional procedures followed by optional code example but must have
 
16
         at least one procedure or code example -->
 
17
<section>
 
18
 <title>JsonConvert</title>
 
19
 <content><para>For simple scenarios where you want to convert to and from a JSON string the
 
20
 <codeEntityReference>Overload:Newtonsoft.Json.JsonConvert.SerializeObject</codeEntityReference> and
 
21
 <codeEntityReference>Overload:Newtonsoft.Json.JsonConvert.DeserializeObject</codeEntityReference>
 
22
 methods on JsonConvert provide an easy to use wrapper over JsonSerializer.</para>
 
23
 <code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\SerializationTests.cs" region="SerializeObject" title="Serializing and Deserializing JSON with JsonConvert" />
 
24
<para>
 
25
        SerializeObject and DeserializeObject both have overloads that take a <codeEntityReference>T:Newtonsoft.Json.JsonSerializerSettings</codeEntityReference> object.
 
26
        JsonSerializerSettings lets you use many of the JsonSerializer settings listed below while still using the simple serialization methods.
 
27
</para>
 
28
</content>
 
29
</section>
 
30
 
 
31
<section>
 
32
 <title>JsonSerializer</title>
 
33
 <content><para>For more control over how an object is serialized the <codeEntityReference>T:Newtonsoft.Json.JsonSerializer</codeEntityReference> can be used directly.
 
34
The JsonSerializer is able to read and write JSON text directly to a stream via <codeEntityReference>T:Newtonsoft.Json.JsonTextReader</codeEntityReference>
 
35
and <codeEntityReference>T:Newtonsoft.Json.JsonTextWriter</codeEntityReference>.
 
36
Other kinds of JsonWriters can also be used such as
 
37
<codeEntityReference>T:Newtonsoft.Json.Linq.JTokenReader</codeEntityReference>/<codeEntityReference>T:Newtonsoft.Json.Linq.JTokenWriter</codeEntityReference>
 
38
to convert your object to and from
 
39
LINQ to JSON objects or
 
40
<codeEntityReference>T:Newtonsoft.Json.Bson.BsonReader</codeEntityReference>/<codeEntityReference>T:Newtonsoft.Json.Bson.BsonWriter</codeEntityReference> to convert to and from BSON.</para>
 
41
 
 
42
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\SerializationTests.cs" region="JsonSerializerToStream" title="Serializing JSON to a Stream with JsonSerializer" />
 
43
 
 
44
<para>JsonSerializer has a number of properties on it to customize how it serializes JSON. These can also be used with the methods on JsonConvert via the JsonSerializerSettings overloads.</para>
 
45
<para>Read more about the available JsonSerializer settings here: <externalLink>
 
46
<linkText>Serialization Settings</linkText>
 
47
<linkUri>SerializationSettings.htm</linkUri>
 
48
<linkTarget>_self</linkTarget>
 
49
</externalLink></para>
 
50
</content>
 
51
</section>
 
52
    <relatedTopics>
 
53
      <externalLink>
 
54
        <linkText>Serialization Guide</linkText>
 
55
        <linkUri>SerializationGuide.htm</linkUri>
 
56
        <linkTarget>_self</linkTarget>
 
57
      </externalLink>
 
58
      <externalLink>
 
59
        <linkText>Serialization Settings</linkText>
 
60
        <linkUri>SerializationSettings.htm</linkUri>
 
61
        <linkTarget>_self</linkTarget>
 
62
      </externalLink>
 
63
      <externalLink>
 
64
        <linkText>Serialization Attributes</linkText>
 
65
        <linkUri>SerializationAttributes.htm</linkUri>
 
66
        <linkTarget>_self</linkTarget>
 
67
      </externalLink>
 
68
      <externalLink>
 
69
        <linkText>Serializing Partial JSON Fragments</linkText>
 
70
        <linkUri>SerializingJSONFragments.htm</linkUri>
 
71
        <linkTarget>_self</linkTarget>
 
72
      </externalLink>
 
73
 
 
74
      <codeEntityReference>T:Newtonsoft.Json.JsonConvert</codeEntityReference>
 
75
      <codeEntityReference>T:Newtonsoft.Json.JsonSerializer</codeEntityReference>
 
76
      <codeEntityReference>T:Newtonsoft.Json.JsonSerializerSettings</codeEntityReference>
 
77
    </relatedTopics>
 
78
  </developerConceptualDocument>
 
79
</topic>
 
 
b'\\ No newline at end of file'