Home JsonPath Class
JsonPath Class
Cancel

JsonPath Class

Namespace: Json.Path

Inheritance: JsonPath 🡒 object

Represents a JSON Path.

Properties

NameTypeSummary
IsSingularboolGets whether the path is a singular path. That is, it can only return a nodelist containing at most a single value.
RootJsonPathGets a JSON Path with only a global root and no selectors, namely $.
ScopePathScopeGets the scope of the path.
SegmentsPathSegment[]Gets the segments of the path.

Methods

BuildString(StringBuilder builder)

Builds a string representation of the path using a System.Text.StringBuilder.

Declaration

1
public void BuildString(StringBuilder builder)
ParameterTypeDescription
builderStringBuilderThe string builder.

Evaluate(JsonNode root, PathEvaluationOptions options)

Evaluates the path against a JSON instance.

Declaration

1
public PathResult Evaluate(JsonNode root, PathEvaluationOptions options)
ParameterTypeDescription
rootJsonNodeThe root of the JSON instance.
optionsPathEvaluationOptionsEvaluation options.

Returns

The results of the evaluation.

Parse(string source, PathParsingOptions options)

Parses a Json.Path.JsonPath from a string.

Declaration

1
public static JsonPath Parse(string source, PathParsingOptions options)
ParameterTypeDescription
sourcestringThe source string.
optionsPathParsingOptions(optional) The parsing options.

Returns

The parsed path.

ToString()

Returns a string that represents the current object.

Declaration

1
public override string ToString()

Returns

A string that represents the current object.

TryParse(string source, out JsonPath path, PathParsingOptions options)

Parses a Json.Path.JsonPath from a string.

Declaration

1
public static bool TryParse(string source, out JsonPath path, PathParsingOptions options)
ParameterTypeDescription
sourcestringThe source string.
optionsout JsonPath(optional) The parsing options.
pathPathParsingOptionsThe parsed path, if successful; otherwise null.

Returns

True if successful; otherwise false.

Contents