ujson
package ujson
- Alphabetic
- By Inheritance
- ujson
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- case class Arr(value: ArrayBuffer[Value]) extends Value with Product with Serializable
- trait AstTransformer[I] extends Transformer[I] with JsVisitor[I, I]
- class BaseByteRenderer[T <: Output] extends JsVisitor[T, T]
- class BaseCharRenderer[T <: Output] extends JsVisitor[T, T]
- sealed abstract class Bool extends Value
- final class ByteArrayParser[J] extends ByteParser[J]
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.
- final class ByteBufferParser[J] extends ByteParser[J]
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.
- abstract class ByteParser[J] extends BufferingByteParser
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.
- case class BytesRenderer(indent: Int = -1, escapeUnicode: Boolean = false) extends BaseByteRenderer[ByteArrayOutputStream] with Product with Serializable
- abstract class CharParser[J] extends BufferingCharParser
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.
- case class IncompleteParseException(msg: String) extends Exception with ParsingFailedException with Product with Serializable
- sealed trait IndexedValue extends AnyRef
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
- final class InputStreamParser[J] extends ByteParser[J] with BufferingInputStreamParser
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
- trait JsVisitor[-T, +J] extends Visitor[T, J]
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.
- case class Num(value: Double) extends Value with Product with Serializable
- case class Obj(value: LinkedHashMap[String, Value]) extends Value with Product with Serializable
- case class ParseException(clue: String, index: Int) extends Exception with ParsingFailedException with Product with Serializable
- sealed trait ParsingFailedException extends Exception
- trait Readable extends AnyRef
- trait ReadableLowPri extends AnyRef
- case class Renderer(out: Writer, indent: Int = -1, escapeUnicode: Boolean = false) extends BaseCharRenderer[Writer] with Product with Serializable
- case class Str(value: String) extends Value with Product with Serializable
- case class StringRenderer(indent: Int = -1, escapeUnicode: Boolean = false) extends BaseCharRenderer[StringWriter] with Product with Serializable
- trait Transformer[I] extends AnyRef
- sealed trait Value extends Readable with Writable
Value Members
- def copy(t: ujson.Value.Value): ujson.Value.Value
- def read(s: Readable, trace: Boolean = false): ujson.Value.Value
Read the given JSON input as a JSON struct
- def reformat(s: Readable, indent: Int = -1, escapeUnicode: Boolean = false): String
Parse the given JSON input and write it to a string with the configured formatting
- def reformatTo(s: Readable, out: Writer, indent: Int = -1, escapeUnicode: Boolean = false): Unit
Parse the given JSON input and write it to a string with the configured formatting to the given Writer
- def reformatToByteArray(s: Readable, indent: Int = -1, escapeUnicode: Boolean = false): Array[Byte]
- def reformatToOutputStream(s: Readable, out: OutputStream, indent: Int = -1, escapeUnicode: Boolean = false): Unit
Parse the given JSON input and write it to a string with the configured formatting to the given Writer
- def transform[T](t: Readable, v: Visitor[_, T]): T
- def validate(s: Readable): Unit
Parse the given JSON input, failing if it is invalid
- def write(t: ujson.Value.Value, indent: Int = -1, escapeUnicode: Boolean = false): String
Write the given JSON struct as a JSON String
- def writeTo(t: ujson.Value.Value, out: Writer, indent: Int = -1, escapeUnicode: Boolean = false): Unit
Write the given JSON struct as a JSON String to the given Writer
- def writeToByteArray(t: ujson.Value.Value, indent: Int = -1, escapeUnicode: Boolean = false): Array[Byte]
- def writeToOutputStream(t: ujson.Value.Value, out: OutputStream, indent: Int = -1, escapeUnicode: Boolean = false): Unit
- object Arr extends Serializable
- object Bool
- object ByteArrayParser extends Transformer[Array[Byte]]
- object ByteBufferParser extends Transformer[ByteBuffer]
- object CharSequenceParser extends Transformer[CharSequence]
- case object False extends Bool with Product with Serializable
- object IndexedValue extends Transformer[IndexedValue]
- object InputStreamParser extends Transformer[InputStream]
- case object Null extends Value with Product with Serializable
- object Obj extends Serializable
- object Readable extends ReadableLowPri
- object StringParser extends Transformer[String]
- case object True extends Bool with Product with Serializable
- object Value extends AstTransformer[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.
- object WebJson extends Transformer[Any]