Json.NET
Code Coverage Statistics for Source File

Newtonsoft.Json\Serialization\JsonProperty.cs

Symbol Coverage: 0.00% (0 of 2)

Branch Coverage: 97.22% (35 of 36)

Cyclomatic Complexity Avg: 1.00 Max:1

Code Lines: 2


L V Source
1
#region License
2
// Copyright (c) 2007 James Newton-King
3
//
4
// Permission is hereby granted, free of charge, to any person
5
// obtaining a copy of this software and associated documentation
6
// files (the "Software"), to deal in the Software without
7
// restriction, including without limitation the rights to use,
8
// copy, modify, merge, publish, distribute, sublicense, and/or sell
9
// copies of the Software, and to permit persons to whom the
10
// Software is furnished to do so, subject to the following
11
// conditions:
12
//
13
// The above copyright notice and this permission notice shall be
14
// included in all copies or substantial portions of the Software.
15
//
16
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
// OTHER DEALINGS IN THE SOFTWARE.
24
#endregion
25

  
26
using System;
27

  
28
namespace Newtonsoft.Json.Serialization
29
{
30
  /// <summary>
31
  /// Maps a JSON property to a .NET member.
32
  /// </summary>
33
  public class JsonProperty
34
  {
35
    /// <summary>
36
    /// Gets the name of the property.
37
    /// </summary>
38
    /// <value>The name of the property.</value>
39
    public string PropertyName { get; set; }
40

  
41
    /// <summary>
42
    /// Gets the <see cref="IValueProvider"/> that will get and set the <see cref="JsonProperty"/> during serialization.
43
    /// </summary>
44
    /// <value>The <see cref="IValueProvider"/> that will get and set the <see cref="JsonProperty"/> during serialization.</value>
45
    public IValueProvider ValueProvider { get; set; }
46

  
47
    /// <summary>
48
    /// Gets or sets the type of the property.
49
    /// </summary>
50
    /// <value>The type of the property.</value>
51
    public Type PropertyType { get; set; }
52

  
53
    /// <summary>
54
    /// Gets or sets the <see cref="JsonConverter" /> for the property.
55
    /// If set this converter takes presidence over the contract converter for the property type.
56
    /// </summary>
57
    /// <value>The converter.</value>
58
    public JsonConverter Converter { get; set; }
59

  
60
    /// <summary>
61
    /// Gets a value indicating whether this <see cref="JsonProperty"/> is ignored.
62
    /// </summary>
63
    /// <value><c>true</c> if ignored; otherwise, <c>false</c>.</value>
64
    public bool Ignored { get; set; }
65

  
66
    /// <summary>
67
    /// Gets a value indicating whether this <see cref="JsonProperty"/> is readable.
68
    /// </summary>
69
    /// <value><c>true</c> if readable; otherwise, <c>false</c>.</value>
70
    public bool Readable { get; set; }
71

  
72
    /// <summary>
73
    /// Gets a value indicating whether this <see cref="JsonProperty"/> is writable.
74
    /// </summary>
75
    /// <value><c>true</c> if writable; otherwise, <c>false</c>.</value>
76
    public bool Writable { get; set; }
77

  
78
    /// <summary>
79
    /// Gets the member converter.
80
    /// </summary>
81
    /// <value>The member converter.</value>
82
    public JsonConverter MemberConverter { get; set; }
83

  
84
    /// <summary>
85
    /// Gets the default value.
86
    /// </summary>
87
    /// <value>The default value.</value>
88
    public object DefaultValue { get; set; }
89

  
90
    /// <summary>
91
    /// Gets a value indicating whether this <see cref="JsonProperty"/> is required.
92
    /// </summary>
93
    /// <value>A value indicating whether this <see cref="JsonProperty"/> is required.</value>
94
    public Required Required { get; set; }
95

  
96
    /// <summary>
97
    /// Gets a value indicating whether this property preserves object references.
98
    /// </summary>
99
    /// <value>
100
    /// 	<c>true</c> if this instance is reference; otherwise, <c>false</c>.
101
    /// </value>
102
    public bool? IsReference { get; set; }
103

  
104
    /// <summary>
105
    /// Gets the property null value handling.
106
    /// </summary>
107
    /// <value>The null value handling.</value>
108
    public NullValueHandling? NullValueHandling { get; set; }
109

  
110
    /// <summary>
111
    /// Gets the property default value handling.
112
    /// </summary>
113
    /// <value>The default value handling.</value>
114
    public DefaultValueHandling? DefaultValueHandling { get; set; }
115

  
116
    /// <summary>
117
    /// Gets the property reference loop handling.
118
    /// </summary>
119
    /// <value>The reference loop handling.</value>
120
    public ReferenceLoopHandling? ReferenceLoopHandling { get; set; }
121

  
122
    /// <summary>
123
    /// Gets the property object creation handling.
124
    /// </summary>
125
    /// <value>The object creation handling.</value>
126
    public ObjectCreationHandling? ObjectCreationHandling { get; set; }
127

  
128
    /// <summary>
129
    /// Gets or sets the type name handling.
130
    /// </summary>
131
    /// <value>The type name handling.</value>
132
    public TypeNameHandling? TypeNameHandling { get; set; }
133

  
134
    /// <summary>
135
    /// Gets or sets a predicate used to determine whether the property should be serialize.
136
    /// </summary>
137
    /// <value>A predicate used to determine whether the property should be serialize.</value>
138
    public Predicate<object> ShouldSerialize { get; set; }
139

  
140
    /// <summary>
141
    /// Returns a <see cref="String"/> that represents this instance.
142
    /// </summary>
143
    /// <returns>
144
    /// A <see cref="String"/> that represents this instance.
145
    /// </returns>
146
    public override string ToString()
147
    {
148
 0
      return PropertyName;
149
 0
    }
150
  }
151
}