Class JsonTokenReader

java.lang.Object
org.apache.juneau.marshall.json.JsonTokenReader
All Implemented Interfaces:
Closeable, AutoCloseable, RecordReader, TokenReader
Direct Known Subclasses:
Json5TokenReader, JsonlTokenReader

public class JsonTokenReader extends Object implements TokenReader
Reference implementation of the public TokenReader surface for the JSON format.

Backed by the existing internal ParserReader plumbing. Operates as a hand-rolled state machine over the JSON grammar — structural tokens ({, }, [, ], ,, :) and the four scalar shapes (string, number, boolean, null).

Pipe-level settings (charset, auto-close, unbuffered) are configured on the ParserPipe the caller hands in. Cursor-level behavior is driven by a small JsonTokenReader.Settings bundle — currently just trimStrings.

Notes:
  • This class is not thread safe.
  • Whitespace and JSON comments are tolerated — comments are silently skipped to mirror Juneau's existing JSON parser behavior.
  • The cursor is purely structural; object swaps and @Schema annotations have no effect. Use the POJO databind path on JsonParser for those.