1118 references to JsonTokenType
Aspire.Dashboard (11)
Components\Dialogs\TextVisualizerDialog.razor.cs (11)
213case JsonTokenType.StartObject: 216case JsonTokenType.EndObject: 219case JsonTokenType.StartArray: 222case JsonTokenType.EndArray: 225case JsonTokenType.PropertyName: 228case JsonTokenType.String: 231case JsonTokenType.Number: 241case JsonTokenType.True: 244case JsonTokenType.False: 247case JsonTokenType.Null: 250case JsonTokenType.Comment:
Aspire.Hosting.Azure (1)
Provisioning\Provisioners\AzureProvisioner.cs (1)
514if (reader.TokenType == JsonTokenType.PropertyName)
Microsoft.AspNetCore.Components.Server (2)
src\Components\Shared\src\ElementReferenceJsonConverter.cs (2)
23while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) 25if (reader.TokenType == JsonTokenType.PropertyName)
Microsoft.AspNetCore.Components.WebAssembly (2)
src\Components\Shared\src\ElementReferenceJsonConverter.cs (2)
23while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) 25if (reader.TokenType == JsonTokenType.PropertyName)
Microsoft.AspNetCore.Components.WebView (2)
src\Components\Shared\src\ElementReferenceJsonConverter.cs (2)
23while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) 25if (reader.TokenType == JsonTokenType.PropertyName)
Microsoft.AspNetCore.Grpc.JsonTranscoding (19)
Internal\Json\DurationConverter.cs (1)
20if (reader.TokenType != JsonTokenType.String)
Internal\Json\EnumConverter.cs (3)
23case JsonTokenType.String: 38case JsonTokenType.Number: 40case JsonTokenType.Null:
Internal\Json\FieldMaskConverter.cs (1)
24if (reader.TokenType != JsonTokenType.String)
Internal\Json\Int64Converter.cs (1)
18if (reader.TokenType == JsonTokenType.String)
Internal\Json\NullValueConverter.cs (3)
19case JsonTokenType.String: 28case JsonTokenType.Number: 30case JsonTokenType.Null:
Internal\Json\TimestampConverter.cs (1)
20if (reader.TokenType != JsonTokenType.String)
Internal\Json\UInt64Converter.cs (1)
19if (reader.TokenType == JsonTokenType.String)
Internal\Json\ValueConverter.cs (8)
25case JsonTokenType.StartObject: 32case JsonTokenType.StartArray: 39case JsonTokenType.Comment: 41case JsonTokenType.String: 44case JsonTokenType.Number: 47case JsonTokenType.True: 50case JsonTokenType.False: 53case JsonTokenType.Null:
Microsoft.AspNetCore.Http.Connections.Common (25)
NegotiateProtocol.cs (8)
169case JsonTokenType.PropertyName: 198if (reader.TokenType == JsonTokenType.StartObject) 202else if (reader.TokenType == JsonTokenType.EndArray) 225case JsonTokenType.EndObject: 281case JsonTokenType.PropertyName: 298case JsonTokenType.String: 301case JsonTokenType.EndArray: 314case JsonTokenType.EndObject:
src\SignalR\common\Shared\SystemTextJsonExtensions.cs (17)
23if (reader.TokenType != JsonTokenType.StartObject) 34public static string GetTokenString(JsonTokenType tokenType) 38case JsonTokenType.None: 40case JsonTokenType.StartObject: 42case JsonTokenType.StartArray: 44case JsonTokenType.PropertyName: 54if (reader.TokenType != JsonTokenType.StartArray) 66JsonTokenType.False => false, 67JsonTokenType.True => true, 76if (reader.TokenType != JsonTokenType.String) 78throw new InvalidDataException($"Expected '{propertyName}' to be of type {JsonTokenType.String}."); 88if (reader.TokenType == JsonTokenType.Null) 93if (reader.TokenType != JsonTokenType.Number) 95throw new InvalidDataException($"Expected '{propertyName}' to be of type {JsonTokenType.Number}."); 105if (reader.TokenType == JsonTokenType.Null) 110if (reader.TokenType != JsonTokenType.Number) 112throw new InvalidDataException($"Expected '{propertyName}' to be of type {JsonTokenType.Number}.");
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateGenerator\SharedTypes.cs (1)
990if (reader.TokenType == JsonTokenType.EndObject)
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\SharedTypes.cs (1)
990if (reader.TokenType == JsonTokenType.EndObject)
Microsoft.AspNetCore.JsonPatch.SystemTextJson (6)
Converters\JsonConverterForJsonPatchDocumentOfT.cs (3)
25if (reader.TokenType != JsonTokenType.StartArray) 30if (reader.TokenType == JsonTokenType.Null) 39while (reader.Read() && reader.TokenType is not JsonTokenType.EndArray)
Converters\JsonPatchDocumentConverter.cs (3)
24if (reader.TokenType != JsonTokenType.StartArray) 29if (reader.TokenType == JsonTokenType.Null) 39while (reader.Read() && reader.TokenType is not JsonTokenType.EndArray)
Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests (5)
IntegrationTests\HeterogenousCollectionTests.cs (1)
86if (reader.TokenType != JsonTokenType.StartObject)
TestObjectModels\HeterogenousCollection.cs (4)
72if (reader.TokenType == JsonTokenType.String) 77if (reader.TokenType != JsonTokenType.StartObject) 86if (reader.TokenType == JsonTokenType.EndObject) 91if (reader.TokenType != JsonTokenType.PropertyName)
Microsoft.AspNetCore.OpenApi (23)
Schemas\OpenApiJsonSchema.cs (3)
21if (reader.TokenType != JsonTokenType.StartObject) 30case JsonTokenType.PropertyName: 34case JsonTokenType.EndObject:
Schemas\OpenApiJsonSchema.Helpers.cs (20)
26if (reader.TokenType == JsonTokenType.Null) 31if (reader.TokenType == JsonTokenType.StartArray) 35while (reader.TokenType != JsonTokenType.EndArray) 44if (reader.TokenType == JsonTokenType.Null) 61if (reader.TokenType == JsonTokenType.Null) 66if (reader.TokenType != JsonTokenType.StartObject) 73while (reader.TokenType != JsonTokenType.EndObject) 75if (reader.TokenType != JsonTokenType.PropertyName) 95if (reader.TokenType == JsonTokenType.Null) 100if (reader.TokenType == JsonTokenType.True || reader.TokenType == JsonTokenType.False) 106if (reader.TokenType == JsonTokenType.Number) 133if (reader.TokenType == JsonTokenType.String) 139if (reader.TokenType == JsonTokenType.StartArray) 143while (reader.TokenType != JsonTokenType.EndArray) 151if (reader.TokenType == JsonTokenType.StartObject) 156while (reader.TokenType != JsonTokenType.EndObject) 158if (reader.TokenType != JsonTokenType.PropertyName) 187if (reader.TokenType == JsonTokenType.StartArray) 280if (reader.TokenType == JsonTokenType.False)
Microsoft.AspNetCore.SignalR.Common (21)
Protocol\HandshakeProtocol.cs (4)
133if (reader.TokenType == JsonTokenType.PropertyName) 150else if (reader.TokenType == JsonTokenType.EndObject) 188if (reader.TokenType == JsonTokenType.PropertyName) 203else if (reader.TokenType == JsonTokenType.EndObject)
src\SignalR\common\Shared\SystemTextJsonExtensions.cs (17)
23if (reader.TokenType != JsonTokenType.StartObject) 34public static string GetTokenString(JsonTokenType tokenType) 38case JsonTokenType.None: 40case JsonTokenType.StartObject: 42case JsonTokenType.StartArray: 44case JsonTokenType.PropertyName: 54if (reader.TokenType != JsonTokenType.StartArray) 66JsonTokenType.False => false, 67JsonTokenType.True => true, 76if (reader.TokenType != JsonTokenType.String) 78throw new InvalidDataException($"Expected '{propertyName}' to be of type {JsonTokenType.String}."); 88if (reader.TokenType == JsonTokenType.Null) 93if (reader.TokenType != JsonTokenType.Number) 95throw new InvalidDataException($"Expected '{propertyName}' to be of type {JsonTokenType.Number}."); 105if (reader.TokenType == JsonTokenType.Null) 110if (reader.TokenType != JsonTokenType.Number) 112throw new InvalidDataException($"Expected '{propertyName}' to be of type {JsonTokenType.Number}.");
Microsoft.AspNetCore.SignalR.Protocols.Json (36)
Protocol\JsonHubProtocol.cs (19)
157case JsonTokenType.PropertyName: 164throw new InvalidDataException($"Expected '{TypePropertyName}' to be of type {JsonTokenType.Number}."); 175if (reader.TokenType != JsonTokenType.StartArray) 178$"Expected '{StreamIdsPropertyName}' to be of type {SystemTextJsonExtensions.GetTokenString(JsonTokenType.StartArray)}."); 183while (reader.TokenType != JsonTokenType.EndArray) 197if (reader.TokenType != JsonTokenType.String) 199throw new InvalidDataException($"Expected '{TargetPropertyName}' to be of type {JsonTokenType.String}."); 291if (reader.TokenType != JsonTokenType.StartArray) 293throw new InvalidDataException($"Expected '{ArgumentsPropertyName}' to be of type {SystemTextJsonExtensions.GetTokenString(JsonTokenType.StartArray)}."); 318while (reader.CurrentDepth == initialDepth && reader.TokenType == JsonTokenType.StartArray || 341case JsonTokenType.EndObject: 485if (reader.TokenType != JsonTokenType.StartObject) 487throw new InvalidDataException($"Expected '{HeadersPropertyName}' to be of type {JsonTokenType.StartObject}."); 494case JsonTokenType.PropertyName: 499if (reader.TokenType != JsonTokenType.String) 501throw new InvalidDataException($"Expected header '{propertyName}' to be of type {JsonTokenType.String}."); 506case JsonTokenType.Comment: 508case JsonTokenType.EndObject: 841while (reader.TokenType != JsonTokenType.EndArray && reader.CurrentDepth > depth)
src\SignalR\common\Shared\SystemTextJsonExtensions.cs (17)
23if (reader.TokenType != JsonTokenType.StartObject) 34public static string GetTokenString(JsonTokenType tokenType) 38case JsonTokenType.None: 40case JsonTokenType.StartObject: 42case JsonTokenType.StartArray: 44case JsonTokenType.PropertyName: 54if (reader.TokenType != JsonTokenType.StartArray) 66JsonTokenType.False => false, 67JsonTokenType.True => true, 76if (reader.TokenType != JsonTokenType.String) 78throw new InvalidDataException($"Expected '{propertyName}' to be of type {JsonTokenType.String}."); 88if (reader.TokenType == JsonTokenType.Null) 93if (reader.TokenType != JsonTokenType.Number) 95throw new InvalidDataException($"Expected '{propertyName}' to be of type {JsonTokenType.Number}."); 105if (reader.TokenType == JsonTokenType.Null) 110if (reader.TokenType != JsonTokenType.Number) 112throw new InvalidDataException($"Expected '{propertyName}' to be of type {JsonTokenType.Number}.");
Microsoft.AspNetCore.SignalR.StackExchangeRedis (17)
src\SignalR\common\Shared\SystemTextJsonExtensions.cs (17)
23if (reader.TokenType != JsonTokenType.StartObject) 34public static string GetTokenString(JsonTokenType tokenType) 38case JsonTokenType.None: 40case JsonTokenType.StartObject: 42case JsonTokenType.StartArray: 44case JsonTokenType.PropertyName: 54if (reader.TokenType != JsonTokenType.StartArray) 66JsonTokenType.False => false, 67JsonTokenType.True => true, 76if (reader.TokenType != JsonTokenType.String) 78throw new InvalidDataException($"Expected '{propertyName}' to be of type {JsonTokenType.String}."); 88if (reader.TokenType == JsonTokenType.Null) 93if (reader.TokenType != JsonTokenType.Number) 95throw new InvalidDataException($"Expected '{propertyName}' to be of type {JsonTokenType.Number}."); 105if (reader.TokenType == JsonTokenType.Null) 110if (reader.TokenType != JsonTokenType.Number) 112throw new InvalidDataException($"Expected '{propertyName}' to be of type {JsonTokenType.Number}.");
Microsoft.CodeAnalysis.LanguageServer.Protocol (50)
Protocol\Converters\FormattingOptionsConverter.cs (9)
23Debug.Assert(reader.TokenType == JsonTokenType.StartObject); 34while (reader.TokenType == JsonTokenType.Comment); 54if (reader.TokenType == JsonTokenType.EndObject) 67if (reader.TokenType == JsonTokenType.Comment) 72if (reader.TokenType != JsonTokenType.PropertyName) 104JsonTokenType.Number => reader.GetInt32(), 105JsonTokenType.String => reader.GetString(), 106JsonTokenType.True => reader.GetBoolean(), 107JsonTokenType.False => reader.GetBoolean(),
Protocol\Converters\NaturalObjectConverter.cs (8)
36case JsonTokenType.Null: 39case JsonTokenType.False or JsonTokenType.True: 42case JsonTokenType.Number: 54case JsonTokenType.String: 57case JsonTokenType.StartArray: 59while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) 66case JsonTokenType.StartObject:
Protocol\Converters\StringEnumConverter.cs (2)
40if (reader.TokenType == JsonTokenType.String) 44else if (reader.TokenType == JsonTokenType.Null)
Protocol\Converters\SumConverter.cs (12)
102public IReadOnlyList<UnionTypeInfo> GetApplicableInfos(JsonTokenType startingTokenType) 106JsonTokenType.StartArray 108JsonTokenType.Number or 109JsonTokenType.String or 110JsonTokenType.True or 111JsonTokenType.False 113JsonTokenType.StartObject 189if (reader.TokenType == JsonTokenType.Null) 287case JsonTokenType.True: 288case JsonTokenType.False: 291case JsonTokenType.Number: 303case JsonTokenType.String:
Protocol\Converters\TextDocumentSyncConverter.cs (3)
16if (reader.TokenType == JsonTokenType.Number) 31else if (reader.TokenType == JsonTokenType.String) 36else if (reader.TokenType == JsonTokenType.StartObject)
Protocol\Internal\Converters\ClassifiedTextElementConverter.cs (3)
22if (reader.TokenType == JsonTokenType.EndObject) 27if (reader.TokenType == JsonTokenType.PropertyName) 36if (reader.TokenType == JsonTokenType.EndArray)
Protocol\Internal\Converters\ClassifiedTextRunConverter.cs (1)
17if (reader.TokenType == JsonTokenType.StartObject)
Protocol\Internal\Converters\ContainerElementConverter.cs (4)
21if (reader.TokenType == JsonTokenType.StartObject) 28if (reader.TokenType == JsonTokenType.EndObject) 33if (reader.TokenType == JsonTokenType.PropertyName) 42if (reader.TokenType == JsonTokenType.EndArray)
Protocol\Internal\Converters\ImageElementConverter.cs (3)
18if (reader.TokenType == JsonTokenType.StartObject) 25if (reader.TokenType == JsonTokenType.EndObject) 31if (reader.TokenType == JsonTokenType.PropertyName)
Protocol\Internal\Converters\ImageIdConverter.cs (1)
17if (reader.TokenType == JsonTokenType.StartObject)
Protocol\Internal\Converters\ObjectContentConverter.cs (4)
40if (reader.TokenType == JsonTokenType.Null) 45else if (reader.TokenType == JsonTokenType.StartObject) 68else if (reader.TokenType == JsonTokenType.String) 72else if (reader.TokenType == JsonTokenType.Number)
Microsoft.Extensions.AI.Evaluation.Reporting (10)
JsonSerialization\EvaluationContextConverter.cs (10)
25if (reader.TokenType is not JsonTokenType.StartObject) 35if (reader.TokenType is JsonTokenType.EndObject || (name is not null && contents is not null)) 40if (reader.TokenType is JsonTokenType.PropertyName) 46$"Failed to read past the '{JsonTokenType.PropertyName}' token for property with name '{propertyName}'."); 52if (reader.TokenType is not JsonTokenType.String) 55$"Expected '{JsonTokenType.String}' but found '{reader.TokenType}' after '{JsonTokenType.PropertyName}' token for property with name '{propertyName}'."); 62if (reader.TokenType is not JsonTokenType.StartArray) 65$"Expected '{JsonTokenType.StartArray}' but found '{reader.TokenType}' after '{JsonTokenType.PropertyName}' token for property with name '{propertyName}'.");
Microsoft.Extensions.DependencyModel (15)
Utf8JsonReaderExtensions.cs (15)
16=> reader.TokenType == JsonTokenType.PropertyName; 28if (reader.TokenType == JsonTokenType.String) 52if (reader.TokenType != JsonTokenType.StartObject) 60if (reader.TokenType != JsonTokenType.EndObject) 69if (reader.TokenType != JsonTokenType.StartArray) 76while (reader.Read() && reader.TokenType == JsonTokenType.String) 81if (reader.TokenType != JsonTokenType.EndArray) 93if (reader.TokenType == JsonTokenType.Null) 97if (reader.TokenType != JsonTokenType.String) 109if (reader.TokenType == JsonTokenType.Null) 113if (reader.TokenType != JsonTokenType.True && reader.TokenType != JsonTokenType.False) 124if (reader.TokenType == JsonTokenType.Null) 128if (reader.TokenType != JsonTokenType.True && reader.TokenType != JsonTokenType.False)
Microsoft.JSInterop (18)
Implementation\JSObjectReferenceJsonWorker.cs (2)
27while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) 29if (reader.TokenType == JsonTokenType.PropertyName)
Infrastructure\ByteArrayJsonConverter.cs (5)
26if (reader.TokenType == JsonTokenType.String && reader.TryGetBytesFromBase64(out var bytes)) 38if (reader.TokenType != JsonTokenType.StartObject) 43if (reader.Read() && reader.TokenType == JsonTokenType.PropertyName) 49else if (!reader.Read() || reader.TokenType != JsonTokenType.Number) 63if (reader.Read() && reader.TokenType != JsonTokenType.EndObject)
Infrastructure\DotNetDispatcher.cs (7)
230if (!reader.Read() || reader.TokenType != JsonTokenType.StartArray) 238while (index < parameterTypes.Length && reader.Read() && reader.TokenType != JsonTokenType.EndArray) 241if (reader.TokenType == JsonTokenType.StartObject && IsIncorrectDotNetObjectRefUse(parameterType, reader)) 256if (!reader.Read() || reader.TokenType != JsonTokenType.EndArray) 271jsonReader.TokenType == JsonTokenType.PropertyName && 317if (!reader.Read() || reader.TokenType != JsonTokenType.StartArray) 334if (!reader.Read() || reader.TokenType != JsonTokenType.EndArray)
Infrastructure\DotNetObjectReferenceJsonConverter.cs (2)
26while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) 28if (reader.TokenType == JsonTokenType.PropertyName)
Infrastructure\JSStreamReferenceJsonConverter.cs (2)
29while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) 31if (reader.TokenType == JsonTokenType.PropertyName)
Microsoft.ML.SearchSpace (8)
Converter\ParameterConverter.cs (8)
19case JsonTokenType.StartObject: 22case JsonTokenType.String: 24case JsonTokenType.Number: 35case JsonTokenType.True: 37case JsonTokenType.False: 39case JsonTokenType.Null: 41case JsonTokenType.StartArray: 43while (reader.Read() && reader.TokenType != JsonTokenType.EndArray)
Microsoft.ML.SearchSpace.Tests (22)
ParameterTest.cs (9)
76parameter = Parameter.FromEnum(JsonTokenType.None); 77parameter.AsType<JsonTokenType>().Should().Be(JsonTokenType.None); 96parameter["JTokenType"].AsType<JsonTokenType>().Should().Be(JsonTokenType.Null); 118parameter["JTokenType"].AsType<JsonTokenType>().Should().Be(JsonTokenType.Null); 171public JsonTokenType JTokenType { get; set; } = JsonTokenType.Null;
SearchSpaceTest.cs (13)
111param.BasicSS.JTokenType.Should().Be(JsonTokenType.None); 125param.BasicSS.JTokenType.Should().Be(JsonTokenType.StartArray); 158parameter.JTokenType.Should().Be(JsonTokenType.None); 176param.BasicSS.JTokenType.Should().Be(JsonTokenType.Null); 188JTokenType = JsonTokenType.Null, 200param.JTokenType.Should().Be(JsonTokenType.Null); 322public JsonTokenType JTokenType { get; set; } 347[Choice(new object[] { JsonTokenType.None, JsonTokenType.EndObject, JsonTokenType.StartArray, JsonTokenType.Null }, defaultValue: JsonTokenType.Null)] 348public JsonTokenType JTokenType { get; set; }
Microsoft.ML.Tokenizers (2)
Utils\StringSpanOrdinalKey.cs (2)
153if (reader.TokenType == JsonTokenType.EndObject) 158if (reader.TokenType == JsonTokenType.PropertyName)
Roslyn.VisualStudio.Next.UnitTests (4)
UnifiedSettings\TestModel\ResourceStringArrayConverter.cs (3)
16if (reader.TokenType != JsonTokenType.StartArray) 22if (reader.TokenType == JsonTokenType.EndArray) 25if (reader.TokenType == JsonTokenType.String)
UnifiedSettings\TestModel\ResourceStringConverter.cs (1)
14if (reader.TokenType == JsonTokenType.String)
System.Text.Json (815)
src\libraries\System.Text.Json\Common\JsonNumberHandling.cs (4)
16/// Numbers will only be read from <see cref="JsonTokenType.Number"/> tokens and will only be written as JSON numbers (without quotes). 21/// Numbers can be read from <see cref="JsonTokenType.String"/> tokens. 22/// Does not prevent numbers from being read from <see cref="JsonTokenType.Number"/> token. 37/// The "NaN", "Infinity", and "-Infinity" <see cref="JsonTokenType.String"/> tokens can be read as
System\Text\Json\Document\JsonDocument.cs (63)
111internal JsonTokenType GetJsonTokenType(int index) 124Debug.Assert(!isPropertyName || row.TokenType is JsonTokenType.PropertyName); 135CheckExpectedType(JsonTokenType.StartArray, row.TokenType); 146CheckExpectedType(JsonTokenType.StartObject, row.TokenType); 157CheckExpectedType(JsonTokenType.StartArray, row.TokenType); 233if (includeQuotes && row.TokenType == JsonTokenType.String) 255Debug.Assert(row.TokenType == JsonTokenType.PropertyName); 268if (row.TokenType == JsonTokenType.String) 282internal string? GetString(int index, JsonTokenType expectedType) 288JsonTokenType tokenType = row.TokenType; 290if (tokenType == JsonTokenType.Null) 347isPropertyName ? JsonTokenType.PropertyName : JsonTokenType.String, 382return GetString(index - DbRow.Size, JsonTokenType.PropertyName)!; 390Debug.Assert(row.TokenType is JsonTokenType.PropertyName); 401CheckExpectedType(JsonTokenType.String, row.TokenType); 422CheckExpectedType(JsonTokenType.Number, row.TokenType); 444CheckExpectedType(JsonTokenType.Number, row.TokenType); 466CheckExpectedType(JsonTokenType.Number, row.TokenType); 488CheckExpectedType(JsonTokenType.Number, row.TokenType); 510CheckExpectedType(JsonTokenType.Number, row.TokenType); 532CheckExpectedType(JsonTokenType.Number, row.TokenType); 554CheckExpectedType(JsonTokenType.Number, row.TokenType); 576CheckExpectedType(JsonTokenType.Number, row.TokenType); 598CheckExpectedType(JsonTokenType.Number, row.TokenType); 620CheckExpectedType(JsonTokenType.Number, row.TokenType); 642CheckExpectedType(JsonTokenType.Number, row.TokenType); 664CheckExpectedType(JsonTokenType.String, row.TokenType); 699CheckExpectedType(JsonTokenType.String, row.TokenType); 734CheckExpectedType(JsonTokenType.String, row.TokenType); 803case JsonTokenType.StartObject: 807case JsonTokenType.StartArray: 811case JsonTokenType.String: 814case JsonTokenType.Number: 817case JsonTokenType.True: 820case JsonTokenType.False: 823case JsonTokenType.Null: 842case JsonTokenType.String: 845case JsonTokenType.Number: 848case JsonTokenType.True: 851case JsonTokenType.False: 854case JsonTokenType.Null: 857case JsonTokenType.StartObject: 860case JsonTokenType.EndObject: 863case JsonTokenType.StartArray: 866case JsonTokenType.EndArray: 869case JsonTokenType.PropertyName: 880Debug.Assert(row.TokenType == JsonTokenType.String || row.TokenType == JsonTokenType.PropertyName); 911Debug.Assert(row.TokenType == JsonTokenType.PropertyName); 961JsonTokenType tokenType = reader.TokenType; 968if (tokenType == JsonTokenType.StartObject) 982else if (tokenType == JsonTokenType.EndObject) 984int rowIndex = database.FindIndexOfFirstUnsetSizeOrLength(JsonTokenType.StartObject); 999else if (tokenType == JsonTokenType.StartArray) 1013else if (tokenType == JsonTokenType.EndArray) 1015int rowIndex = database.FindIndexOfFirstUnsetSizeOrLength(JsonTokenType.StartArray); 1045else if (tokenType == JsonTokenType.PropertyName) 1065Debug.Assert(tokenType >= JsonTokenType.String && tokenType <= JsonTokenType.Null); 1074if (tokenType == JsonTokenType.String) 1107private static void CheckExpectedType(JsonTokenType expected, JsonTokenType actual)
System\Text\Json\Document\JsonDocument.DbRow.cs (6)
51internal JsonTokenType TokenType => (JsonTokenType)(unchecked((uint)_numberOfRowsAndTypeUnion) >> 28); 55internal DbRow(JsonTokenType jsonTokenType, int location, int sizeOrLength) 57Debug.Assert(jsonTokenType > JsonTokenType.None && jsonTokenType <= JsonTokenType.Null); 68internal bool IsSimpleValue => TokenType >= JsonTokenType.PropertyName;
System\Text\Json\Document\JsonDocument.MetadataDb.cs (14)
216internal void Append(JsonTokenType tokenType, int startLocation, int length) 220(tokenType == JsonTokenType.StartArray || tokenType == JsonTokenType.StartObject) == 307internal int FindIndexOfFirstUnsetSizeOrLength(JsonTokenType lookupType) 309Debug.Assert(lookupType == JsonTokenType.StartObject || lookupType == JsonTokenType.StartArray); 313private int FindOpenElement(JsonTokenType lookupType) 338internal JsonTokenType GetJsonTokenType(int index) 343return (JsonTokenType)(union >> 28); 359if (start.TokenType == JsonTokenType.StartObject) 362end.TokenType == JsonTokenType.EndObject, 365else if (start.TokenType == JsonTokenType.StartArray) 368end.TokenType == JsonTokenType.EndArray, 388if (start.TokenType == JsonTokenType.String)
System\Text\Json\Document\JsonDocument.Parse.cs (26)
344/// is <see cref="JsonTokenType.PropertyName"/> or <see cref="JsonTokenType.None"/>, the 384/// is <see cref="JsonTokenType.PropertyName"/> or <see cref="JsonTokenType.None"/>, the 440case JsonTokenType.None: 443case JsonTokenType.PropertyName: 466case JsonTokenType.StartObject: 467case JsonTokenType.StartArray: 500reader.TokenType == JsonTokenType.EndObject || 501reader.TokenType == JsonTokenType.EndArray); 506case JsonTokenType.False: 507case JsonTokenType.True: 508case JsonTokenType.Null: 526case JsonTokenType.Number: 541case JsonTokenType.String: 663private static JsonDocument CreateForLiteral(JsonTokenType tokenType) 667case JsonTokenType.False: 670case JsonTokenType.True: 674Debug.Assert(tokenType == JsonTokenType.Null); 717JsonTokenType tokenType = JsonTokenType.None) 721tokenType != JsonTokenType.Null && 722tokenType != JsonTokenType.False && 723tokenType != JsonTokenType.True); 728if (tokenType == JsonTokenType.String || tokenType == JsonTokenType.Number)
System\Text\Json\Document\JsonDocument.TryGetProperty.cs (6)
17CheckExpectedType(JsonTokenType.StartObject, row.TokenType); 59Debug.Assert(row.TokenType != JsonTokenType.PropertyName); 73Debug.Assert(row.TokenType == JsonTokenType.PropertyName); 117CheckExpectedType(JsonTokenType.StartObject, row.TokenType); 150Debug.Assert(row.TokenType != JsonTokenType.PropertyName); 164Debug.Assert(row.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Document\JsonElement.ArrayEnumerator.cs (1)
27Debug.Assert(target.TokenType == JsonTokenType.StartArray);
System\Text\Json\Document\JsonElement.cs (28)
34private JsonTokenType TokenType 38return _parent?.GetJsonTokenType(_idx) ?? JsonTokenType.None; 349JsonTokenType type = TokenType; 352type == JsonTokenType.True ? true : 353type == JsonTokenType.False ? false : 356static bool ThrowJsonElementWrongTypeException(JsonTokenType actualType) 380return _parent.GetString(_idx, JsonTokenType.String); 1442if (TokenType == JsonTokenType.Null) 1470if (TokenType == JsonTokenType.Null) 1500if (TokenType == JsonTokenType.Null) 1577JsonTokenType tokenType = TokenType; 1579if (tokenType != JsonTokenType.StartArray) 1581ThrowHelper.ThrowJsonElementWrongTypeException(JsonTokenType.StartArray, tokenType); 1603JsonTokenType tokenType = TokenType; 1605if (tokenType != JsonTokenType.StartObject) 1607ThrowHelper.ThrowJsonElementWrongTypeException(JsonTokenType.StartObject, tokenType); 1651case JsonTokenType.None: 1652case JsonTokenType.Null: 1654case JsonTokenType.True: 1656case JsonTokenType.False: 1658case JsonTokenType.Number: 1659case JsonTokenType.StartArray: 1660case JsonTokenType.StartObject: 1666case JsonTokenType.String: 1668case JsonTokenType.Comment: 1669case JsonTokenType.EndArray: 1670case JsonTokenType.EndObject: 1672Debug.Fail($"No handler for {nameof(JsonTokenType)}.{TokenType}");
System\Text\Json\Document\JsonElement.ObjectEnumerator.cs (1)
27Debug.Assert(target.TokenType == JsonTokenType.StartObject);
System\Text\Json\Document\JsonElement.Parse.cs (4)
22/// is <see cref="JsonTokenType.PropertyName"/> or <see cref="JsonTokenType.None"/>, the 87/// is <see cref="JsonTokenType.PropertyName"/> or <see cref="JsonTokenType.None"/>, the
System\Text\Json\Document\JsonProperty.cs (3)
40/// This value's <see cref="Type"/> is not <see cref="JsonTokenType.PropertyName"/>. 60/// This value's <see cref="Type"/> is not <see cref="JsonTokenType.PropertyName"/>. 80/// This value's <see cref="Type"/> is not <see cref="JsonTokenType.PropertyName"/>.
System\Text\Json\JsonHelpers.cs (8)
23Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName); 86JsonTokenType tokenType = reader.TokenType; 87if (tokenType is JsonTokenType.StartObject or JsonTokenType.StartArray) 156public static bool IsInRangeInclusive(JsonTokenType value, JsonTokenType lowerBound, JsonTokenType upperBound)
System\Text\Json\Nodes\JsonNode.Parse.cs (2)
25/// is <see cref="JsonTokenType.PropertyName"/> or <see cref="JsonTokenType.None"/>, the
System\Text\Json\Reader\JsonReaderHelper.cs (13)
49internal static JsonValueKind ToValueKind(this JsonTokenType tokenType) 53case JsonTokenType.None: 55case JsonTokenType.StartArray: 57case JsonTokenType.StartObject: 59case JsonTokenType.String: 60case JsonTokenType.Number: 61case JsonTokenType.True: 62case JsonTokenType.False: 63case JsonTokenType.Null: 75public static bool IsTokenTypePrimitive(JsonTokenType tokenType) => 76(tokenType - JsonTokenType.String) <= (JsonTokenType.Null - JsonTokenType.String);
System\Text\Json\Reader\JsonReaderState.cs (4)
22internal readonly JsonTokenType _tokenType; 23internal readonly JsonTokenType _previousTokenType; 63JsonTokenType tokenType, 64JsonTokenType previousTokenType,
System\Text\Json\Reader\Utf8JsonReader.cs (106)
35private JsonTokenType _tokenType; 36private JsonTokenType _previousTokenType; 110if (TokenType is JsonTokenType.StartArray or JsonTokenType.StartObject) 124public readonly JsonTokenType TokenType => _tokenType; 284if (_isFinalBlock && TokenType is JsonTokenType.None && !_readerOptions.AllowMultipleValues) 303/// When <see cref="TokenType"/> is <see cref="JsonTokenType.PropertyName" />, the reader first moves to the property value. 304/// When <see cref="TokenType"/> (originally, or after advancing) is <see cref="JsonTokenType.StartObject" /> or 305/// <see cref="JsonTokenType.StartArray" />, the reader advances to the matching 306/// <see cref="JsonTokenType.EndObject" /> or <see cref="JsonTokenType.EndArray" />. 326if (TokenType is JsonTokenType.PropertyName) 334if (TokenType is JsonTokenType.StartObject or JsonTokenType.StartArray) 362/// When <see cref="TokenType"/> is <see cref="JsonTokenType.PropertyName" />, the reader first moves to the property value. 363/// When <see cref="TokenType"/> (originally, or after advancing) is <see cref="JsonTokenType.StartObject" /> or 364/// <see cref="JsonTokenType.StartArray" />, the reader advances to the matching 365/// <see cref="JsonTokenType.EndObject" /> or <see cref="JsonTokenType.EndArray" />. 403if (TokenType is JsonTokenType.PropertyName) 412if (TokenType is not (JsonTokenType.StartObject or JsonTokenType.StartArray)) 440/// (i.e. other than <see cref="JsonTokenType.String"/> or <see cref="JsonTokenType.PropertyName"/>). 470/// (i.e. other than <see cref="JsonTokenType.String"/> or <see cref="JsonTokenType.PropertyName"/>). 511/// (i.e. other than <see cref="JsonTokenType.String"/> or <see cref="JsonTokenType.PropertyName"/>). 690private static bool IsTokenTypeString(JsonTokenType tokenType) 692return tokenType == JsonTokenType.PropertyName || tokenType == JsonTokenType.String; 749_tokenType = JsonTokenType.StartObject; 767_tokenType = JsonTokenType.EndObject; 783_tokenType = JsonTokenType.StartArray; 801_tokenType = JsonTokenType.EndArray; 844if (_tokenType == JsonTokenType.None) 855if (_tokenType == JsonTokenType.StartObject) 876_tokenType = JsonTokenType.StartObject; 883else if (_tokenType == JsonTokenType.StartArray) 895else if (_tokenType == JsonTokenType.PropertyName) 928if (_readerOptions.CommentHandling == JsonCommentHandling.Allow && _tokenType == JsonTokenType.Comment) 933if (_tokenType is not JsonTokenType.EndArray and not JsonTokenType.EndObject) 965_tokenType = JsonTokenType.StartObject; 975_tokenType = JsonTokenType.StartArray; 992_tokenType = JsonTokenType.Number; 1001_isNotPrimitive = _tokenType is JsonTokenType.StartObject or JsonTokenType.StartArray; 1066return ConsumeLiteral(JsonConstants.FalseValue, JsonTokenType.False); 1070return ConsumeLiteral(JsonConstants.TrueValue, JsonTokenType.True); 1074return ConsumeLiteral(JsonConstants.NullValue, JsonTokenType.Null); 1096if (_isNotPrimitive && IsLastSpan && _tokenType != JsonTokenType.EndArray && _tokenType != JsonTokenType.EndObject) 1133private bool ConsumeLiteral(ReadOnlySpan<byte> literal, JsonTokenType tokenType) 1212_tokenType = JsonTokenType.Number; 1275_tokenType = JsonTokenType.PropertyName; 1301_tokenType = JsonTokenType.String; 1400_tokenType = JsonTokenType.String; 1701JsonTokenType prevTokenType = _tokenType; 1733if (_tokenType == JsonTokenType.Comment) 1841Debug.Assert(_tokenType == JsonTokenType.Comment); 1845_tokenType = _inObject ? JsonTokenType.StartObject : JsonTokenType.StartArray; 1852Debug.Assert(_tokenType != JsonTokenType.Comment); 1872if (_bitStack.CurrentDepth == 0 && _tokenType != JsonTokenType.None) 1889if (_previousTokenType <= JsonTokenType.StartObject || _previousTokenType == JsonTokenType.StartArray || _trailingCommaBeforeComment) 1991else if (_tokenType == JsonTokenType.None) 2002else if (_tokenType == JsonTokenType.StartObject) 2017_tokenType = JsonTokenType.StartObject; 2024else if (_tokenType == JsonTokenType.StartArray) 2033else if (_tokenType == JsonTokenType.PropertyName) 2043Debug.Assert(_tokenType is JsonTokenType.EndArray or JsonTokenType.EndObject); 2164if (_tokenType == JsonTokenType.StartObject) 2184_tokenType = JsonTokenType.StartObject; 2192else if (_tokenType == JsonTokenType.StartArray) 2207else if (_tokenType == JsonTokenType.PropertyName) 2530if (_tokenType != JsonTokenType.Comment) 2534_tokenType = JsonTokenType.Comment; 2548if (_tokenType != JsonTokenType.Comment) 2552_tokenType = JsonTokenType.Comment; 2565JsonTokenType.Comment => nameof(JsonTokenType.Comment), 2566JsonTokenType.EndArray => nameof(JsonTokenType.EndArray), 2567JsonTokenType.EndObject => nameof(JsonTokenType.EndObject), 2568JsonTokenType.False => nameof(JsonTokenType.False), 2569JsonTokenType.None => nameof(JsonTokenType.None), 2570JsonTokenType.Null => nameof(JsonTokenType.Null), 2571JsonTokenType.Number => nameof(JsonTokenType.Number), 2572JsonTokenType.PropertyName => nameof(JsonTokenType.PropertyName), 2573JsonTokenType.StartArray => nameof(JsonTokenType.StartArray), 2574JsonTokenType.StartObject => nameof(JsonTokenType.StartObject), 2575JsonTokenType.String => nameof(JsonTokenType.String), 2576JsonTokenType.True => nameof(JsonTokenType.True),
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (48)
151if (_tokenType == JsonTokenType.None) 162if (_tokenType == JsonTokenType.StartObject) 185_tokenType = JsonTokenType.StartObject; 194else if (_tokenType == JsonTokenType.StartArray) 206else if (_tokenType == JsonTokenType.PropertyName) 236if (_readerOptions.CommentHandling == JsonCommentHandling.Allow && _tokenType == JsonTokenType.Comment) 241if (_tokenType != JsonTokenType.EndArray && _tokenType != JsonTokenType.EndObject) 340_tokenType = JsonTokenType.StartObject; 350_tokenType = JsonTokenType.StartArray; 364_tokenType = JsonTokenType.Number; 372_isNotPrimitive = _tokenType is JsonTokenType.StartObject or JsonTokenType.StartArray; 426return ConsumeLiteralMultiSegment(JsonConstants.FalseValue, JsonTokenType.False); 430return ConsumeLiteralMultiSegment(JsonConstants.TrueValue, JsonTokenType.True); 434return ConsumeLiteralMultiSegment(JsonConstants.NullValue, JsonTokenType.Null); 463if (_isNotPrimitive && IsLastSpan && _tokenType != JsonTokenType.EndArray && _tokenType != JsonTokenType.EndObject) 469if (_isNotPrimitive && IsLastSpan && _tokenType != JsonTokenType.EndArray && _tokenType != JsonTokenType.EndObject) 510private bool ConsumeLiteralMultiSegment(ReadOnlySpan<byte> literal, JsonTokenType tokenType) 678_tokenType = JsonTokenType.Number; 740_tokenType = JsonTokenType.PropertyName; 767_tokenType = JsonTokenType.String; 946_tokenType = JsonTokenType.String; 1097_tokenType = JsonTokenType.String; 1530JsonTokenType prevTokenType = _tokenType; 1565if (_tokenType == JsonTokenType.Comment) 1682Debug.Assert(_tokenType == JsonTokenType.Comment); 1686_tokenType = _inObject ? JsonTokenType.StartObject : JsonTokenType.StartArray; 1693Debug.Assert(_tokenType != JsonTokenType.Comment); 1713if (_bitStack.CurrentDepth == 0 && _tokenType != JsonTokenType.None) 1730if (_previousTokenType <= JsonTokenType.StartObject || _previousTokenType == JsonTokenType.StartArray || _trailingCommaBeforeComment) 1841else if (_tokenType == JsonTokenType.None) 1852else if (_tokenType == JsonTokenType.StartObject) 1868_tokenType = JsonTokenType.StartObject; 1876else if (_tokenType == JsonTokenType.StartArray) 1885else if (_tokenType == JsonTokenType.PropertyName) 1895Debug.Assert(_tokenType == JsonTokenType.EndArray || _tokenType == JsonTokenType.EndObject); 2016if (_tokenType == JsonTokenType.StartObject) 2038_tokenType = JsonTokenType.StartObject; 2048else if (_tokenType == JsonTokenType.StartArray) 2063else if (_tokenType == JsonTokenType.PropertyName) 2207if (_tokenType != JsonTokenType.Comment) 2212_tokenType = JsonTokenType.Comment;
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (78)
18/// Returns <see langword="null" /> when <see cref="TokenType"/> is <see cref="JsonTokenType.Null"/>. 22/// (i.e. other than <see cref="JsonTokenType.String"/>, <see cref="JsonTokenType.PropertyName"/> or 23/// <see cref="JsonTokenType.Null"/>). 29if (TokenType == JsonTokenType.Null) 34if (TokenType != JsonTokenType.String && TokenType != JsonTokenType.PropertyName) 56/// Unlike <see cref="GetString"/>, this method does not support <see cref="JsonTokenType.Null"/>. 64/// (i.e. other than <see cref="JsonTokenType.String"/> or <see cref="JsonTokenType.PropertyName"/>. 71if (_tokenType is not (JsonTokenType.String or JsonTokenType.PropertyName)) 81Debug.Assert(_tokenType is JsonTokenType.String or JsonTokenType.PropertyName or JsonTokenType.Number); 82Debug.Assert(_tokenType != JsonTokenType.Number || !ValueIsEscaped, "Numbers can't contain escape characters."); 120/// Unlike <see cref="GetString"/>, this method does not support <see cref="JsonTokenType.Null"/>. 128/// (i.e. other than <see cref="JsonTokenType.String"/> or <see cref="JsonTokenType.PropertyName"/>. 135if (_tokenType is not (JsonTokenType.String or JsonTokenType.PropertyName)) 145Debug.Assert(_tokenType is JsonTokenType.String or JsonTokenType.PropertyName or JsonTokenType.Number); 146Debug.Assert(_tokenType != JsonTokenType.Number || !ValueIsEscaped, "Numbers can't contain escape characters."); 197Debug.Assert(_tokenType is JsonTokenType.String or JsonTokenType.PropertyName); 241if (TokenType != JsonTokenType.Comment) 254/// Thrown if trying to get the value of a JSON token that is not a boolean (i.e. <see cref="JsonTokenType.True"/> or <see cref="JsonTokenType.False"/>). 259JsonTokenType type = TokenType; 260if (type == JsonTokenType.True) 265else if (type != JsonTokenType.False) 279/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.String"/>. 302/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 336/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 371/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 405/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 439/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 473/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 508/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 543/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 578/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 635/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 692/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 725/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.String"/>. 758/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.String"/>. 791/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.String"/>. 824/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.String"/>. 829if (TokenType != JsonTokenType.String) 852/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 857if (TokenType != JsonTokenType.Number) 887/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 893if (TokenType != JsonTokenType.Number) 923/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 928if (TokenType != JsonTokenType.Number) 958/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 963if (TokenType != JsonTokenType.Number) 993/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 998if (TokenType != JsonTokenType.Number) 1028/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 1034if (TokenType != JsonTokenType.Number) 1064/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 1070if (TokenType != JsonTokenType.Number) 1100/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 1106if (TokenType != JsonTokenType.Number) 1136/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 1141if (TokenType != JsonTokenType.Number) 1166/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 1171if (TokenType != JsonTokenType.Number) 1196/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.Number"/>. 1201if (TokenType != JsonTokenType.Number) 1231/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.String"/>. 1236if (TokenType != JsonTokenType.String) 1296/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.String"/>. 1301if (TokenType != JsonTokenType.String) 1362/// Thrown if trying to get the value of a JSON token that is not a <see cref="JsonTokenType.String"/>. 1367if (TokenType != JsonTokenType.String)
System\Text\Json\Serialization\Converters\Collection\JsonCollectionConverter.cs (9)
75if (reader.TokenType != JsonTokenType.StartArray) 92if (reader.TokenType == JsonTokenType.EndArray) 108if (reader.TokenType == JsonTokenType.EndArray) 124if (reader.TokenType == JsonTokenType.StartArray) 130if (reader.TokenType != JsonTokenType.StartObject) 217if (reader.TokenType == JsonTokenType.EndArray) 264if (reader.TokenType != JsonTokenType.EndObject) 266Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 272Debug.Assert(reader.TokenType is JsonTokenType.EndObject);
System\Text\Json\Serialization\Converters\Collection\JsonDictionaryConverter.cs (8)
87if (reader.TokenType != JsonTokenType.StartObject) 107if (reader.TokenType == JsonTokenType.EndObject) 113Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 133if (reader.TokenType == JsonTokenType.EndObject) 139Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 157if (reader.TokenType != JsonTokenType.StartObject) 240if (reader.TokenType == JsonTokenType.EndObject) 246Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Collection\MemoryConverter.cs (1)
21if (reader.TokenType is JsonTokenType.Null)
System\Text\Json\Serialization\Converters\Collection\ReadOnlyMemoryConverter.cs (1)
21if (reader.TokenType is JsonTokenType.Null)
System\Text\Json\Serialization\Converters\FSharp\FSharpOptionConverter.cs (2)
36if (!state.IsContinuation && reader.TokenType == JsonTokenType.Null) 85if (reader.TokenType == JsonTokenType.Null)
System\Text\Json\Serialization\Converters\FSharp\FSharpValueOptionConverter.cs (2)
36if (!state.IsContinuation && reader.TokenType == JsonTokenType.Null) 87if (reader.TokenType == JsonTokenType.Null)
System\Text\Json\Serialization\Converters\Node\JsonArrayConverter.cs (2)
27case JsonTokenType.StartArray: 29case JsonTokenType.Null:
System\Text\Json\Serialization\Converters\Node\JsonNodeConverter.cs (7)
43case JsonTokenType.String: 44case JsonTokenType.False: 45case JsonTokenType.True: 46case JsonTokenType.Number: 48case JsonTokenType.StartObject: 50case JsonTokenType.StartArray: 52case JsonTokenType.Null:
System\Text\Json\Serialization\Converters\Node\JsonObjectConverter.cs (2)
52case JsonTokenType.StartObject: 54case JsonTokenType.Null:
System\Text\Json\Serialization\Converters\Node\JsonValueConverter.cs (1)
25if (reader.TokenType is JsonTokenType.Null)
System\Text\Json\Serialization\Converters\Object\ObjectDefaultConverter.cs (8)
30if (reader.TokenType != JsonTokenType.StartObject) 60if (reader.TokenType != JsonTokenType.StartObject) 165JsonTokenType tokenType = reader.TokenType; 166if (tokenType == JsonTokenType.EndObject) 172Debug.Assert(tokenType == JsonTokenType.PropertyName); 282JsonTokenType tokenType = reader.TokenType; 284if (tokenType == JsonTokenType.EndObject) 290Debug.Assert(tokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (9)
43if (reader.TokenType != JsonTokenType.StartObject) 94Debug.Assert(tempReader.TokenType == JsonTokenType.PropertyName); 123if (reader.TokenType != JsonTokenType.StartObject) 292JsonTokenType tokenType = reader.TokenType; 294if (tokenType == JsonTokenType.EndObject) 300Debug.Assert(tokenType == JsonTokenType.PropertyName); 402JsonTokenType tokenType = reader.TokenType; 404if (tokenType == JsonTokenType.EndObject) 410Debug.Assert(tokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\BooleanConverter.cs (1)
25Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\ByteArrayConverter.cs (1)
12if (reader.TokenType == JsonTokenType.Null)
System\Text\Json\Serialization\Converters\Value\ByteConverter.cs (2)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 40if (reader.TokenType == JsonTokenType.String && (JsonNumberHandling.AllowReadingFromString & handling) != 0)
System\Text\Json\Serialization\Converters\Value\CharConverter.cs (3)
15if (reader.TokenType is not (JsonTokenType.String or JsonTokenType.PropertyName)) 49Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DateOnlyConverter.cs (2)
17if (reader.TokenType != JsonTokenType.String) 27Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DateTimeConverter.cs (1)
23Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DateTimeOffsetConverter.cs (1)
23Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DecimalConverter.cs (2)
28Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 39if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\DoubleConverter.cs (2)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 40if (reader.TokenType == JsonTokenType.String)
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (4)
106case JsonTokenType.String when (_converterOptions & EnumConverterOptions.AllowStrings) != 0: 113case JsonTokenType.Number when (_converterOptions & EnumConverterOptions.AllowNumbers) != 0: 238Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\GuidConverter.cs (1)
24Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\HalfConverter.cs (3)
23if (reader.TokenType != JsonTokenType.Number) 74Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 87if (reader.TokenType == JsonTokenType.String)
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (3)
23if (reader.TokenType != JsonTokenType.Number) 68Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 81if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\Int16Converter.cs (2)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 41if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\Int32Converter.cs (2)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 41if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\Int64Converter.cs (2)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 40if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\JsonPrimitiveConverter.cs (1)
25if (reader.TokenType != JsonTokenType.PropertyName)
System\Text\Json\Serialization\Converters\Value\MemoryByteConverter.cs (1)
15return reader.TokenType is JsonTokenType.Null ? default : reader.GetBytesFromBase64();
System\Text\Json\Serialization\Converters\Value\NullableConverter.cs (3)
30if (!state.IsContinuation && reader.TokenType == JsonTokenType.Null) 64if (reader.TokenType == JsonTokenType.Null) 87if (reader.TokenType == JsonTokenType.Null)
System\Text\Json\Serialization\Converters\Value\ReadOnlyMemoryByteConverter.cs (1)
15return reader.TokenType is JsonTokenType.Null ? default : reader.GetBytesFromBase64();
System\Text\Json\Serialization\Converters\Value\SByteConverter.cs (2)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 40if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\SingleConverter.cs (2)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 41if (reader.TokenType == JsonTokenType.String)
System\Text\Json\Serialization\Converters\Value\StringConverter.cs (1)
32Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (4)
19if (reader.TokenType != JsonTokenType.String) 29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 35Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (4)
19if (reader.TokenType != JsonTokenType.String) 29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 35Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (3)
23if (reader.TokenType != JsonTokenType.Number) 68Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 81if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\UInt16Converter.cs (2)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 41if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\UInt32Converter.cs (2)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 41if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\UInt64Converter.cs (2)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 40if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\UriConverter.cs (2)
14return reader.TokenType is JsonTokenType.Null ? null : ReadCore(ref reader); 30Debug.Assert(reader.TokenType is JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (4)
22if (reader.TokenType is JsonTokenType.Null) 27if (reader.TokenType != JsonTokenType.String) 37Debug.Assert(reader.TokenType is JsonTokenType.PropertyName or JsonTokenType.String);
System\Text\Json\Serialization\JsonConverterOfT.cs (13)
62/// and whether <see cref="JsonTokenType.Null"/> should be passed on deserialization. 151if (reader.TokenType == JsonTokenType.Null && !HandleNullOnRead && !state.IsContinuation) 183JsonTokenType originalPropertyTokenType = reader.TokenType; 241Debug.Assert(state.Current.OriginalTokenType == JsonTokenType.None); 499internal void VerifyRead(JsonTokenType tokenType, int depth, long bytesConsumed, bool isValueConverter, ref Utf8JsonReader reader) 505case JsonTokenType.StartArray: 506if (reader.TokenType != JsonTokenType.EndArray) 517case JsonTokenType.StartObject: 518if (reader.TokenType != JsonTokenType.EndObject) 529case JsonTokenType.None: 546if (!CanBePolymorphic && !(HandleNullOnRead && tokenType == JsonTokenType.Null)) 605Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 651if (originalDepth != writer.CurrentDepth || writer.TokenType != JsonTokenType.PropertyName)
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (10)
67if (reader.TokenType == JsonTokenType.EndObject) 74Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 214if (reader.TokenType != JsonTokenType.String) 228if (reader.TokenType != JsonTokenType.String) 246case JsonTokenType.String: 249case JsonTokenType.Number: 261if (reader.TokenType != JsonTokenType.StartArray) 496case JsonTokenType.StartArray: 500case JsonTokenType.EndObject: 509Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\JsonSerializer.Read.Utf8JsonReader.cs (21)
36/// is <see cref="JsonTokenType.PropertyName"/> or <see cref="JsonTokenType.None"/>, the 90/// is <see cref="JsonTokenType.PropertyName"/> or <see cref="JsonTokenType.None"/>, the 138/// is <see cref="JsonTokenType.PropertyName"/> or <see cref="JsonTokenType.None"/>, the 184/// is <see cref="JsonTokenType.PropertyName"/> or <see cref="JsonTokenType.None"/>, the 242/// is <see cref="JsonTokenType.PropertyName"/> or <see cref="JsonTokenType.None"/>, the 335case JsonTokenType.None: 338case JsonTokenType.PropertyName: 351case JsonTokenType.StartObject: 352case JsonTokenType.StartArray: 374Debug.Assert(reader.TokenType is JsonTokenType.EndObject or JsonTokenType.EndArray); 378case JsonTokenType.Number: 379case JsonTokenType.True: 380case JsonTokenType.False: 381case JsonTokenType.Null: 394case JsonTokenType.String:
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (2)
854if (reader.TokenType == JsonTokenType.Null) 903if (JsonTypeInfo.ElementType == JsonTypeInfo.ObjectType && reader.TokenType == JsonTokenType.Null)
System\Text\Json\Serialization\Metadata\JsonPropertyInfoOfT.cs (2)
279bool isNullToken = reader.TokenType == JsonTokenType.Null; 368bool isNullToken = reader.TokenType == JsonTokenType.Null;
System\Text\Json\Serialization\ReadStackFrame.cs (1)
41public JsonTokenType OriginalTokenType;
System\Text\Json\ThrowHelper.cs (18)
263public static InvalidOperationException GetInvalidOperationException_ExpectedArray(JsonTokenType tokenType) 268public static InvalidOperationException GetInvalidOperationException_ExpectedObject(JsonTokenType tokenType) 274public static void ThrowInvalidOperationException_ExpectedNumber(JsonTokenType tokenType) 280public static void ThrowInvalidOperationException_ExpectedBoolean(JsonTokenType tokenType) 286public static void ThrowInvalidOperationException_ExpectedString(JsonTokenType tokenType) 292public static void ThrowInvalidOperationException_ExpectedPropertyName(JsonTokenType tokenType) 298public static void ThrowInvalidOperationException_ExpectedStringComparison(JsonTokenType tokenType) 304public static void ThrowInvalidOperationException_ExpectedComment(JsonTokenType tokenType) 335private static InvalidOperationException GetInvalidOperationException(string message, JsonTokenType tokenType) 340private static InvalidOperationException GetInvalidOperationException(JsonTokenType tokenType) 347JsonTokenType expectedType, 348JsonTokenType actualType) 518public static void ThrowInvalidOperationException(ExceptionResource resource, int currentDepth, int maxDepth, byte token, JsonTokenType tokenType) 593public static InvalidOperationException GetInvalidOperationException(ExceptionResource resource, int currentDepth, int maxDepth, byte token, JsonTokenType tokenType) 609private static string GetResourceString(ExceptionResource resource, int currentDepth, int maxDepth, byte token, JsonTokenType tokenType) 616message = (tokenType == JsonTokenType.PropertyName) ? 633message = (tokenType == JsonTokenType.PropertyName) ? 742public static void ThrowInvalidOperationException_ExpectedChar(JsonTokenType tokenType)
System\Text\Json\ThrowHelper.Serialization.cs (2)
656public static void ThrowJsonException_MetadataValuesInvalidToken(JsonTokenType tokenType) 668public static void ThrowJsonException_MetadataValueWasNotString(JsonTokenType tokenType)
System\Text\Json\Writer\Utf8JsonWriter.cs (30)
46private JsonTokenType _tokenType; 110internal JsonTokenType TokenType => _tokenType; 553_tokenType = JsonTokenType.StartArray; 566_tokenType = JsonTokenType.StartObject; 649Debug.Assert(_tokenType != JsonTokenType.PropertyName); 650Debug.Assert(_tokenType != JsonTokenType.None && _tokenType != JsonTokenType.StartArray); 655Debug.Assert(_tokenType != JsonTokenType.PropertyName); 656Debug.Assert(_tokenType != JsonTokenType.StartObject); 657Debug.Assert(CurrentDepth == 0 && _tokenType != JsonTokenType.None); 682if (_tokenType is not JsonTokenType.PropertyName and not JsonTokenType.None || _commentAfterNoneOrPropertyName) 703_tokenType = JsonTokenType.StartArray; 717_tokenType = JsonTokenType.StartObject; 754_tokenType = JsonTokenType.StartArray; 779_tokenType = JsonTokenType.StartObject; 903_tokenType = JsonTokenType.StartArray; 928_tokenType = JsonTokenType.StartObject; 993_tokenType = JsonTokenType.EndArray; 1005_tokenType = JsonTokenType.EndObject; 1062if (_tokenType == JsonTokenType.PropertyName) 1089if (_tokenType == JsonTokenType.StartObject || _tokenType == JsonTokenType.StartArray) 1106Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.None); 1256/// to allow <see cref="CanWriteValue"/> to be done using bitwise operations and must be kept in sync with <see cref="JsonTokenType"/>. 1261/// Root level. The choice of <see cref="JsonTokenType.None"/> allows fast validation by equality comparison when writing values 1264None = JsonTokenType.None, 1267/// JSON object. The choice of <see cref="JsonTokenType.PropertyName"/> allows fast validation by equality comparison when writing values 1270Object = JsonTokenType.PropertyName, 1273/// JSON array. Chosen so that its lower nibble is 0 to ensure it does not conflict with <see cref="JsonTokenType"/> numeric values that currently are less than 16.
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Bytes.cs (7)
28_tokenType = JsonTokenType.String; 75_tokenType = JsonTokenType.String; 99_tokenType = JsonTokenType.String; 302Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 304if (_tokenType != JsonTokenType.None) 352Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 354if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTime.cs (7)
32_tokenType = JsonTokenType.String; 81_tokenType = JsonTokenType.String; 106_tokenType = JsonTokenType.String; 304Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 306if (_tokenType != JsonTokenType.None) 352Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 354if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTimeOffset.cs (7)
31_tokenType = JsonTokenType.String; 80_tokenType = JsonTokenType.String; 105_tokenType = JsonTokenType.String; 303Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 305if (_tokenType != JsonTokenType.None) 351Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 353if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Decimal.cs (7)
31_tokenType = JsonTokenType.Number; 80_tokenType = JsonTokenType.Number; 105_tokenType = JsonTokenType.Number; 297Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 299if (_tokenType != JsonTokenType.None) 342Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 344if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Double.cs (7)
33_tokenType = JsonTokenType.Number; 83_tokenType = JsonTokenType.Number; 109_tokenType = JsonTokenType.Number; 301Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 303if (_tokenType != JsonTokenType.None) 346Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 348if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Float.cs (7)
33_tokenType = JsonTokenType.Number; 83_tokenType = JsonTokenType.Number; 109_tokenType = JsonTokenType.Number; 301Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 303if (_tokenType != JsonTokenType.None) 346Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 348if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.FormattedNumber.cs (3)
38_tokenType = JsonTokenType.Number; 68_tokenType = JsonTokenType.Number; 79_tokenType = JsonTokenType.Number;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Guid.cs (7)
31_tokenType = JsonTokenType.String; 80_tokenType = JsonTokenType.String; 105_tokenType = JsonTokenType.String; 305Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 307if (_tokenType != JsonTokenType.None) 354Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 356if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Helpers.cs (9)
40if (_enclosingContainer != EnclosingContainerType.Object || _tokenType == JsonTokenType.PropertyName) 42Debug.Assert(_tokenType != JsonTokenType.StartObject); 53if (_enclosingContainer != EnclosingContainerType.Object || _tokenType == JsonTokenType.PropertyName) 55Debug.Assert(_tokenType != JsonTokenType.StartObject); 71Debug.Assert(_enclosingContainer != EnclosingContainerType.Object || _tokenType == JsonTokenType.PropertyName); 125Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 127if (_tokenType != JsonTokenType.None) 198Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 200if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Literal.cs (15)
23_tokenType = JsonTokenType.Null; 34_tokenType = JsonTokenType.Null; 45_tokenType = JsonTokenType.Null; 102_tokenType = JsonTokenType.Null; 127_tokenType = JsonTokenType.Null; 143_tokenType = JsonTokenType.True; 148_tokenType = JsonTokenType.False; 198_tokenType = value ? JsonTokenType.True : JsonTokenType.False; 224_tokenType = value ? JsonTokenType.True : JsonTokenType.False; 445Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 447if (_tokenType != JsonTokenType.None) 490Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 492if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.SignedNumber.cs (7)
31_tokenType = JsonTokenType.Number; 80_tokenType = JsonTokenType.Number; 105_tokenType = JsonTokenType.Number; 370Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 372if (_tokenType != JsonTokenType.None) 415Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 417if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (25)
38_tokenType = JsonTokenType.PropertyName; 50_tokenType = JsonTokenType.PropertyName; 106_tokenType = JsonTokenType.PropertyName; 208if (_tokenType != JsonTokenType.None) 255_tokenType = JsonTokenType.PropertyName; 265_tokenType = JsonTokenType.PropertyName; 395Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 397if (_tokenType != JsonTokenType.None) 433_tokenType = JsonTokenType.String; 517_tokenType = JsonTokenType.String; 541_tokenType = JsonTokenType.String; 613_tokenType = JsonTokenType.String; 660_tokenType = JsonTokenType.String; 700_tokenType = JsonTokenType.String; 747_tokenType = JsonTokenType.String; 787_tokenType = JsonTokenType.String; 859_tokenType = JsonTokenType.String; 1522Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1524if (_tokenType != JsonTokenType.None) 1571Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1573if (_tokenType != JsonTokenType.None) 1623Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1625if (_tokenType != JsonTokenType.None) 1674Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1676if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.UnsignedNumber.cs (7)
32_tokenType = JsonTokenType.Number; 83_tokenType = JsonTokenType.Number; 109_tokenType = JsonTokenType.Number; 379Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 381if (_tokenType != JsonTokenType.None) 424Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 426if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Bytes.cs (3)
29_tokenType = JsonTokenType.String; 121if (_tokenType != JsonTokenType.PropertyName) 123if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Comment.cs (6)
53if (_tokenType is JsonTokenType.PropertyName or JsonTokenType.None) 127if (_tokenType != JsonTokenType.None || _commentAfterNoneOrPropertyName) 175if (_tokenType is JsonTokenType.PropertyName or JsonTokenType.None) 233if (_tokenType != JsonTokenType.None || _commentAfterNoneOrPropertyName)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTime.cs (3)
39_tokenType = JsonTokenType.String; 86if (_tokenType != JsonTokenType.PropertyName) 88if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTimeOffset.cs (3)
40_tokenType = JsonTokenType.String; 87if (_tokenType != JsonTokenType.PropertyName) 89if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Decimal.cs (3)
39_tokenType = JsonTokenType.Number; 82if (_tokenType != JsonTokenType.PropertyName) 84if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Double.cs (3)
43_tokenType = JsonTokenType.Number; 86if (_tokenType != JsonTokenType.PropertyName) 88if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Float.cs (3)
43_tokenType = JsonTokenType.Number; 86if (_tokenType != JsonTokenType.PropertyName) 88if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.FormattedNumber.cs (3)
44_tokenType = JsonTokenType.Number; 88if (_tokenType != JsonTokenType.PropertyName) 90if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Guid.cs (3)
39_tokenType = JsonTokenType.String; 87if (_tokenType != JsonTokenType.PropertyName) 89if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Helpers.cs (12)
23/// Because we designed <see cref="EnclosingContainerType.Object"/> == <see cref="JsonTokenType.PropertyName"/>, we can just check for equality. 31/// Writing a value is never valid and <see cref="_enclosingContainer"/> does not equal any <see cref="JsonTokenType"/> by construction. 65Debug.Assert(_tokenType != JsonTokenType.PropertyName); 66Debug.Assert(_tokenType != JsonTokenType.None && _tokenType != JsonTokenType.StartArray); 71Debug.Assert(_tokenType != JsonTokenType.PropertyName); 72Debug.Assert(CurrentDepth == 0 && _tokenType != JsonTokenType.None); 105Debug.Assert(_tokenType != JsonTokenType.PropertyName); 106Debug.Assert(_tokenType != JsonTokenType.None && _tokenType != JsonTokenType.StartArray); 111Debug.Assert(_tokenType != JsonTokenType.PropertyName); 112Debug.Assert(CurrentDepth == 0 && _tokenType != JsonTokenType.None);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Literal.cs (5)
21_tokenType = JsonTokenType.Null; 36_tokenType = JsonTokenType.True; 41_tokenType = JsonTokenType.False; 106if (_tokenType != JsonTokenType.PropertyName) 108if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (2)
158_tokenType = JsonTokenType.String; 249_tokenType = JsonTokenType.String;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.SignedNumber.cs (3)
52_tokenType = JsonTokenType.Number; 95if (_tokenType != JsonTokenType.PropertyName) 97if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.String.cs (8)
26_tokenType = JsonTokenType.String; 79_tokenType = JsonTokenType.String; 166if (_tokenType != JsonTokenType.PropertyName) 168if (_tokenType != JsonTokenType.None) 226_tokenType = JsonTokenType.String; 312if (_tokenType != JsonTokenType.PropertyName) 314if (_tokenType != JsonTokenType.None) 364_tokenType = JsonTokenType.String;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (5)
60_tokenType = JsonTokenType.String; 228_tokenType = JsonTokenType.String; 395_tokenType = JsonTokenType.String; 492if (_tokenType != JsonTokenType.PropertyName) 494if (_tokenType != JsonTokenType.None)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.UnsignedNumber.cs (3)
54_tokenType = JsonTokenType.Number; 97if (_tokenType != JsonTokenType.PropertyName) 99if (_tokenType != JsonTokenType.None)
System.Windows.Forms.Tests (2)
System\Windows\Forms\DataObjectTests.cs (2)
3028if (reader.TokenType == JsonTokenType.EndObject) 3039if (reader.TokenType != JsonTokenType.PropertyName)