Class JsonParser

java.lang.Object
io.karatelabs.js.JsonParser

public final class JsonParser extends Object
Strict RFC 8259 / ECMA-404 JSON parser. Public entry: parse(String). Returns Map/List/String/Integer/Long/ BigInteger/Double/Boolean/null. Throws JsErrorException (SyntaxError shape) on invalid input.

Numeric narrowing: integer values in int range → Integer; integer values fitting in long → Long; larger integers → BigInteger; any literal with a fractional part or exponent → Double. See JsonParserTest for the pinned contract.

Designed to be allocated per call (JsonParser.ParseState is a private, non-static inner class); the parse entry point is thread-safe by construction — no shared mutable state.

  • Method Details