JsonPathNavigator<TValue> Class
Provides JSONPath navigation services for a custom object model.
public abstract class JsonPathNavigator<TValue>Type parameters
TValue- The node type used by the custom object model.
Constructors
| Name | Description |
|---|---|
| JsonPathNavigator() |
JsonPathNavigator()
protected JsonPathNavigator()No documentation is available.
Properties
| Name | Description |
|---|---|
| HasConstantTimeElementAccess | Gets whether JsonPathNavigator<TValue>.TryGetElement takes constant time. When it does not, the evaluator copies an array with JsonPathNavigator<TValue>.CopyElements before walking it, so that visiting every element stays linear. |
| HasConstantTimePropertyLookup | Gets whether JsonPathNavigator<TValue>.TryGetPropertyValue takes constant time. |
| IsPure | Gets whether navigation is side-effect-free and values remain stable throughout an evaluation. |
HasConstantTimeElementAccess
JsonPathNavigator`1.csGets whether JsonPathNavigator<TValue>.TryGetElement takes constant time. When it does not, the evaluator copies an array with JsonPathNavigator<TValue>.CopyElements before walking it, so that visiting every element stays linear.
public virtual bool HasConstantTimeElementAccess { get; }Property value
HasConstantTimePropertyLookup
JsonPathNavigator`1.csGets whether JsonPathNavigator<TValue>.TryGetPropertyValue takes constant time.
public virtual bool HasConstantTimePropertyLookup { get; }Property value
Remarks
When this is false, the evaluator enumerates the right object once to build an ordinal lookup table when comparing objects for equality. If a name occurs more than once, the last value is used and earlier values are ignored, matching the semantics of JsonPathNavigator<TValue>.TryGetPropertyValue.
IsPure
JsonPathNavigator`1.csMethods
| Name | Description |
|---|---|
| CopyElements(TValue?, TValue?[]) | Copies the elements of an array, in index order, to the start of destination. |
| GetArrayLength(TValue?) | Gets an array length. |
| GetKind(TValue?) | Gets the JSON node kind represented by value. |
| GetProperties(TValue?) | Gets object properties in enumeration order. |
| TryGetBoolean(TValue?, bool) | Gets a boolean scalar value. |
| TryGetElement(TValue?, int, TValue?) | Gets an array element by zero-based index. |
| TryGetNumber(TValue?, double) | Gets a number scalar value. |
| TryGetPropertyValue(TValue?, string, TValue?) | Gets an object property value. |
| TryGetString(TValue?, string?) | Gets a string scalar value. |
CopyElements(TValue?, TValue?[])
JsonPathNavigator`1.csCopies the elements of an array, in index order, to the start of destination.
public virtual void CopyElements(TValue? value, TValue?[] destination)Parameters
valueTValue?- The array value.
destinationTValue?[]- A buffer holding at least
JsonPathNavigator<TValue>.GetArrayLengthitems.
Remarks
Implementations must write the first JsonPathNavigator<TValue>.GetArrayLength items in index order. If an element cannot be retrieved, write default at its index.
GetArrayLength(TValue?)
GetKind(TValue?)
Gets the JSON node kind represented by value.
public abstract JsonPathNodeKind GetKind(TValue? value)Parameters
valueTValue?- The value to inspect. Navigators may use
nullor a model-specific value to represent JSONnull.
Returns
JsonPathNodeKind The JSON node kind represented by value.
GetProperties(TValue?)
Gets object properties in enumeration order.
public abstract IEnumerable<JsonPathProperty<TValue>> GetProperties(TValue? value)Parameters
valueTValue?- The object value.
Returns
IEnumerable<JsonPathProperty<TValue>> The object properties in enumeration order.
TryGetBoolean(TValue?, bool)
TryGetElement(TValue?, int, TValue?)
Gets an array element by zero-based index.
TryGetNumber(TValue?, double)
TryGetPropertyValue(TValue?, string, TValue?)
Gets an object property value.