JObjectHelper Class

Utility methods for working with JObjects, JArrays and JsPath.

Definition

Namespace: MFiles.VAF.Configuration.JsonMapping
Assembly: MFiles.VAF.Configuration (in MFiles.VAF.Configuration.dll) Version: 23.12.13247.3
C#
public class JObjectHelper
Inheritance
Object    JObjectHelper

Constructors

Methods

EnsureArrayExists Returns a reference to an array object at the specified property within an object. Creating the array if the property is not yet set. Throws an exception if a non-array value already exists at the property.
EnsureObjectExists(JArray, Int32) Returns a reference to an object at the specified index within an array. Creating an object at the specified location if one doesn't already exist there. Throws an exception if a non-object value already exists at the index.
EnsureObjectExists(JObject, String) Returns a reference to an object at the specified property within another object. Creating the object if the property is not yet set. Throws an exception if a non-object value already exists at the property.
ReplaceValue Replaces a value in a JSON structure with another value.
SetArrayItem Sets a value at a certain index in an array.
SetOriginalValue Sets the original (source) value in a location corresponding to the targetValue location in the target structure. This allows for the original value to be preserved when reverting back to the original format for conversions that lose information.
SetValue Sets a value in a target JSON structure at the specified path.
TryFindOriginalValue Retrieves an original value that may have been set in a source structure for converted values that might lose some information. Typically the original value would have been saved with the SetOriginalValue(JToken, JToken, String) method.
TryGetArrayIndex Attempts to extract an array index value from a json path segment.

See Also