1 instantiation of TypeGenerationSpec
System.Text.Json.SourceGeneration (1)
JsonSourceGenerator.Parser.cs (1)
651
return new
TypeGenerationSpec
35 references to TypeGenerationSpec
System.Text.Json.SourceGeneration (35)
JsonSourceGenerator.Emitter.cs (31)
81
private readonly Dictionary<TypeRef,
TypeGenerationSpec
> _typeIndex = new();
106
foreach (
TypeGenerationSpec
spec in contextGenerationSpec.GeneratedTypes)
111
foreach (
TypeGenerationSpec
typeGenerationSpec in contextGenerationSpec.GeneratedTypes)
194
private SourceText? GenerateTypeInfo(ContextGenerationSpec contextSpec,
TypeGenerationSpec
typeGenerationSpec)
229
private static SourceText GenerateForTypeWithBuiltInConverter(ContextGenerationSpec contextSpec,
TypeGenerationSpec
typeMetadata)
246
private static SourceText GenerateForTypeWithCustomConverter(ContextGenerationSpec contextSpec,
TypeGenerationSpec
typeMetadata)
267
private static SourceText GenerateForNullable(ContextGenerationSpec contextSpec,
TypeGenerationSpec
typeMetadata)
288
private static SourceText GenerateForUnsupportedType(ContextGenerationSpec contextSpec,
TypeGenerationSpec
typeMetadata)
304
private static SourceText GenerateForEnum(ContextGenerationSpec contextSpec,
TypeGenerationSpec
typeMetadata)
320
private SourceText GenerateForCollection(ContextGenerationSpec contextSpec,
TypeGenerationSpec
typeGenerationSpec)
412
private void GenerateFastPathFuncForEnumerable(SourceWriter writer, string serializeMethodName,
TypeGenerationSpec
typeGenerationSpec)
415
TypeGenerationSpec
valueTypeGenerationSpec = _typeIndex[typeGenerationSpec.CollectionValueType];
465
private void GenerateFastPathFuncForDictionary(SourceWriter writer, string serializeMethodName,
TypeGenerationSpec
typeGenerationSpec)
471
TypeGenerationSpec
valueTypeGenerationSpec = _typeIndex[typeGenerationSpec.CollectionValueType];
494
private SourceText GenerateForObject(ContextGenerationSpec contextSpec,
TypeGenerationSpec
typeMetadata)
599
private void GeneratePropMetadataInitFunc(SourceWriter writer, string propInitMethodName,
TypeGenerationSpec
typeGenerationSpec)
715
private static void GenerateCtorParamMetadataInitFunc(SourceWriter writer, string ctorParamMetadataInitMethodName,
TypeGenerationSpec
typeGenerationSpec)
775
private void GenerateFastPathFuncForObject(SourceWriter writer, ContextGenerationSpec contextSpec, string serializeMethodName,
TypeGenerationSpec
typeGenSpec)
812
TypeGenerationSpec
propertyTypeSpec = _typeIndex[propertyGenSpec.PropertyType];
915
private static string GetParameterizedCtorInvocationFunc(
TypeGenerationSpec
typeGenerationSpec)
955
private static string? GetPrimitiveWriterMethod(
TypeGenerationSpec
type)
967
private static void GenerateFastPathFuncHeader(SourceWriter writer,
TypeGenerationSpec
typeGenSpec, string methodName, bool skipNullCheck = false)
996
private static void GenerateSerializeValueStatement(SourceWriter writer,
TypeGenerationSpec
typeSpec, string valueExpr)
1022
private static void GenerateSerializePropertyStatement(SourceWriter writer,
TypeGenerationSpec
typeSpec, string propertyNameExpr, string valueExpr)
1069
private static void GenerateTypeInfoFactoryHeader(SourceWriter writer,
TypeGenerationSpec
typeMetadata)
1400
foreach (
TypeGenerationSpec
metadata in contextSpec.GeneratedTypes)
1465
private static string CreateTypeInfoMethodName(
TypeGenerationSpec
typeSpec)
1469
private static string FormatDefaultConstructorExpr(
TypeGenerationSpec
typeSpec)
1508
private static bool ShouldGenerateMetadata(
TypeGenerationSpec
typeSpec)
1511
private static bool ShouldGenerateSerializationLogic(
TypeGenerationSpec
typeSpec)
1514
private static bool IsGenerationModeSpecified(
TypeGenerationSpec
typeSpec, JsonSourceGenerationMode mode)
JsonSourceGenerator.Parser.cs (4)
47
private readonly Dictionary<ITypeSymbol,
TypeGenerationSpec
> _generatedTypes = new(SymbolEqualityComparer.Default);
146
TypeGenerationSpec
spec = ParseTypeGenerationSpec(typeToGenerate, contextTypeSymbol, options);
212
if (_generatedTypes.TryGetValue(type, out
TypeGenerationSpec
? spec))
499
private
TypeGenerationSpec
ParseTypeGenerationSpec(in TypeToGenerate typeToGenerate, INamedTypeSymbol contextType, SourceGenerationOptionsSpec? options)