Skip to main content

GenericJsonIterator

This class provides a mechanism for iterating over the elements of a JSON array. It maintains a reference to the underlying data and tracks the current traversal position using an internal index.

Attributes

AttributeTypeDescription
arrayJsonArrayThe underlying JSON array structure being traversed during iteration.
indexusizeThe current numerical position within the array used to track progress and retrieve the next element.

Constructor

Signature

def GenericJsonIterator(
array: JsonArray< 'data >,
index: usize
)

Parameters

NameTypeDescription
arrayJsonArray< 'data >The JSON array to iterate over.
indexusizeThe starting index for the iterator.

Signature

def GenericJsonIterator(
array: JsonArray,
index: int = 0
) - > null

Parameters

NameTypeDescription
arrayJsonArrayThe JSON array object containing the data to be iterated over
indexint = 0The starting position within the array for the iteration process

Methods


__next__()

def __next__() - > Any

Retrieves the next element from the JSON array and increments the internal cursor.

Returns

TypeDescription
AnyThe JSON value at the current index, or raises StopIteration if the end of the array is reached

__iter__()

def __iter__() - > [GenericJsonIterator](genericjsoniterator.md?sid=input_return_enums_genericjsoniterator)

Returns the iterator instance itself to support the standard Python iteration protocol.

Returns

TypeDescription
[GenericJsonIterator](genericjsoniterator.md?sid=input_return_enums_genericjsoniterator)The current iterator instance