< Summary

Information
Class: System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<T>
Assembly: System.Text.Json
File(s): C:\h\w\B31A098C\w\BB5A0A33\e\runtime-utils\Runner\runtime\src\libraries\System.Text.Json\src\System\Text\Json\Serialization\Metadata\JsonPropertyInfoValuesOfT.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 15
Coverable lines: 15
Total lines: 91
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

File(s)

C:\h\w\B31A098C\w\BB5A0A33\e\runtime-utils\Runner\runtime\src\libraries\System.Text.Json\src\System\Text\Json\Serialization\Metadata\JsonPropertyInfoValuesOfT.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System.ComponentModel;
 5using System.Reflection;
 6
 7namespace System.Text.Json.Serialization.Metadata
 8{
 9    /// <summary>
 10    /// Provides serialization metadata about a property or field.
 11    /// </summary>
 12    /// <typeparam name="T">The type to convert of the <see cref="JsonConverter{T}"/> for the property.</typeparam>
 13    [EditorBrowsable(EditorBrowsableState.Never)]
 14    public sealed class JsonPropertyInfoValues<T>
 15    {
 16        /// <summary>
 17        /// If <see langword="true"/>, indicates that the member is a property, otherwise indicates the member is a fiel
 18        /// </summary>
 019        public bool IsProperty { get; init; }
 20
 21        /// <summary>
 22        /// Whether the property or field is public.
 23        /// </summary>
 024        public bool IsPublic { get; init; }
 25
 26        /// <summary>
 27        /// Whether the property or field is a virtual property.
 28        /// </summary>
 029        public bool IsVirtual { get; init; }
 30
 31        /// <summary>
 32        /// The declaring type of the property or field.
 33        /// </summary>
 034        public Type DeclaringType { get; init; } = null!;
 35
 36        /// <summary>
 37        /// The <see cref="JsonTypeInfo"/> info for the property or field's type.
 38        /// </summary>
 039        public JsonTypeInfo PropertyTypeInfo { get; init; } = null!;
 40
 41        /// <summary>
 42        /// A <see cref="JsonConverter"/> for the property or field, specified by <see cref="JsonConverterAttribute"/>.
 43        /// </summary>
 044        public JsonConverter<T>? Converter { get; init; }
 45
 46        /// <summary>
 47        /// Provides a mechanism to get the property or field's value.
 48        /// </summary>
 049        public Func<object, T?>? Getter { get; init; }
 50
 51        /// <summary>
 52        /// Provides a mechanism to set the property or field's value.
 53        /// </summary>
 054        public Action<object, T?>? Setter { get; init; }
 55
 56        /// <summary>
 57        /// Specifies a condition for the member to be ignored.
 58        /// </summary>
 059        public JsonIgnoreCondition? IgnoreCondition { get; init; }
 60
 61        /// <summary>
 62        /// Whether the property was annotated with <see cref="JsonIncludeAttribute"/>.
 63        /// </summary>
 064        public bool HasJsonInclude { get; init; }
 65
 66        /// <summary>
 67        /// Whether the property was annotated with <see cref="JsonExtensionDataAttribute"/>.
 68        /// </summary>
 069        public bool IsExtensionData { get; init; }
 70
 71        /// <summary>
 72        /// If the property or field is a number, specifies how it should processed when serializing and deserializing.
 73        /// </summary>
 074        public JsonNumberHandling? NumberHandling { get; init; }
 75
 76        /// <summary>
 77        /// The name of the property or field.
 78        /// </summary>
 079        public string PropertyName { get; init; } = null!;
 80
 81        /// <summary>
 82        /// The name to be used when processing the property or field, specified by <see cref="JsonPropertyNameAttribute
 83        /// </summary>
 084        public string? JsonPropertyName { get; init; }
 85
 86        /// <summary>
 87        /// Provides a <see cref="ICustomAttributeProvider"/> factory that maps to <see cref="JsonPropertyInfo.Attribute
 88        /// </summary>
 089        public Func<ICustomAttributeProvider>? AttributeProviderFactory { get; init; }
 90    }
 91}