2 types derived from JsonConverter
System.Text.Json (2)
System\Text\Json\Serialization\JsonConverterFactory.cs (1)
15public abstract class JsonConverterFactory : JsonConverter
System\Text\Json\Serialization\JsonConverterOfT.cs (1)
15public abstract partial class JsonConverter<T> : JsonConverter
213 references to JsonConverter
Microsoft.AspNetCore.Components.Web (1)
src\Components\Shared\src\JsonSerialization\JsonConverterFactoryTypeInfoResolver.cs (1)
28foreach (var converter in options.Converters)
Microsoft.AspNetCore.Grpc.JsonTranscoding (9)
Internal\Json\JsonConverterFactoryForEnum.cs (3)
25public override JsonConverter CreateConverter( 28var converter = (JsonConverter)Activator.CreateInstance(
Internal\Json\JsonConverterFactoryForWellKnownTypes.cs (3)
37public override JsonConverter CreateConverter( 43var converter = (JsonConverter)Activator.CreateInstance(
Internal\Json\JsonConverterFactoryForWrappers.cs (3)
38public override JsonConverter CreateConverter( 41var converter = (JsonConverter)Activator.CreateInstance(
Microsoft.CodeAnalysis.ExternalAccess.Razor (2)
Remote\RazorServiceDescriptorsWrapper.cs (2)
39ImmutableArray<JsonConverter> jsonConverters, 49public static ImmutableArray<JsonConverter> GetLspConverters()
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Protocol\Converters\SumConverter.cs (2)
23public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) 26return (JsonConverter)Activator.CreateInstance(converterType)!;
Protocol\Extensions\Converters\VSExtensionUtilities.cs (1)
29private static void AddConverters(IList<JsonConverter> converters)
Protocol\Internal\Converters\VSInternalExtensionUtilities.cs (1)
27private static void AddConverters(IList<JsonConverter> converters)
Microsoft.CodeAnalysis.Remote.Workspaces (5)
RemoteSerializationOptions.cs (5)
40public RemoteSerializationOptions(ImmutableArray<System.Text.Json.Serialization.JsonConverter> jsonConverters) 45public ImmutableArray<System.Text.Json.Serialization.JsonConverter> SystemTextJsonConverters => (ImmutableArray<System.Text.Json.Serialization.JsonConverter>)_options; 52ImmutableArray<System.Text.Json.Serialization.JsonConverter> => ServiceJsonRpcDescriptor.Formatters.UTF8SystemTextJson, 75foreach (var converter in SystemTextJsonConverters)
Microsoft.JSInterop (2)
Infrastructure\DotNetObjectReferenceJsonConverterFactory.cs (2)
25public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) 31return (JsonConverter)Activator.CreateInstance(converterType, JSRuntime)!;
Shared (11)
JsonSchemaExporter\JsonSchemaExporter.cs (5)
96JsonConverter? customConverter = null, 116JsonConverter effectiveConverter = customConverter ?? typeInfo.Converter; 677private static JsonConverter? ExtractCustomNullableConverter(JsonConverter? converter) 730private static JsonSchema GetEnumConverterSchema(JsonTypeInfo typeInfo, JsonConverter converter)
JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (6)
31public static bool IsBuiltInConverter(JsonConverter converter) => 32converter.GetType().Assembly == typeof(JsonConverter).Assembly; 62public static JsonConverter GetElementConverter(JsonConverter nullableConverter) 76return (JsonConverter)thisFieldInfo.GetValue(nullableConverter)!; 79public static void GetEnumConverterConfig(JsonConverter enumConverter, out JsonNamingPolicy? namingPolicy, out bool allowString)
System.Text.Json (177)
System\Text\Json\Schema\JsonSchemaExporter.cs (2)
70JsonConverter? customConverter = null, 89JsonConverter effectiveConverter = customConverter ?? typeInfo.Converter;
System\Text\Json\Serialization\Attributes\JsonConverterAttribute.cs (2)
12/// The specified converter type must derive from <see cref="JsonConverter"/>. 47public virtual JsonConverter? CreateConverter(Type typeToConvert)
System\Text\Json\Serialization\Converters\CastingConverter.cs (4)
17private readonly JsonConverter _sourceConverter; 20internal override JsonConverter? NullableElementConverter => _sourceConverter.NullableElementConverter; 25internal CastingConverter(JsonConverter sourceConverter) 42internal override JsonConverter? SourceConverterForCastingConverter => _sourceConverter;
System\Text\Json\Serialization\Converters\Collection\IAsyncEnumerableConverterFactory.cs (2)
22public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options) 29return (JsonConverter)Activator.CreateInstance(converterType)!;
System\Text\Json\Serialization\Converters\Collection\IEnumerableConverterFactory.cs (3)
35public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options) 203JsonConverter converter = (JsonConverter)Activator.CreateInstance(
System\Text\Json\Serialization\Converters\Collection\JsonCollectionConverter.cs (2)
46/// The <see cref="JsonConverter.IsConvertibleCollection"/> property must also be set to <see langword="true"/>. 164ResolvePolymorphicConverter(jsonTypeInfo, ref state) is JsonConverter polymorphicConverter)
System\Text\Json\Serialization\Converters\Collection\JsonDictionaryConverter.cs (1)
186ResolvePolymorphicConverter(jsonTypeInfo, ref state) is JsonConverter polymorphicConverter)
System\Text\Json\Serialization\Converters\Collection\MemoryConverterFactory.cs (2)
24public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) 33return (JsonConverter)Activator.CreateInstance(
System\Text\Json\Serialization\Converters\FSharp\FSharpOptionConverter.cs (1)
15internal override JsonConverter? NullableElementConverter => _elementConverter;
System\Text\Json\Serialization\Converters\FSharp\FSharpTypeConverterFactory.cs (2)
29public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) 75return (JsonConverter)Activator.CreateInstance(converterFactoryType, constructorArguments)!;
System\Text\Json\Serialization\Converters\FSharp\FSharpValueOptionConverter.cs (1)
15internal override JsonConverter? NullableElementConverter => _elementConverter;
System\Text\Json\Serialization\Converters\JsonMetadataServicesConverter.cs (1)
25internal override JsonConverter? NullableElementConverter => Converter.NullableElementConverter;
System\Text\Json\Serialization\Converters\Node\JsonNodeConverterFactory.cs (1)
12public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Object\ObjectConverter.cs (1)
62JsonConverter runtimeConverter = options.GetConverterInternal(runtimeType);
System\Text\Json\Serialization\Converters\Object\ObjectConverterFactory.cs (3)
41public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options) 43JsonConverter converter; 95converter = (JsonConverter)Activator.CreateInstance(
System\Text\Json\Serialization\Converters\Object\ObjectDefaultConverter.cs (1)
89ResolvePolymorphicConverter(jsonTypeInfo, ref state) is JsonConverter polymorphicConverter)
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (1)
152ResolvePolymorphicConverter(jsonTypeInfo, ref state) is JsonConverter polymorphicConverter)
System\Text\Json\Serialization\Converters\Value\EnumConverterFactory.cs (3)
22public override JsonConverter CreateConverter(Type type, JsonSerializerOptions options) 31public static JsonConverter Create(Type enumType, EnumConverterOptions converterOptions, JsonNamingPolicy? namingPolicy, JsonSerializerOptions options) 40return (JsonConverter)converterType.CreateInstanceNoWrapExceptions(
System\Text\Json\Serialization\Converters\Value\NullableConverter.cs (1)
11internal override JsonConverter? NullableElementConverter => _elementConverter;
System\Text\Json\Serialization\Converters\Value\NullableConverterFactory.cs (5)
19public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options) 24JsonConverter valueConverter = options.GetConverterInternal(valueTypeToConvert); 35public static JsonConverter CreateValueConverter(Type valueTypeToConvert, JsonConverter valueConverter) 38return (JsonConverter)Activator.CreateInstance(
System\Text\Json\Serialization\Converters\Value\UnsupportedTypeConverterFactory.cs (4)
33public override JsonConverter CreateConverter(Type type, JsonSerializerOptions options) 39internal static JsonConverter CreateUnsupportedConverterForType(Type type, string? errorMessage = null) 41JsonConverter converter = (JsonConverter)Activator.CreateInstance(
System\Text\Json\Serialization\JsonConverter.cs (3)
20IsInternalConverter = GetType().Assembly == typeof(JsonConverter).Assembly; 159internal virtual JsonConverter? SourceConverterForCastingConverter => null; 165internal virtual JsonConverter? NullableElementConverter => null;
System\Text\Json\Serialization\JsonConverter.MetadataHandling.cs (5)
14internal JsonConverter? ResolvePolymorphicConverter(JsonTypeInfo jsonTypeInfo, ref ReadStack state) 22JsonConverter? polymorphicConverter = null; 69internal JsonConverter? ResolvePolymorphicConverter(object value, JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options, ref WriteStack state) 76JsonConverter? polymorphicConverter = null; 138internal bool TryHandleSerializedObjectReference(Utf8JsonWriter writer, object value, JsonSerializerOptions options, JsonConverter? polymorphicConverter, ref WriteStack state)
System\Text\Json\Serialization\JsonConverterFactory.cs (3)
33public abstract JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options); 35internal JsonConverter GetConverterInternal(Type typeToConvert, JsonSerializerOptions options) 39JsonConverter? converter = CreateConverter(typeToConvert, options);
System\Text\Json\Serialization\JsonConverterOfT.cs (2)
381JsonConverter? polymorphicConverter = canBePolymorphic ? 671if (result is null && DefaultJsonTypeInfoResolver.TryGetDefaultSimpleConverter(Type, out JsonConverter? defaultConverter))
System\Text\Json\Serialization\JsonNumberEnumConverter.cs (1)
29public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\JsonSerializer.Read.Document.cs (3)
26/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 57/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 169/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/>
System\Text\Json\Serialization\JsonSerializer.Read.Element.cs (4)
23/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 49/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 80/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 141/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/>
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (2)
25internal static bool TryReadMetadata(JsonConverter converter, JsonTypeInfo jsonTypeInfo, ref Utf8JsonReader reader, scoped ref ReadStack state) 492internal static void ValidateMetadataForArrayConverter(JsonConverter converter, ref Utf8JsonReader reader, scoped ref ReadStack state)
System\Text\Json\Serialization\JsonSerializer.Read.Node.cs (3)
25/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 47/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 132/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/>
System\Text\Json\Serialization\JsonSerializer.Read.Span.cs (3)
26/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 53/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 129/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/>
System\Text\Json\Serialization\JsonSerializer.Read.Stream.cs (6)
39/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 75/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 113/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 154/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 333/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 380/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/>
System\Text\Json\Serialization\JsonSerializer.Read.String.cs (6)
39/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 76/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 111/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 155/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 347/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 401/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/>
System\Text\Json\Serialization\JsonSerializer.Read.Utf8JsonReader.cs (3)
30/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 84/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 241/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/>
System\Text\Json\Serialization\JsonSerializer.Write.ByteArray.cs (3)
20/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 47/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 119/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/>
System\Text\Json\Serialization\JsonSerializer.Write.Document.cs (3)
21/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 46/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 110/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/>
System\Text\Json\Serialization\JsonSerializer.Write.Element.cs (3)
21/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 46/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 110/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/>
System\Text\Json\Serialization\JsonSerializer.Write.HandleMetadata.cs (2)
18JsonConverter jsonConverter, 63JsonConverter jsonConverter,
System\Text\Json\Serialization\JsonSerializer.Write.Node.cs (3)
22/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 47/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 111/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/>
System\Text\Json\Serialization\JsonSerializer.Write.Pipe.cs (3)
59/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 129/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 171/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/>
System\Text\Json\Serialization\JsonSerializer.Write.Stream.cs (6)
36/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 67/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 102/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 138/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 297/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 335/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/>
System\Text\Json\Serialization\JsonSerializer.Write.String.cs (3)
21/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 47/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 129/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/>
System\Text\Json\Serialization\JsonSerializer.Write.Utf8JsonWriter.cs (3)
23/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 56/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 143/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/>
System\Text\Json\Serialization\JsonSerializerOptions.Converters.cs (10)
23public IList<JsonConverter> Converters => _converters ??= new(this); 33/// The configured <see cref="JsonConverter"/> for <paramref name="typeToConvert"/> returned an invalid converter. 36/// There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> 41public JsonConverter GetConverter(Type typeToConvert) 64internal JsonConverter GetConverterInternal(Type typeToConvert) 70internal JsonConverter? GetConverterFromList(Type typeToConvert) 74foreach (JsonConverter item in converterList) 87internal JsonConverter? ExpandConverterFactory(JsonConverter? converter, Type typeToConvert) 97internal static void CheckConverterNullabilityIsSameAsPropertyType(JsonConverter converter, Type propertyType)
System\Text\Json\Serialization\JsonSerializerOptions.cs (3)
867/// Read-only instances use caching when querying <see cref="JsonConverter"/> and <see cref="JsonTypeInfo"/> metadata. 1074private sealed class ConverterList : ConfigurationList<JsonConverter> 1078public ConverterList(JsonSerializerOptions options, IList<JsonConverter>? source = null)
System\Text\Json\Serialization\JsonStringEnumConverter.cs (2)
53public sealed override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) 112public sealed override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Converters.cs (14)
15private static Dictionary<Type, JsonConverter>? s_defaultSimpleConverters; 41private static Dictionary<Type, JsonConverter> GetDefaultSimpleConverters() 44var converters = new Dictionary<Type, JsonConverter>(NumberOfSimpleConverters); 88void Add(JsonConverter converter) => 94private static JsonConverter GetBuiltInConverter(Type typeToConvert) 99if (s_defaultSimpleConverters.TryGetValue(typeToConvert, out JsonConverter? converter)) 120internal static bool TryGetDefaultSimpleConverter(Type typeToConvert, [NotNullWhen(true)] out JsonConverter? converter) 133private static JsonConverter? GetCustomConverterForMember(Type typeToConvert, MemberInfo memberInfo, JsonSerializerOptions options) 144internal static JsonConverter GetConverterForType(Type typeToConvert, JsonSerializerOptions options, bool resolveJsonConverterAttribute = true) 147JsonConverter? converter = options.GetConverterFromList(typeToConvert); 175private static JsonConverter GetConverterFromAttribute(JsonConverterAttribute converterAttribute, Type typeToConvert, MemberInfo? memberInfo, JsonSerializerOptions options) 177JsonConverter? converter; 193if (!typeof(JsonConverter).IsAssignableFrom(converterType) || ctor == null || !ctor.IsPublic) 198converter = (JsonConverter)Activator.CreateInstance(converterType)!;
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.cs (1)
88JsonConverter converter = GetConverterForType(type, options);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (4)
46private static JsonTypeInfo CreateTypeInfoCore(Type type, JsonConverter converter, JsonSerializerOptions options) 242JsonConverter? customConverter; 325JsonConverter? customConverter, 451private static Func<object>? DetermineCreateObjectDelegate(Type type, JsonConverter converter)
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (1)
331internal static JsonConverter<T> GetTypedConverter<T>(JsonConverter converter)
System\Text\Json\Serialization\Metadata\JsonMetadataServices.cs (1)
83public static JsonTypeInfo<T> CreateValueInfo<T>(JsonSerializerOptions options, JsonConverter converter)
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (1)
15private static JsonTypeInfo<T> CreateCore<T>(JsonConverter converter, JsonSerializerOptions options)
System\Text\Json\Serialization\Metadata\JsonParameterInfo.cs (1)
117internal JsonConverter EffectiveConverter => MatchingProperty.EffectiveConverter;
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (4)
25internal JsonConverter EffectiveConverter 34private protected JsonConverter? _effectiveConverter; 48public JsonConverter? CustomConverter 58private JsonConverter? _customConverter;
System\Text\Json\Serialization\Metadata\JsonPropertyInfoValuesOfT.cs (1)
42/// A <see cref="JsonConverter"/> for the property or field, specified by <see cref="JsonConverterAttribute"/>.
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (9)
42internal JsonTypeInfo(Type type, JsonConverter converter, JsonSerializerOptions options) 446/// Gets the <see cref="JsonConverter"/> associated with the current type. 449/// The <see cref="JsonConverter"/> associated with the type determines the value of <see cref="Kind"/>, 453public JsonConverter Converter { get; } 463/// The value of <see cref="Kind"/> is determined exclusively by the <see cref="JsonConverter"/> 914JsonConverter converter = DefaultJsonTypeInfoResolver.GetConverterForType(typeof(T), options, resolveJsonConverterAttribute: false); 955JsonConverter converter = DefaultJsonTypeInfoResolver.GetConverterForType(type, options, resolveJsonConverterAttribute: false); 961internal static JsonTypeInfo CreateJsonTypeInfo(Type type, JsonConverter converter, JsonSerializerOptions options) 975parameterTypes: [typeof(JsonConverter), typeof(JsonSerializerOptions)],
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.cs (1)
19internal JsonTypeInfo(JsonConverter converter, JsonSerializerOptions options)
System\Text\Json\Serialization\ReadStack.cs (2)
210public JsonConverter InitializePolymorphicReEntry(JsonTypeInfo derivedJsonTypeInfo) 230public JsonConverter ResumePolymorphicReEntry()
System\Text\Json\Serialization\WriteStackFrame.cs (2)
140public JsonConverter InitializePolymorphicReEntry(JsonTypeInfo derivedJsonTypeInfo) 152public JsonConverter ResumePolymorphicReEntry()
System\Text\Json\ThrowHelper.Serialization.cs (4)
44public static void ThrowNotSupportedException_DictionaryKeyTypeNotSupported(Type keyType, JsonConverter converter) 128public static void ThrowJsonException_SerializationConverterRead(JsonConverter? converter) 134public static void ThrowJsonException_SerializationConverterWrite(JsonConverter? converter) 392public static void ThrowInvalidOperationException_ConverterCanConvertMultipleTypes(Type runtimePropertyType, JsonConverter jsonConverter)
System.Windows.Forms (2)
System\Windows\Forms\OLE\Clipboard.cs (1)
547/// to save the data onto the clipboard, or create a custom <see cref="Text.Json.Serialization.JsonConverter"/>, attach the
System\Windows\Forms\OLE\DataObject.cs (1)
142/// or create a custom <see cref="Text.Json.Serialization.JsonConverter"/>, attach the