JsonPathFunction Class

Defines a custom filter function that works with any JSONPath navigator.

public abstract class JsonPathFunction

Remarks

Implementations must be thread-safe and should be pure. Exceptions propagate to the caller. Callbacks are not cached; their invocation count is not guaranteed. Do not mutate input nodes.

Constructors

NameDescription
JsonPathFunction(string, JsonPathFunctionType, JsonPathFunctionType[])Initializes a function with an immutable RFC 9535 signature.

JsonPathFunction(string, JsonPathFunctionType, JsonPathFunctionType[])

JsonPathFunction.cs

Initializes a function with an immutable RFC 9535 signature.

protected JsonPathFunction(string name, JsonPathFunctionType resultType, params JsonPathFunctionType[] parameterTypes)

Parameters

name string
resultType JsonPathFunctionType
parameterTypes JsonPathFunctionType[]

Properties

NameDescription
NameGets the function name.
ParameterTypesGets the immutable parameter types.
ResultTypeGets the result type.

Gets the function name.

public string Name { get; }

Property value

string

ParameterTypes

JsonPathFunction.cs

Gets the immutable parameter types.

public IReadOnlyList<JsonPathFunctionType> ParameterTypes { get; }

Gets the result type.

public JsonPathFunctionType ResultType { get; }

Property value

JsonPathFunctionType

Methods

NameDescription
Invoke<TValue>(IReadOnlyList<JsonPathFunctionArgument<TValue>>, JsonPathNavigator<TValue>)Invokes the function with arguments converted according to its declared signature.

Invoke<TValue>(IReadOnlyList<JsonPathFunctionArgument<TValue>>, JsonPathNavigator<TValue>)

Invokes the function with arguments converted according to its declared signature.

public abstract JsonPathFunctionArgument<TValue> Invoke<TValue>(IReadOnlyList<JsonPathFunctionArgument<TValue>> arguments, JsonPathNavigator<TValue> navigator)

Type parameters

TValue

Parameters

arguments IReadOnlyList<JsonPathFunctionArgument<TValue>>
navigator JsonPathNavigator<TValue>

Returns

JsonPathFunctionArgument<TValue>

Remarks

Return a result of JsonPathFunction.ResultType. Nodes retain their original object model and lifetime.