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