Home RelativeJsonPointer Class
RelativeJsonPointer Class
Cancel

RelativeJsonPointer Class

Namespace: Json.Pointer

Inheritance: RelativeJsonPointer 🡒 object

Represents a Relative JSON Pointer IAW draft-handrews-relative-json-pointer-02

Fields

NameTypeSummary
NullRelativeJsonPointerThe null pointer. Indicates no navigation should occur.

Properties

NameTypeSummary
ArrayIndexManipulatorintGets the number of lateral steps to take. Applicable only for arrays.
IsIndexQueryboolGets whether the pointer is an index query, which returns the index within the parent rather than the value.
ParentStepsuintGets the number of parent (root) steps to take.
PointerJsonPointerGets the pointer to follow after taking Json.Pointer.RelativeJsonPointer.ParentSteps steps upward.

Methods

FromPointer(uint parentSteps, JsonPointer pointer)

Creates a Relative JSON Pointer from a JSON Pointer and a number of parent steps.

Declaration

1
public static RelativeJsonPointer FromPointer(uint parentSteps, JsonPointer pointer)
ParameterTypeDescription
parentStepsuintThe number of parent steps.
pointerJsonPointerThe JSON Pointer.

Returns

A Relative JSON Pointer.

FromPointer(uint parentSteps, int arrayIndexManipulator, JsonPointer pointer)

Creates a Relative JSON Pointer from a JSON Pointer and a number of parent steps.

Declaration

1
public static RelativeJsonPointer FromPointer(uint parentSteps, int arrayIndexManipulator, JsonPointer pointer)
ParameterTypeDescription
parentStepsuintThe number of parent steps.
arrayIndexManipulatorintThe index manipulator.
pointerJsonPointerThe JSON Pointer.

Returns

A Relative JSON Pointer.

IndexQuery(uint parentSteps)

Creates an index query pointer.

Declaration

1
public static RelativeJsonPointer IndexQuery(uint parentSteps)
ParameterTypeDescription
parentStepsuint 

Returns

A Relative JSON Pointer.

IndexQuery(uint parentSteps, int arrayIndexManipulator)

Creates an index query pointer.

Declaration

1
public static RelativeJsonPointer IndexQuery(uint parentSteps, int arrayIndexManipulator)
ParameterTypeDescription
parentStepsuint 
arrayIndexManipulatorintThe index manipulator.

Returns

A Relative JSON Pointer.

Parse(string source)

Parses a JSON Pointer segment from a string.

Declaration

1
public static RelativeJsonPointer Parse(string source)
ParameterTypeDescription
sourcestringThe source string.

Returns

A Relative JSON Pointer.

ToString()

Returns the fully qualified type name of this instance.

Declaration

1
public override string ToString()

Returns

The fully qualified type name.

TryEvaluate(JsonNode node, out JsonNode result)

Evaluates the relative pointer over a System.Text.Json.Nodes.JsonNode.

Declaration

1
public bool TryEvaluate(JsonNode node, out JsonNode result)
ParameterTypeDescription
nodeJsonNodeThe System.Text.Json.Nodes.JsonNode.
resultout JsonNodeThe result, if return value is true; null otherwise

Returns

true if a value exists at the indicate path; false otherwise.

TryParse(string source, out RelativeJsonPointer relativePointer)

Parses a JSON Pointer from a string.

Declaration

1
public static bool TryParse(string source, out RelativeJsonPointer relativePointer)
ParameterTypeDescription
sourcestringThe source string.
relativePointerout RelativeJsonPointerThe resulting relative pointer.

Returns

true if the parse was successful; false otherwise.

Contents