JsonPathExtensions Class
Provides JSONPath evaluation helpers for JSON syntax trees.
public static class JsonPathExtensionsMethods
| Name | Description |
|---|---|
| Evaluate(JsonPath, JsonSyntaxNode?) | Evaluates this JSONPath expression against a JSON syntax node. |
| Evaluate(JsonPath, JsonSyntaxNode?, JsonPathEvaluationMode) | Evaluates this JSONPath expression against a JSON syntax node. |
| Evaluate(JsonPath, JsonSyntaxNode?, JsonPathEvaluationOptions, JsonPathEvaluationMode) | Evaluates a syntax node using cooperative cancellation and resource limits. |
| Evaluate(JsonPath, JsonSyntaxTree?) | Evaluates this JSONPath expression against a JSON syntax tree. |
| Evaluate(JsonPath, JsonSyntaxTree?, JsonPathEvaluationMode) | Evaluates this JSONPath expression against a JSON syntax tree. |
| Evaluate(JsonPath, JsonSyntaxTree?, JsonPathEvaluationOptions, JsonPathEvaluationMode) | Evaluates a syntax tree using cooperative cancellation and resource limits. |
| Evaluate(JsonSyntaxNode?, JsonPath) | Evaluates a JSONPath expression against this JSON syntax node. |
| Evaluate(JsonSyntaxNode?, JsonPath, JsonPathEvaluationMode) | Evaluates a JSONPath expression against this JSON syntax node. |
| Evaluate(JsonSyntaxNode?, JsonPath, JsonPathEvaluationOptions, JsonPathEvaluationMode) | Evaluates a syntax node using cooperative cancellation and resource limits. |
| Evaluate(JsonSyntaxTree?, JsonPath) | Evaluates a JSONPath expression against this JSON syntax tree. |
| Evaluate(JsonSyntaxTree?, JsonPath, JsonPathEvaluationMode) | Evaluates a JSONPath expression against this JSON syntax tree. |
| Evaluate(JsonSyntaxTree?, JsonPath, JsonPathEvaluationOptions, JsonPathEvaluationMode) | Evaluates a syntax tree using cooperative cancellation and resource limits. |
| EvaluateValue(JsonPath, JsonSyntaxNode?) | Evaluates this JSONPath expression and returns the first matched syntax node, or null when there is no match. |
| EvaluateValue(JsonPath, JsonSyntaxNode?, JsonPathEvaluationMode) | Evaluates this JSONPath expression and returns the first matched syntax node, or null when there is no match. |
| EvaluateValue(JsonPath, JsonSyntaxNode?, JsonPathEvaluationOptions, JsonPathEvaluationMode) | Returns the first syntax node using cooperative cancellation and resource limits. |
| EvaluateValue(JsonPath, JsonSyntaxTree?) | Evaluates this JSONPath expression and returns the first matched syntax node, or null when there is no match. |
| EvaluateValue(JsonPath, JsonSyntaxTree?, JsonPathEvaluationMode) | Evaluates this JSONPath expression and returns the first matched syntax node, or null when there is no match. |
| EvaluateValue(JsonPath, JsonSyntaxTree?, JsonPathEvaluationOptions, JsonPathEvaluationMode) | Returns the first syntax node using cooperative cancellation and resource limits. |
| EvaluateValue(JsonSyntaxNode?, JsonPath) | Evaluates a JSONPath expression against this JSON syntax node and returns the first matched syntax node, or null when there is no match. |
| EvaluateValue(JsonSyntaxNode?, JsonPath, JsonPathEvaluationMode) | Evaluates a JSONPath expression against this JSON syntax node and returns the first matched syntax node, or null when there is no match. |
| EvaluateValue(JsonSyntaxNode?, JsonPath, JsonPathEvaluationOptions, JsonPathEvaluationMode) | Returns the first syntax node using cooperative cancellation and resource limits. |
| EvaluateValue(JsonSyntaxTree?, JsonPath) | Evaluates a JSONPath expression against this JSON syntax tree and returns the first matched syntax node, or null when there is no match. |
| EvaluateValue(JsonSyntaxTree?, JsonPath, JsonPathEvaluationMode) | Evaluates a JSONPath expression against this JSON syntax tree and returns the first matched syntax node, or null when there is no match. |
| EvaluateValue(JsonSyntaxTree?, JsonPath, JsonPathEvaluationOptions, JsonPathEvaluationMode) | Returns the first syntax node using cooperative cancellation and resource limits. |
Evaluate overloads
Evaluate(JsonPath, JsonSyntaxNode?)
JsonPathExtensions.csEvaluates this JSONPath expression against a JSON syntax node.
public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonPath path, JsonSyntaxNode? root)Parameters
pathJsonPath- The JSONPath expression to evaluate.
rootJsonSyntaxNode?- The root JSON syntax node to query. May be
nullwhen the root value is JSONnull.
Returns
JsonPathResult<JsonSyntaxNode> A JsonPathResult<TValue> containing all matched syntax nodes.
Exceptions
ArgumentNullExceptionpathisnull.
Evaluate(JsonPath, JsonSyntaxNode?, JsonPathEvaluationMode)
JsonPathExtensions.csEvaluates this JSONPath expression against a JSON syntax node.
public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonPath path, JsonSyntaxNode? root, JsonPathEvaluationMode mode)Parameters
pathJsonPath- The JSONPath expression to evaluate.
rootJsonSyntaxNode?- The root JSON syntax node to query. May be
nullwhen the root value is JSONnull. modeJsonPathEvaluationMode- The evaluation mode.
Returns
JsonPathResult<JsonSyntaxNode> A JsonPathResult<TValue> containing all matched syntax nodes.
Exceptions
ArgumentNullExceptionpathisnull.JsonPathEvaluationException- The path cannot be evaluated in
JsonPathEvaluationMode.Strictmode.
Evaluate(JsonPath, JsonSyntaxNode?, JsonPathEvaluationOptions, JsonPathEvaluationMode)
JsonPathExtensions.csEvaluates a syntax node using cooperative cancellation and resource limits.
public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonPath path, JsonSyntaxNode? root, JsonPathEvaluationOptions options, JsonPathEvaluationMode mode = (JsonPathEvaluationMode)0)Parameters
pathJsonPathrootJsonSyntaxNode?optionsJsonPathEvaluationOptionsmodeJsonPathEvaluationMode
Returns
Evaluate(JsonPath, JsonSyntaxTree?)
JsonPathExtensions.csEvaluates this JSONPath expression against a JSON syntax tree.
public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonPath path, JsonSyntaxTree? root)Parameters
pathJsonPath- The JSONPath expression to evaluate.
rootJsonSyntaxTree?- The root JSON syntax tree to query. May be
null.
Returns
JsonPathResult<JsonSyntaxNode> A JsonPathResult<TValue> containing all matched syntax nodes.
Exceptions
ArgumentNullExceptionpathisnull.
Evaluate(JsonPath, JsonSyntaxTree?, JsonPathEvaluationMode)
JsonPathExtensions.csEvaluates this JSONPath expression against a JSON syntax tree.
public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonPath path, JsonSyntaxTree? root, JsonPathEvaluationMode mode)Parameters
pathJsonPath- The JSONPath expression to evaluate.
rootJsonSyntaxTree?- The root JSON syntax tree to query. May be
null. modeJsonPathEvaluationMode- The evaluation mode.
Returns
JsonPathResult<JsonSyntaxNode> A JsonPathResult<TValue> containing all matched syntax nodes.
Exceptions
ArgumentNullExceptionpathisnull.JsonPathEvaluationException- The path cannot be evaluated in
JsonPathEvaluationMode.Strictmode.
Evaluate(JsonPath, JsonSyntaxTree?, JsonPathEvaluationOptions, JsonPathEvaluationMode)
JsonPathExtensions.csEvaluates a syntax tree using cooperative cancellation and resource limits.
public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonPath path, JsonSyntaxTree? root, JsonPathEvaluationOptions options, JsonPathEvaluationMode mode = (JsonPathEvaluationMode)0)Parameters
pathJsonPathrootJsonSyntaxTree?optionsJsonPathEvaluationOptionsmodeJsonPathEvaluationMode
Returns
Evaluate(JsonSyntaxNode?, JsonPath)
JsonPathExtensions.csEvaluates a JSONPath expression against this JSON syntax node.
public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonSyntaxNode? root, JsonPath path)Parameters
rootJsonSyntaxNode?- The root JSON syntax node to query. May be
nullwhen the root value is JSONnull. pathJsonPath- The JSONPath expression to evaluate.
Returns
JsonPathResult<JsonSyntaxNode> A JsonPathResult<TValue> containing all matched syntax nodes.
Exceptions
ArgumentNullExceptionpathisnull.
Evaluate(JsonSyntaxNode?, JsonPath, JsonPathEvaluationMode)
JsonPathExtensions.csEvaluates a JSONPath expression against this JSON syntax node.
public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonSyntaxNode? root, JsonPath path, JsonPathEvaluationMode mode)Parameters
rootJsonSyntaxNode?- The root JSON syntax node to query. May be
nullwhen the root value is JSONnull. pathJsonPath- The JSONPath expression to evaluate.
modeJsonPathEvaluationMode- The evaluation mode.
Returns
JsonPathResult<JsonSyntaxNode> A JsonPathResult<TValue> containing all matched syntax nodes.
Exceptions
ArgumentNullExceptionpathisnull.JsonPathEvaluationException- The path cannot be evaluated in
JsonPathEvaluationMode.Strictmode.
Evaluate(JsonSyntaxNode?, JsonPath, JsonPathEvaluationOptions, JsonPathEvaluationMode)
JsonPathExtensions.csEvaluates a syntax node using cooperative cancellation and resource limits.
public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonSyntaxNode? root, JsonPath path, JsonPathEvaluationOptions options, JsonPathEvaluationMode mode = (JsonPathEvaluationMode)0)Parameters
rootJsonSyntaxNode?pathJsonPathoptionsJsonPathEvaluationOptionsmodeJsonPathEvaluationMode
Returns
Evaluate(JsonSyntaxTree?, JsonPath)
JsonPathExtensions.csEvaluates a JSONPath expression against this JSON syntax tree.
public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonSyntaxTree? root, JsonPath path)Parameters
rootJsonSyntaxTree?- The root JSON syntax tree to query. May be
null. pathJsonPath- The JSONPath expression to evaluate.
Returns
JsonPathResult<JsonSyntaxNode> A JsonPathResult<TValue> containing all matched syntax nodes.
Exceptions
ArgumentNullExceptionpathisnull.
Evaluate(JsonSyntaxTree?, JsonPath, JsonPathEvaluationMode)
JsonPathExtensions.csEvaluates a JSONPath expression against this JSON syntax tree.
public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonSyntaxTree? root, JsonPath path, JsonPathEvaluationMode mode)Parameters
rootJsonSyntaxTree?- The root JSON syntax tree to query. May be
null. pathJsonPath- The JSONPath expression to evaluate.
modeJsonPathEvaluationMode- The evaluation mode.
Returns
JsonPathResult<JsonSyntaxNode> A JsonPathResult<TValue> containing all matched syntax nodes.
Exceptions
ArgumentNullExceptionpathisnull.JsonPathEvaluationException- The path cannot be evaluated in
JsonPathEvaluationMode.Strictmode.
Evaluate(JsonSyntaxTree?, JsonPath, JsonPathEvaluationOptions, JsonPathEvaluationMode)
JsonPathExtensions.csEvaluates a syntax tree using cooperative cancellation and resource limits.
public static JsonPathResult<JsonSyntaxNode> Evaluate(this JsonSyntaxTree? root, JsonPath path, JsonPathEvaluationOptions options, JsonPathEvaluationMode mode = (JsonPathEvaluationMode)0)Parameters
rootJsonSyntaxTree?pathJsonPathoptionsJsonPathEvaluationOptionsmodeJsonPathEvaluationMode
Returns
EvaluateValue overloads
EvaluateValue(JsonPath, JsonSyntaxNode?)
JsonPathExtensions.csEvaluates this JSONPath expression and returns the first matched syntax node, or null when there is no match.
public static JsonSyntaxNode? EvaluateValue(this JsonPath path, JsonSyntaxNode? root)Parameters
pathJsonPath- The JSONPath expression to evaluate.
rootJsonSyntaxNode?- The root JSON syntax node to query. May be
nullwhen the root value is JSONnull.
Returns
JsonSyntaxNode? The first matched syntax node, or null when there is no match.
Exceptions
ArgumentNullExceptionpathisnull.
EvaluateValue(JsonPath, JsonSyntaxNode?, JsonPathEvaluationMode)
JsonPathExtensions.csEvaluates this JSONPath expression and returns the first matched syntax node, or null when there is no match.
public static JsonSyntaxNode? EvaluateValue(this JsonPath path, JsonSyntaxNode? root, JsonPathEvaluationMode mode)Parameters
pathJsonPath- The JSONPath expression to evaluate.
rootJsonSyntaxNode?- The root JSON syntax node to query. May be
nullwhen the root value is JSONnull. modeJsonPathEvaluationMode- The evaluation mode.
Returns
JsonSyntaxNode? The first matched syntax node, or null when there is no match.
Exceptions
ArgumentNullExceptionpathisnull.JsonPathEvaluationException- The path cannot be evaluated in
JsonPathEvaluationMode.Strictmode.
EvaluateValue(JsonPath, JsonSyntaxNode?, JsonPathEvaluationOptions, JsonPathEvaluationMode)
JsonPathExtensions.csReturns the first syntax node using cooperative cancellation and resource limits.
public static JsonSyntaxNode? EvaluateValue(this JsonPath path, JsonSyntaxNode? root, JsonPathEvaluationOptions options, JsonPathEvaluationMode mode = (JsonPathEvaluationMode)0)Parameters
pathJsonPathrootJsonSyntaxNode?optionsJsonPathEvaluationOptionsmodeJsonPathEvaluationMode
Returns
EvaluateValue(JsonPath, JsonSyntaxTree?)
JsonPathExtensions.csEvaluates this JSONPath expression and returns the first matched syntax node, or null when there is no match.
public static JsonSyntaxNode? EvaluateValue(this JsonPath path, JsonSyntaxTree? root)Parameters
pathJsonPath- The JSONPath expression to evaluate.
rootJsonSyntaxTree?- The root JSON syntax tree to query. May be
nullwhen the root value is JSONnull.
Returns
JsonSyntaxNode? The first matched syntax node, or null when there is no match.
Exceptions
ArgumentNullExceptionpathisnull.
EvaluateValue(JsonPath, JsonSyntaxTree?, JsonPathEvaluationMode)
JsonPathExtensions.csEvaluates this JSONPath expression and returns the first matched syntax node, or null when there is no match.
public static JsonSyntaxNode? EvaluateValue(this JsonPath path, JsonSyntaxTree? root, JsonPathEvaluationMode mode)Parameters
pathJsonPath- The JSONPath expression to evaluate.
rootJsonSyntaxTree?- The root JSON syntax tree to query. May be
nullwhen the root value is JSONnull. modeJsonPathEvaluationMode- The evaluation mode.
Returns
JsonSyntaxNode? The first matched syntax node, or null when there is no match.
Exceptions
ArgumentNullExceptionpathisnull.JsonPathEvaluationException- The path cannot be evaluated in
JsonPathEvaluationMode.Strictmode.
EvaluateValue(JsonPath, JsonSyntaxTree?, JsonPathEvaluationOptions, JsonPathEvaluationMode)
JsonPathExtensions.csReturns the first syntax node using cooperative cancellation and resource limits.
public static JsonSyntaxNode? EvaluateValue(this JsonPath path, JsonSyntaxTree? root, JsonPathEvaluationOptions options, JsonPathEvaluationMode mode = (JsonPathEvaluationMode)0)Parameters
pathJsonPathrootJsonSyntaxTree?optionsJsonPathEvaluationOptionsmodeJsonPathEvaluationMode
Returns
EvaluateValue(JsonSyntaxNode?, JsonPath)
JsonPathExtensions.csEvaluates a JSONPath expression against this JSON syntax node and returns the first matched syntax node, or null when there is no match.
public static JsonSyntaxNode? EvaluateValue(this JsonSyntaxNode? root, JsonPath path)Parameters
rootJsonSyntaxNode?- The root JSON syntax node to query. May be
nullwhen the root value is JSONnull. pathJsonPath- The JSONPath expression to evaluate.
Returns
JsonSyntaxNode? The first matched syntax node, or null when there is no match.
Exceptions
ArgumentNullExceptionpathisnull.
EvaluateValue(JsonSyntaxNode?, JsonPath, JsonPathEvaluationMode)
JsonPathExtensions.csEvaluates a JSONPath expression against this JSON syntax node and returns the first matched syntax node, or null when there is no match.
public static JsonSyntaxNode? EvaluateValue(this JsonSyntaxNode? root, JsonPath path, JsonPathEvaluationMode mode)Parameters
rootJsonSyntaxNode?- The root JSON syntax node to query. May be
nullwhen the root value is JSONnull. pathJsonPath- The JSONPath expression to evaluate.
modeJsonPathEvaluationMode- The evaluation mode.
Returns
JsonSyntaxNode? The first matched syntax node, or null when there is no match.
Exceptions
ArgumentNullExceptionpathisnull.JsonPathEvaluationException- The path cannot be evaluated in
JsonPathEvaluationMode.Strictmode.
EvaluateValue(JsonSyntaxNode?, JsonPath, JsonPathEvaluationOptions, JsonPathEvaluationMode)
JsonPathExtensions.csReturns the first syntax node using cooperative cancellation and resource limits.
public static JsonSyntaxNode? EvaluateValue(this JsonSyntaxNode? root, JsonPath path, JsonPathEvaluationOptions options, JsonPathEvaluationMode mode = (JsonPathEvaluationMode)0)Parameters
rootJsonSyntaxNode?pathJsonPathoptionsJsonPathEvaluationOptionsmodeJsonPathEvaluationMode
Returns
EvaluateValue(JsonSyntaxTree?, JsonPath)
JsonPathExtensions.csEvaluates a JSONPath expression against this JSON syntax tree and returns the first matched syntax node, or null when there is no match.
public static JsonSyntaxNode? EvaluateValue(this JsonSyntaxTree? root, JsonPath path)Parameters
rootJsonSyntaxTree?- The root JSON syntax tree to query. May be
nullwhen the root value is JSONnull. pathJsonPath- The JSONPath expression to evaluate.
Returns
JsonSyntaxNode? The first matched syntax node, or null when there is no match.
Exceptions
ArgumentNullExceptionpathisnull.
EvaluateValue(JsonSyntaxTree?, JsonPath, JsonPathEvaluationMode)
JsonPathExtensions.csEvaluates a JSONPath expression against this JSON syntax tree and returns the first matched syntax node, or null when there is no match.
public static JsonSyntaxNode? EvaluateValue(this JsonSyntaxTree? root, JsonPath path, JsonPathEvaluationMode mode)Parameters
rootJsonSyntaxTree?- The root JSON syntax tree to query. May be
nullwhen the root value is JSONnull. pathJsonPath- The JSONPath expression to evaluate.
modeJsonPathEvaluationMode- The evaluation mode.
Returns
JsonSyntaxNode? The first matched syntax node, or null when there is no match.
Exceptions
ArgumentNullExceptionpathisnull.JsonPathEvaluationException- The path cannot be evaluated in
JsonPathEvaluationMode.Strictmode.
EvaluateValue(JsonSyntaxTree?, JsonPath, JsonPathEvaluationOptions, JsonPathEvaluationMode)
JsonPathExtensions.csReturns the first syntax node using cooperative cancellation and resource limits.
public static JsonSyntaxNode? EvaluateValue(this JsonSyntaxTree? root, JsonPath path, JsonPathEvaluationOptions options, JsonPathEvaluationMode mode = (JsonPathEvaluationMode)0)Parameters
rootJsonSyntaxTree?pathJsonPathoptionsJsonPathEvaluationOptionsmodeJsonPathEvaluationMode