Package

ujson

Permalink

package ujson

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ujson
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class Arr(value: ArrayBuffer[Value]) extends Value with Product with Serializable

    Permalink
  2. trait AstTransformer[I] extends Transformer[I] with JsVisitor[I, I]

    Permalink
  3. final class AsyncParser[J] extends Parser[J] with ByteBasedParser[J]

    Permalink

    AsyncParser is able to parse chunks of data (encoded as Option[ByteBuffer] instances) and parse asynchronously.

    AsyncParser is able to parse chunks of data (encoded as Option[ByteBuffer] instances) and parse asynchronously. You can use the factory methods in the companion object to instantiate an async parser.

    The async parser's fields are described below:

    The (state, curr, stack) triple is used to save and restore parser state between async calls. State also helps encode extra information when streaming or unwrapping an array.

    The (data, len, allocated) triple is used to manage the underlying data the parser is keeping track of. As new data comes in, data may be expanded if not enough space is available.

    The offset parameter is used to drive the outer async parsing. It stores similar information to curr but is kept separate to avoid "corrupting" our snapshot.

    The done parameter is used internally to help figure out when the atEof() parser method should return true. This will be set when apply(None) is called.

    The streamMode parameter controls how the asynchronous parser will be handling multiple values. There are three states:

    1: An array is being unwrapped. Normal JSON array rules apply (Note that if the outer value observed is not an array, this mode will toggle to the -1 mode).

    0: A stream of individual JSON elements separated by whitespace are being parsed. We can return each complete element as we parse it.

    -1: No streaming is occuring. Only a single JSON value is allowed.

  4. class BaseRenderer[T <: Writer] extends JsVisitor[T, T]

    Permalink
  5. sealed abstract class Bool extends Value

    Permalink
  6. final class ByteArrayParser[J] extends SyncParser[J] with ByteBasedParser[J]

    Permalink

    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.

  7. trait ByteBasedParser[J] extends Parser[J]

    Permalink

    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.

  8. final class ByteBufferParser[J] extends SyncParser[J] with ByteBasedParser[J]

    Permalink

    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.

  9. case class BytesRenderer(indent: Int = 1) extends BaseRenderer[BytesWriter] with Product with Serializable

    Permalink
  10. final class ChannelParser[J] extends SyncParser[J] with ByteBasedParser[J]

    Permalink

    Basic file parser.

    Basic file parser.

    Given a file name this parser opens it, chunks the data, and parses it.

  11. trait CharBasedParser[J] extends Parser[J]

    Permalink

    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.

  12. case class IncompleteParseException(msg: String, cause: Throwable) extends Exception with ParsingFailedException with Product with Serializable

    Permalink
  13. sealed trait IndexedValue extends AnyRef

    Permalink

    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

  14. trait JsVisitor[-T, +J] extends Visitor[T, J]

    Permalink

    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.

  15. case class Num(value: Double) extends Value with Product with Serializable

    Permalink
  16. case class Obj(value: LinkedHashMap[String, Value]) extends Value with Product with Serializable

    Permalink
  17. case class ParseException(clue: String, index: Int, line: Int, col: Int) extends Exception with ParsingFailedException with Product with Serializable

    Permalink
  18. abstract class Parser[J] extends AnyRef

    Permalink

    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.

  19. sealed trait ParsingFailedException extends Exception

    Permalink
  20. trait Readable extends AnyRef

    Permalink
  21. case class Renderer(out: Writer, indent: Int = 1, escapeUnicode: Boolean = false) extends BaseRenderer[Writer] with Product with Serializable

    Permalink
  22. case class Str(value: String) extends Value with Product with Serializable

    Permalink
  23. case class StringRenderer(indent: Int = 1, escapeUnicode: Boolean = false) extends BaseRenderer[StringWriter] with Product with Serializable

    Permalink
  24. abstract class SyncParser[J] extends Parser[J]

    Permalink

    SyncParser extends Parser to do all parsing synchronously.

    SyncParser extends Parser to do all parsing synchronously.

    Most traditional JSON parser are synchronous, and expect to receive all their input before returning. SyncParser[J] still leaves Parser[J]'s methods abstract, but adds a public methods for users to call to actually parse JSON.

  25. trait Transformer[I] extends AnyRef

    Permalink
  26. sealed trait Value extends Readable

    Permalink
  27. type Js = Value

    Permalink
    Annotations
    @deprecated
    Deprecated

    use ujson.Value

Value Members

  1. object Arr extends Serializable

    Permalink
  2. object AsyncParser

    Permalink
  3. object Bool

    Permalink
  4. object ByteArrayParser extends Transformer[Array[Byte]]

    Permalink
  5. object ByteBufferParser extends Transformer[ByteBuffer]

    Permalink
  6. object BytesRenderer extends Serializable

    Permalink
  7. object ChannelParser extends Transformer[ReadableByteChannel]

    Permalink
  8. object CharSequenceParser extends Transformer[CharSequence]

    Permalink
  9. object False extends Bool with Product with Serializable

    Permalink
  10. object FileParser extends Transformer[File]

    Permalink
  11. object IndexedValue extends Transformer[IndexedValue]

    Permalink
  12. object Null extends Value with Product with Serializable

    Permalink
  13. object Obj extends Serializable

    Permalink
  14. object PathParser extends Transformer[Path]

    Permalink
  15. object Platform

    Permalink
  16. object Readable

    Permalink
  17. object Renderer extends Serializable

    Permalink
  18. object StringParser extends Transformer[String]

    Permalink
  19. object True extends Bool with Product with Serializable

    Permalink
  20. object Value extends AstTransformer[Value]

    Permalink

    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.

  21. object WebJson extends Transformer[Any]

    Permalink
  22. def copy(t: ujson.Value.Value): ujson.Value.Value

    Permalink
  23. def read(s: Readable): ujson.Value.Value

    Permalink

    Read the given JSON input as a JSON struct

  24. def reformat(s: Readable, indent: Int = 1, escapeUnicode: Boolean = false): String

    Permalink

    Parse the given JSON input and write it to a string with the configured formatting

  25. def reformatTo(s: Readable, out: Writer, indent: Int = 1, escapeUnicode: Boolean = false): Unit

    Permalink

    Parse the given JSON input and write it to a string with the configured formatting to the given Writer

  26. def transform[T](t: Readable, v: Visitor[_, T]): T

    Permalink
  27. def validate(s: Readable): Unit

    Permalink

    Parse the given JSON input, failing if it is invalid

  28. def write(t: ujson.Value.Value, indent: Int = 1, escapeUnicode: Boolean = false): String

    Permalink

    Write the given JSON struct as a JSON String

  29. def writeTo(t: ujson.Value.Value, out: Writer, indent: Int = 1, escapeUnicode: Boolean = false): Unit

    Permalink

    Write the given JSON struct as a JSON String to the given Writer

Deprecated Value Members

  1. val Js: Value.type

    Permalink
    Annotations
    @deprecated
    Deprecated

    use ujson.Value

Inherited from AnyRef

Inherited from Any

Ungrouped