package json
- Alphabetic
- Public
- Protected
Type Members
- trait ByteBasedParser[J] extends Parser[J]
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.
- class CustomJsonObjectParser extends AnyRef
Framing parser that given any number of org.apache.pekko.util.ByteString chunks return one org.apache.pekko.util.ByteStrings for each complete JSON object in the first array property named "propertyName".
Framing parser that given any number of org.apache.pekko.util.ByteString chunks return one org.apache.pekko.util.ByteStrings for each complete JSON object in the first array property named "propertyName". The initial property scan discards everything until the "propertyName" is found, and once the "propertyName is found, it starts returning the JSON objects in the array. Whitespace leading, between, and trailing the elements will be trimmed.
- trait FContext[J] extends RawFContext[J]
FContext is used to construct nested JSON values.
FContext is used to construct nested JSON values.
The most common cases are to build objects and arrays. However, this type is also used to build a single top-level JSON element, in cases where the entire JSON document consists of "333.33".
- trait Facade[J] extends RawFacade[J]
Facade is a type class that describes how Jawn should construct JSON AST elements of type J.
Facade is a type class that describes how Jawn should construct JSON AST elements of type J.
Facade[J] also uses FContext[J] instances, so implementors will usually want to define both.
- case class IncompleteParseException(msg: String) extends Exception with Product with Serializable
- case class ParseException(msg: String, index: Int, line: Int, col: Int) extends Exception with Product with Serializable
- abstract class Parser[J] extends AnyRef
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.
- trait RawFContext[J] extends AnyRef
FContext is used to construct nested JSON values.
FContext is used to construct nested JSON values.
The most common cases are to build objects and arrays. However, this type is also used to build a single top-level JSON element, in cases where the entire JSON document consists of "333.33".
- trait RawFacade[J] extends AnyRef
Facade is a type class that describes how Jawn should construct JSON AST elements of type J.
Facade is a type class that describes how Jawn should construct JSON AST elements of type J.
Facade[J] also uses FContext[J] instances, so implementors will usually want to define both.
Value Members
- object CustomJsonFraming
Provides JSON framing Pekko operator that can separate valid JSON objects from incoming org.apache.pekko.util.ByteString objects.
- object CustomJsonObjectParser
Customized JSON object parser