Class RecordAdapter

java.lang.Object
org.apache.juneau.marshall.stream.RecordAdapter

public final class RecordAdapter extends Object
Static factories that produce buffered RecordReader / RecordWriter instances for formats whose token-stream surface is whole-value-only (no native TokenReader / TokenWriter).

The cursors are created from the live session (ParserSession / SerializerSession), so they honor the same per-invocation configuration (swaps, bean filters, locale/timezone, schema) as parse(...)/serialize(...).

Reduces per-format override boilerplate to a one-liner on the session class:

@Override public RecordReader readRecords(Object input) throws IOException { return RecordAdapter.reader(this, input); } @Override public RecordWriter writeRecords(Object output) throws IOException { return RecordAdapter.writer(this, output); }

All four cursors report isStreaming() == false (they buffer) and obey one resource-ownership rule: close() closes the input/output it was handed when it is Closeable. Multi-rooted formats that need different semantics (jsonl, csv, sse) implement their own cursor.