Skip to content

JsonPathManager Constructor Methods

Shuzhao Feng edited this page Jan 24, 2024 · 3 revisions

Definition

Creates a new JsonPathManager instance. The instance will store a JToken root, then the user can call methods to update the root.

Method Signature

JsonPathManager();

Overloads

JsonPathManager(JToken root);
JsonPathManager(string root);

Usage

JsonPathManager instance = new JsonPathManager();

Parameters

The root is initially uninitialized if no argument is provided. Reading from an uninitialized root will give an empty JObject.

root : JToken

The JToken root to initialize the instance to.

root : string

The string JSON root to initialize the instance to, which will be serialized into a JToken.

Throws JsonReaderException if the input is not a valid JSON string.

Methods

public IJEnumerable<JToken> Value { get; }
public void Add(string path, object value);
public string Build();
public void Clear();
public void Force(string path, object value); // v0.2.0 and above
public JToken? Remove(string path); // v0.2.0 and above
public void Add(string path, object value, Priority priority); // v0.3.0 and above
public void Append(string path, object value, Priority priority); // v0.3.0 and above

Supported Versions

v0.1.0 (unstable) and above
  • v0.3.0
  • v0.2.0
  • v0.1.2
  • v0.1.0 (unstable)

Clone this wiki locally