Basic ByteBuffer parser.
Basic ByteBuffer parser.
This assumes that the provided ByteBuffer is ready to be read. The user is responsible for any necessary flipping/resetting of the ByteBuffer before parsing.
The parser makes absolute calls to the ByteBuffer, which will not update its own mutable position fields.
Trait used when the data to be parsed is in UTF-8.
Trait used when the data to be parsed is in UTF-8.
This parser has to translate input bytes to Chars and Strings. It provides a byte() method to access individual bytes, and also parser strings from bytes.
Its parseString() implementation has two cases. In the first case (the hot path) the string has no escape sequences and we can just UTF-8 decode the entire set of bytes. In the second case, it goes to some trouble to be sure to de-escape correctly given that the input data is UTF-8.
Basic ByteBuffer parser.
Basic ByteBuffer parser.
This assumes that the provided ByteBuffer is ready to be read. The user is responsible for any necessary flipping/resetting of the ByteBuffer before parsing.
The parser makes absolute calls to the ByteBuffer, which will not update its own mutable position fields.
Trait used when the data to be parsed is in UTF-16.
Trait used when the data to be parsed is in UTF-16.
This parser provides parseString(). Like ByteBasedParser it has fast/slow paths for string parsing depending on whether any escapes are present.
It is simpler than ByteBasedParser.
A version of ujson.Value that keeps the index positions of the various AST nodes it is constructing.
A version of ujson.Value that keeps the index positions of the various AST nodes it is constructing. Usually not necessary, but sometimes useful if you want to work with an AST but still provide source-index error positions if something goes wrong
Parser that reads in bytes from an InputStream, buffering them in memory
until a reset call discards them.
Parser that reads in bytes from an InputStream, buffering them in memory
until a reset call discards them.
Mostly the same as ByteArrayParser, except using an UberBuffer rather than reading directly from an Array[Byte].
Generally not meant to be used directly, but via ujson.Readable.fromReadable
A Visitor specialized to work with JSON types.
A Visitor specialized to work with JSON types. Forwards the not-JSON-related methods to their JSON equivalents.
Parser implements a state machine for correctly parsing JSON data.
Parser implements a state machine for correctly parsing JSON data.
The trait relies on a small number of methods which are left abstract, and which generalize parsing based on whether the input is in Bytes or Chars, coming from Strings, files, or other input. All methods provided here are protected, so different parsers can choose which functionality to expose.
Parser is parameterized on J, which is the type of the JSON AST it will return. Jawn can produce any AST for which a Facade[J] is available.
The parser trait does not hold any state itself, but particular implementations will usually hold state. Parser instances should not be reused between parsing runs.
For now the parser requires input to be in UTF-8. This requirement may eventually be relaxed.
use ujson.Value
A very small, very simple JSON AST that uPickle uses as part of its serialization process.
A very small, very simple JSON AST that uPickle uses as part of its serialization process. A common standard between the Jawn AST (which we don't use so we don't pull in the bulk of Spire) and the Javascript JSON AST.
Read the given JSON input as a JSON struct
Parse the given JSON input and write it to a string with the configured formatting
Parse the given JSON input and write it to a string with the configured formatting to the given Writer
Parse the given JSON input, failing if it is invalid
Write the given JSON struct as a JSON String
Write the given JSON struct as a JSON String to the given Writer
use ujson.Value