decodeToSequence

inline fun <T> decodeToSequence(reader: XmlReader, wrapperName: QName?, elementName: QName? = null): Sequence<T>(source)

Decode the sequence of elements of type T incrementally. The elements are required to not be primitives (that encode to/parse from text).

There are two modes: a sequence of elements, and as a wrapped collection.

Wrapped collections function as expected, and read first the wrapper element, then the elements.

For sequence of elements, parsing will either stop on end of the reader, or on an end element. It is the responsbility of the caller to handle (push back) the end of element event where it occurs.

Note that when the element name is not provided, it is detected on the first element. Subsequent elements must have the same name (namespace, localname).

Parameters

reader

The reader used to read from

wrapperName

The name of the wrapping element. Setting this value triggers wrapper mode.

elementName

The name of the element. If null, automatically detected on content.


fun <T> decodeToSequence(deserializer: DeserializationStrategy<T>, reader: XmlReader, wrapperName: QName?, elementName: QName? = null): Sequence<T>(source)

Decode the sequence of elements of type T incrementally. The elements are required to not be primitives (that encode to/parse from text).

There are two modes: a sequence of elements, and as a wrapped collection.

Wrapped collections function as expected, and read first the wrapper element, then the elements.

For sequence of elements, parsing will either stop on end of the reader, or on an end element. It is the responsbility of the caller to handle (push back) the end of element event where it occurs.

Note that when the element name is not provided, it is detected on the first element. Subsequent elements must have the same name (namespace, localname).

Parameters

deserializer

The deserializer to decode the elements.

reader

The reader used to read from

wrapperName

The name of the wrapping element. Setting this value triggers wrapper mode.

elementName

The name of the element. If null, automatically detected on content.