Class JsonPointer
Represents a JSON Pointer.
Inheritance
Implements
Inherited Members
Namespace: Manatee.Json.Pointer
Assembly: Manatee.Json.dll
Syntax
public class JsonPointer : List<string>, IList<string>, ICollection<string>, IReadOnlyList<string>, IReadOnlyCollection<string>, IEnumerable<string>, IList, ICollection, IEnumerable, IJsonSerializable, IEquatable<JsonPointer>
Constructors
| Improve this Doc View SourceJsonPointer()
Creates a new JsonPointer instance.
Declaration
public JsonPointer()
JsonPointer(IEnumerable<String>)
Creates a new JsonPointer instance.
Declaration
public JsonPointer(IEnumerable<string> source)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | source | A collection of strings representing the segments of the pointer. |
JsonPointer(String[])
Creates a new JsonPointer instance.
Declaration
public JsonPointer(params string[] source)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | source | A collection of strings representing the segments of the pointer. |
Methods
| Improve this Doc View SourceClone()
Creates a copy of the pointer.
Declaration
public JsonPointer Clone()
Returns
Type | Description |
---|---|
JsonPointer |
CloneAndAppend(String[])
Creates a copy of the pointer and appends new segments.
Declaration
public JsonPointer CloneAndAppend(params string[] append)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | append | The segments to append. |
Returns
Type | Description |
---|---|
JsonPointer |
Equals(Nullable<JsonPointer>)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(JsonPointer? other)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<JsonPointer> | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the current object is equal to the |
Equals(Nullable<Object>)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Object> | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified object is equal to the current object; otherwise, false. |
Evaluate(JsonValue)
Evaluates the pointer against a JSON instance.
Declaration
public PointerEvaluationResults Evaluate(JsonValue root)
Parameters
Type | Name | Description |
---|---|---|
JsonValue | root | The JSON instance. |
Returns
Type | Description |
---|---|
PointerEvaluationResults | The element the pointer references, if any. |
FromJson(JsonValue, JsonSerializer)
Builds an object from a JsonValue.
Declaration
public void FromJson(JsonValue json, JsonSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
JsonValue | json | The JsonValue representation of the object. |
JsonSerializer | serializer | The JsonSerializer instance to use for additional serialization of values. |
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for the current object. |
Overrides
IsChildOf(JsonPointer)
Determines whether the pointer is a child of another pointer (starts with the same segments).
Declaration
public bool IsChildOf(JsonPointer pointer)
Parameters
Type | Name | Description |
---|---|---|
JsonPointer | pointer | Another pointer. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Parse(String)
Parses a string containing a JSON Pointer.
Declaration
public static JsonPointer Parse(string source)
Parameters
Type | Name | Description |
---|---|---|
System.String | source | The source string. |
Returns
Type | Description |
---|---|
JsonPointer | A JsonPointer instance. |
ToJson(JsonSerializer)
Converts an object to a JsonValue.
Declaration
public JsonValue ToJson(JsonSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
JsonSerializer | serializer | The JsonSerializer instance to use for additional serialization of values. |
Returns
Type | Description |
---|---|
JsonValue | The JsonValue representation of the object. |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string that represents the current object. |