Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
JsonMetadataServices.cs
Go to the documentation of this file.
7
9
11public static class JsonMetadataServices
12{
14
16
18
20
22
24
26
28
30
32
34
36
38
40
42
44
46
48
50
52
54
56
58
60
62
64
66
68
70
72
74
76
78
80
82
84
86
88
90
92
94
96
98
100
102
104
105 [CLSCompliant(false)]
107
109
111
112 [CLSCompliant(false)]
114
115 [CLSCompliant(false)]
117
118 [CLSCompliant(false)]
120
122
124
129
134
139
144
149
154
159
164
169
174
179
184
189
194
199
204
209
214
219
224
229
234
236 {
237 return new EnumConverter<T>(EnumConverterOptions.AllowNumbers, options ?? throw new ArgumentNullException("options"));
238 }
239
241 {
242 if (underlyingTypeInfo == null)
243 {
244 throw new ArgumentNullException("underlyingTypeInfo");
245 }
246 JsonConverter<T> jsonConverter = underlyingTypeInfo.PropertyInfoForTypeInfo?.ConverterBase as JsonConverter<T>;
247 if (jsonConverter == null)
248 {
250 }
252 }
253
255 {
256 if (options == null)
257 {
258 throw new ArgumentNullException("options");
259 }
260 if (propertyInfo == null)
261 {
262 throw new ArgumentNullException("propertyInfo");
263 }
264 Type declaringType = propertyInfo.DeclaringType;
265 if (declaringType == null)
266 {
267 throw new ArgumentException("DeclaringType");
268 }
269 JsonTypeInfo propertyTypeInfo = propertyInfo.PropertyTypeInfo;
270 if (propertyTypeInfo == null)
271 {
272 throw new ArgumentException("PropertyTypeInfo");
273 }
274 string propertyName = propertyInfo.PropertyName;
275 if (propertyName == null)
276 {
277 throw new ArgumentException("PropertyName");
278 }
279 JsonConverter converter = propertyInfo.Converter;
280 if (converter == null)
281 {
283 if (converter == null)
284 {
286 }
287 }
288 if (!propertyInfo.IsProperty && propertyInfo.IsVirtual)
289 {
290 throw new InvalidOperationException(System.SR.Format(System.SR.FieldCannotBeVirtual, "IsProperty", "IsVirtual"));
291 }
293 jsonPropertyInfo.InitializeForSourceGen(options, propertyInfo);
294 return jsonPropertyInfo;
295 }
296
301
308
315}
static string ConverterForPropertyMustBeValid
Definition SR.cs:308
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string SerializationConverterNotCompatible
Definition SR.cs:192
static string FieldCannotBeVirtual
Definition SR.cs:324
Definition SR.cs:7
static JsonTypeInfo< TCollection > CreateICollectionInfo< TCollection, TElement >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo)
static JsonPropertyInfo CreateJsonPropertyInfoForClassInfo(Type type, JsonTypeInfo typeInfo, JsonConverter converter, JsonSerializerOptions options)
static JsonTypeInfo< TCollection > CreateIReadOnlyDictionaryInfo< TCollection, TKey, TValue >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo)
static JsonTypeInfo< TCollection > CreateIListInfo< TCollection >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo)
static JsonTypeInfo< TCollection > CreateIEnumerableInfo< TCollection >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo)
static JsonTypeInfo< TCollection > CreateQueueInfo< TCollection, TElement >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo)
static JsonTypeInfo< TCollection > CreateIDictionaryInfo< TCollection >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo)
static JsonTypeInfo< TCollection > CreateConcurrentQueueInfo< TCollection, TElement >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo)
static JsonTypeInfo< TCollection > CreateQueueInfo< TCollection >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo, Action< TCollection, object?> addFunc)
static JsonTypeInfo< TCollection > CreateDictionaryInfo< TCollection, TKey, TValue >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo)
static JsonConverter< T > GetEnumConverter< T >(JsonSerializerOptions options)
static JsonPropertyInfo CreatePropertyInfo< T >(JsonSerializerOptions options, JsonPropertyInfoValues< T > propertyInfo)
static JsonTypeInfo< TCollection > CreateStackInfo< TCollection, TElement >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo)
static JsonTypeInfo< TElement[]> CreateArrayInfo< TElement >(JsonSerializerOptions options, JsonCollectionInfoValues< TElement[]> collectionInfo)
static JsonTypeInfo< TCollection > CreateStackInfo< TCollection >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo, Action< TCollection, object?> addFunc)
static JsonTypeInfo< TCollection > CreateImmutableEnumerableInfo< TCollection, TElement >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo, Func< IEnumerable< TElement >, TCollection > createRangeFunc)
static JsonTypeInfo< TCollection > CreateISetInfo< TCollection, TElement >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo)
static JsonTypeInfo< T > CreateObjectInfo< T >(JsonSerializerOptions options, JsonObjectInfoValues< T > objectInfo)
static JsonTypeInfo< TCollection > CreateConcurrentStackInfo< TCollection, TElement >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo)
static JsonTypeInfo< TCollection > CreateIListInfo< TCollection, TElement >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo)
static JsonTypeInfo< TCollection > CreateIEnumerableInfo< TCollection, TElement >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo)
static JsonTypeInfo< TCollection > CreateStackOrQueueInfo< TCollection >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo, Action< TCollection, object > addFunc)
static JsonTypeInfo< TCollection > CreateListInfo< TCollection, TElement >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo)
static JsonTypeInfo< TCollection > CreateIDictionaryInfo< TCollection, TKey, TValue >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo)
static JsonTypeInfo< TCollection > CreateImmutableDictionaryInfo< TCollection, TKey, TValue >(JsonSerializerOptions options, JsonCollectionInfoValues< TCollection > collectionInfo, Func< IEnumerable< KeyValuePair< TKey, TValue > >, TCollection > createRangeFunc)
static JsonConverter< DateTimeOffset > s_dateTimeOffsetConverter
static JsonTypeInfo< T > CreateValueInfo< T >(JsonSerializerOptions options, JsonConverter converter)
static JsonConverter< T?> GetNullableConverter< T >(JsonTypeInfo< T > underlyingTypeInfo)