Interface ArrayRecordReadable
- All Known Implementing Classes:
BsonParser,BsonParser.Base64,BsonParser.SpacedHex,BsonParserSession,CborParser,CborParser.Base64,CborParser.SpacedHex,CborParserSession,HtmlParser,HtmlParserSession,Json5lParser,Json5lParserSession,Json5Parser,Json5ParserSession,JsonlParser,JsonlParserSession,JsonParser,JsonParserSession,MsgPackParser,MsgPackParser.Base64,MsgPackParser.SpacedHex,MsgPackParserSession,ParquetParser,ParquetParserSession,XmlParser,XmlParserSession,YamlParser,YamlParserSession
public interface ArrayRecordReadable
Capability role for parsers that can stream the elements of a top-level wire array, yielding
each element as a separate record.
Implemented by formats with a meaningful "stream the elements of a top-level array" semantic
(json, json5, cbor, msgpack — true element streaming; yaml, parquet, bson, xml, html
— buffered via RecordAdapter.arrayReader(org.apache.juneau.marshall.parser.ParserSession, java.lang.Object)). Capability is detected via
instanceof.
See Also:
ArrayRecordWritable— the symmetric writer role.- Serializers and Parsers
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanStreaming-quality signal queryable before opening a cursor.readArrayRecords(Object input) Opens aRecordReaderthat yields each element of a top-level wire array as a separate record.default RecordReaderreadArrayRecords(Object input, String rootElementName) Variant ofreadArrayRecords(Object)that accepts a caller-specified root element name.
-
Method Details
-
readArrayRecords
Opens aRecordReaderthat yields each element of a top-level wire array as a separate record.- Parameters:
input- The input.- Returns:
- A new element-streamed
RecordReader. - Throws:
IOException- If a problem occurred reading the underlying input.
-
readArrayRecords
Variant ofreadArrayRecords(Object)that accepts a caller-specified root element name. Used by HTML/XML when the wire format is e.g.<items><item>...and the caller needs to declare which child element is the array element.The default ignores the root name and delegates to
readArrayRecords(Object).- Parameters:
input- The input.rootElementName- The element name whose children are array elements. May benull for auto-detection.- Returns:
- A new element-streamed
RecordReader. - Throws:
IOException- If a problem occurred reading the underlying input.
-
isArrayRecordStreaming
Streaming-quality signal queryable before opening a cursor.- Returns:
true for true element streaming (json/cbor/msgpack);false for the bufferedRecordAdapter.arrayReader(org.apache.juneau.marshall.parser.ParserSession, java.lang.Object)-backed formats (xml, html, yaml, parquet, bson).
-