7 instantiations of JsonValue
Microsoft.Analyzers.Local (7)
ApiLifecycle\Json\JsonValue.cs (7)
26public static readonly JsonValue Null = new(JsonValueType.Null, default, null); 362return new JsonValue(value); 371return new JsonValue(value); 380return new JsonValue(value); 389return new JsonValue(value); 398return new JsonValue(value); 413: new JsonValue(value.Value.ToString("o", CultureInfo.InvariantCulture));
80 references to JsonValue
Microsoft.Analyzers.Local (78)
ApiLifecycle\Json\JsonArray.cs (11)
18internal sealed class JsonArray : IEnumerable<JsonValue> 20private readonly List<JsonValue> _items = []; 26public JsonArray(params JsonValue[] values) 49public JsonValue this[int index] 53: JsonValue.Null; 62public JsonArray Add(JsonValue value) 74public JsonArray Insert(int index, JsonValue value) 106public bool Contains(JsonValue item) => _items.Contains(item); 113public int IndexOf(JsonValue item) => _items.IndexOf(item); 119public IEnumerator<JsonValue> GetEnumerator() => _items.GetEnumerator(); 137public JsonValue[] Items { get; }
ApiLifecycle\Json\JsonObject.cs (16)
17internal sealed class JsonObject : IEnumerable<KeyValuePair<string, JsonValue>>, IEnumerable<JsonValue> 19private readonly IDictionary<string, JsonValue> _properties; 26_properties = new Dictionary<string, JsonValue>(); 42public JsonValue this[string key] 44get => _properties.TryGetValue(key, out var value) 46: JsonValue.Null; 56public JsonObject Add(string key) => Add(key, JsonValue.Null); 64public JsonObject Add(string key, JsonValue value) 106if (_properties.TryGetValue(oldKey, out var value)) 127public bool Contains(JsonValue value) => _properties.Values.Contains(value); 133public IEnumerator<KeyValuePair<string, JsonValue>> GetEnumerator() => _properties.GetEnumerator(); 139IEnumerator<JsonValue> IEnumerable<JsonValue>.GetEnumerator() => _properties.Values.GetEnumerator(); 185private readonly JsonValue _value; 187public KeyValuePair(string key, JsonValue value)
ApiLifecycle\Json\JsonReader.cs (12)
29/// <returns>The parsed <see cref="JsonValue"/>.</returns> 30public static JsonValue Parse(TextReader reader) 44/// <returns>The parsed <see cref="JsonValue"/>.</returns> 45public static JsonValue Parse(string source) 62private JsonValue ReadJsonValue() 87private JsonValue ReadNull() 90return JsonValue.Null; 93private JsonValue ReadBoolean() 121private JsonValue ReadNumber() 295var value = ReadJsonValue(); 350var value = ReadJsonValue(); 384private JsonValue Parse()
ApiLifecycle\Json\JsonValue.cs (38)
21internal readonly struct JsonValue : IEquatable<JsonValue> 26public static readonly JsonValue Null = new(JsonValueType.Null, default, null); 31/// Initializes a new instance of the <see cref="JsonValue"/> struct, representing a Boolean value. 48/// Initializes a new instance of the <see cref="JsonValue"/> struct, representing a Number value. 65/// Initializes a new instance of the <see cref="JsonValue"/> struct, representing a String value. 82/// Initializes a new instance of the <see cref="JsonValue"/> struct, representing a JsonObject. 99/// Initializes a new instance of the <see cref="JsonValue"/> struct, representing a Array reference value. 116/// Initializes a new instance of the <see cref="JsonValue"/> struct. 295public JsonValue this[string key] 327/// Thrown when this <see cref="JsonValue"/> is not a <see cref="JsonArray"/>. 329public JsonValue this[int index] 360public static implicit operator JsonValue(bool? value) 369public static implicit operator JsonValue(double? value) 378public static implicit operator JsonValue(string value) 387public static implicit operator JsonValue(JsonObject value) 396public static implicit operator JsonValue(JsonArray value) 409public static implicit operator JsonValue(DateTime? value) 420public static explicit operator int(JsonValue jsonValue) 433public static explicit operator int?(JsonValue jsonValue) 442public static explicit operator bool(JsonValue jsonValue) 455public static explicit operator bool?(JsonValue jsonValue) 464public static explicit operator double(JsonValue jsonValue) 477public static explicit operator double?(JsonValue jsonValue) 488public static explicit operator string?(JsonValue jsonValue) 499public static explicit operator JsonObject?(JsonValue jsonValue) 508public static explicit operator JsonArray?(JsonValue jsonValue) 517public static explicit operator DateTime(JsonValue jsonValue) 526public static explicit operator DateTime?(JsonValue jsonValue) 538public static bool operator ==(JsonValue a, JsonValue b) 550public static bool operator !=(JsonValue a, JsonValue b) 559/// <returns>The <see cref="JsonValue"/> representing the parsed text.</returns> 560public static JsonValue Parse(string text) 565public bool Equals(JsonValue other) 573if (obj is JsonValue jv) 596private readonly JsonValue _jsonValue; 599public JsonValueDebugView(JsonValue jsonValue)
ApiLifecycle\ModelLoader.cs (1)
65var value = JsonReader.Parse(reader);
Microsoft.Analyzers.Local.Tests (2)
Json\JsonReaderTest.cs (1)
17var jsonObject = JsonValue.Parse("{ \"x\": \"value\", \"value\": \"value\" }");
Json\JsonScannerTest.cs (1)
51var obj = JsonValue.Parse("{ /* * / */ }");