Skip to content

Commit 43034b6

Browse files
committed
JSON: change "key" to "name" in method parameters
1 parent 9b873a9 commit 43034b6

File tree

7 files changed

+280
-69
lines changed

7 files changed

+280
-69
lines changed

Doxense.Core/Serialization/JSON/Interfaces/IJsonProxyNode.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,16 @@ public static JsonPath ComputePath(IJsonProxyNode? parent, in JsonPathSegment se
9494
}
9595

9696
/// <summary>Returns the path to a field of this object, from the root</summary>
97-
/// <param name="key">Name of a field in this object</param>
98-
public static JsonPath ComputePath(IJsonProxyNode? parent, in JsonPathSegment segment, ReadOnlyMemory<char> key)
97+
/// <param name="parent">Parent of this node (or <c>null</c> if this is the top level)</param>
98+
/// <param name="segment">Name or index of this node in its parent</param>
99+
/// <param name="name">Name of a field in this object</param>
100+
public static JsonPath ComputePath(IJsonProxyNode? parent, in JsonPathSegment segment, ReadOnlyMemory<char> name)
99101
{
100-
Contract.Debug.Requires(key.Length > 0);
102+
Contract.Debug.Requires(name.Length > 0);
101103

102104
if (segment.IsEmpty())
103105
{
104-
return JsonPath.Create(new JsonPathSegment(key));
106+
return JsonPath.Create(new JsonPathSegment(name));
105107
}
106108

107109
Span<char> scratch = stackalloc char[32];
@@ -110,7 +112,7 @@ public static JsonPath ComputePath(IJsonProxyNode? parent, in JsonPathSegment se
110112
{
111113
parent?.WritePath(ref writer);
112114
writer.Append(in segment);
113-
writer.Append(key);
115+
writer.Append(name);
114116
return writer.ToPath();
115117
}
116118
finally
@@ -120,7 +122,8 @@ public static JsonPath ComputePath(IJsonProxyNode? parent, in JsonPathSegment se
120122
}
121123

122124
/// <summary>Returns the path to an item of this array, from the root</summary>
123-
/// <param name="node"></param>
125+
/// <param name="parent">Parent of this node (or <c>null</c> if this is the top level)</param>
126+
/// <param name="segment">Name or index of this node in its parent</param>
124127
/// <param name="index">Index of the item in this array</param>
125128
public static JsonPath ComputePath(IJsonProxyNode? parent, in JsonPathSegment segment, Index index)
126129
{

Doxense.Core/Serialization/JSON/Interfaces/IJsonReadOnlyProxy.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,24 @@ public interface IJsonReadOnlyProxy : IJsonSerializable, IJsonPackable, IEquatab
3535
/// <remarks>This value can be used to "escape" the type safety of the proxy, while still allowing for tracking of read access.</remarks>
3636
ObservableJsonValue Get();
3737

38-
ObservableJsonValue Get(string key);
38+
/// <summary>Returns the value of the field with the specified name</summary>
39+
/// <remarks>This value can be used to "escape" the type safety of the proxy, while still allowing for tracking of read access.</remarks>
40+
ObservableJsonValue Get(string name);
3941

40-
ObservableJsonValue Get(ReadOnlyMemory<char> key);
42+
/// <summary>Returns the value of the field with the specified name</summary>
43+
/// <remarks>This value can be used to "escape" the type safety of the proxy, while still allowing for tracking of read access.</remarks>
44+
ObservableJsonValue Get(ReadOnlyMemory<char> name);
4145

46+
/// <summary>Returns the value of the element at the specified location</summary>
47+
/// <remarks>This value can be used to "escape" the type safety of the proxy, while still allowing for tracking of read access.</remarks>
4248
ObservableJsonValue Get(int index);
4349

50+
/// <summary>Returns the value of the element at the specified location</summary>
51+
/// <remarks>This value can be used to "escape" the type safety of the proxy, while still allowing for tracking of read access.</remarks>
4452
ObservableJsonValue Get(Index index);
4553

54+
/// <summary>Returns the value of the child at the specified path</summary>
55+
/// <remarks>This value can be used to "escape" the type safety of the proxy, while still allowing for tracking of read access.</remarks>
4656
ObservableJsonValue Get(JsonPath path);
4757

4858
/// <summary>Returns the proxied JSON Value</summary>

Doxense.Core/Serialization/JSON/Interfaces/IJsonWritableProxy.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,29 @@ public interface IJsonWritableProxy : IJsonSerializable, IJsonPackable
3636
/// <remarks>This value can be used to "escape" the type safety of the proxy, while still allowing for tracking of mutations.</remarks>
3737
MutableJsonValue Get();
3838

39-
MutableJsonValue Get(string key);
39+
/// <summary>Returns the value of the field with the specified name</summary>
40+
/// <param name="name">Name of the field</param>
41+
/// <remarks>This value can be used to "escape" the type safety of the proxy, while still allowing for tracking of mutations.</remarks>
42+
MutableJsonValue Get(string name);
4043

41-
MutableJsonValue Get(ReadOnlyMemory<char> key);
44+
/// <summary>Returns the value of the field with the specified name</summary>
45+
/// <param name="name">Name of the field</param>
46+
/// <remarks>This value can be used to "escape" the type safety of the proxy, while still allowing for tracking of mutations.</remarks>
47+
MutableJsonValue Get(ReadOnlyMemory<char> name);
4248

49+
/// <summary>Returns the value of the element at the specified location</summary>
50+
/// <param name="index">Index of the item</param>
51+
/// <remarks>This value can be used to "escape" the type safety of the proxy, while still allowing for tracking of mutations.</remarks>
4352
MutableJsonValue Get(int index);
4453

54+
/// <summary>Returns the value of the element at the specified location</summary>
55+
/// <param name="index">Index of the item</param>
56+
/// <remarks>This value can be used to "escape" the type safety of the proxy, while still allowing for tracking of mutations.</remarks>
4557
MutableJsonValue Get(Index index);
4658

59+
/// <summary>Returns the value of the child at the specified path</summary>
60+
/// <param name="path">Path to the child</param>
61+
/// <remarks>This value can be used to "escape" the type safety of the proxy, while still allowing for tracking of mutations.</remarks>
4762
MutableJsonValue Get(JsonPath path);
4863

4964
/// <summary>Returns the proxied JSON Value</summary>

0 commit comments

Comments
 (0)