ujson

package ujson

Members list

Type members

Classlikes

case class Arr(value: ArrayBuffer[Value]) extends Value

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Value
trait Writable
trait Readable
class Object
trait Matchable
class Any
Show all
object Arr

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Arr.type
trait AstTransformer[I] extends Transformer[I], JsVisitor[I, I]

Attributes

Supertypes
trait JsVisitor[I, I]
trait Visitor[I, I]
trait Transformer[I]
trait Transformer[I]
class Object
trait Matchable
class Any
Show all
Known subtypes
object Value.type
class BaseByteRenderer[T <: Output](out: T, indent: Int, escapeUnicode: Boolean) extends JsVisitor[T, T]

A specialized JSON renderer that can render Bytes (Chars or Bytes) directly to a java.io.Writer or java.io.OutputStream

A specialized JSON renderer that can render Bytes (Chars or Bytes) directly to a java.io.Writer or java.io.OutputStream

Note that we use an internal ByteBuilder to buffer the output internally before sending it to out in batches. This lets us benefit from the high performance and minimal overhead of ByteBuilder in the fast path of pushing characters, and avoid the synchronization/polymorphism overhead of out on the fast path. Most outs would also have performance benefits from receiving data in batches, rather than byte by byte.

Attributes

Companion
object
Supertypes
trait JsVisitor[T, T]
trait Visitor[T, T]
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class BaseCharRenderer[T <: Output](out: T, indent: Int, escapeUnicode: Boolean) extends JsVisitor[T, T]

A specialized JSON renderer that can render Chars (Chars or Bytes) directly to a java.io.Writer or java.io.OutputStream

A specialized JSON renderer that can render Chars (Chars or Bytes) directly to a java.io.Writer or java.io.OutputStream

Note that we use an internal CharBuilder to buffer the output internally before sending it to out in batches. This lets us benefit from the high performance and minimal overhead of CharBuilder in the fast path of pushing characters, and avoid the synchronization/polymorphism overhead of out on the fast path. Most outs would also have performance benefits from receiving data in batches, rather than char by char.

Attributes

Companion
object
Supertypes
trait JsVisitor[T, T]
trait Visitor[T, T]
class Object
trait Matchable
class Any
Known subtypes
class Renderer

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
sealed abstract class Bool extends Value

Attributes

Companion
object
Supertypes
trait Value
trait Writable
trait Readable
class Object
trait Matchable
class Any
Show all
Known subtypes
object False.type
object True.type
object Bool

Attributes

Companion
class
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Bool.type
final class ByteArrayParser[J](src: Array[Byte]) 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.

Attributes

Companion
object
Supertypes
class ByteParser[J]
trait BufferingByteParser
class Object
trait Matchable
class Any
object ByteArrayParser extends Transformer[Array[Byte]]

Attributes

Companion
class
Supertypes
trait Transformer[Array[Byte]]
trait Transformer[Array[Byte]]
class Object
trait Matchable
class Any
Self type
final class ByteBufferParser[J](src: ByteBuffer) 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.

Attributes

Companion
object
Supertypes
class ByteParser[J]
trait BufferingByteParser
class Object
trait Matchable
class Any
object ByteBufferParser extends Transformer[ByteBuffer]

Attributes

Companion
class
Supertypes
trait Transformer[ByteBuffer]
trait Transformer[ByteBuffer]
class Object
trait Matchable
class Any
Self type
abstract class ByteParser[J] extends BufferingByteParser

A specialized JSON parse that can parse Bytes (Chars or Bytes), sending method calls to the given upickle.core.Visitor.

A specialized JSON parse that can parse Bytes (Chars or Bytes), sending method calls to the given upickle.core.Visitor.

Generally has a lot of tricks for performance: e.g. having duplicate implementations for nested v.s. top-level parsing, using an ByteBuilder to construct the CharSequences that visitString requires, etc.

Attributes

Supertypes
trait BufferingByteParser
class Object
trait Matchable
class Any
Known subtypes
case class BytesRenderer(indent: Int, escapeUnicode: Boolean) extends BaseByteRenderer[ByteArrayOutputStream]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class BaseByteRenderer[ByteArrayOutputStream]
trait JsVisitor[ByteArrayOutputStream, ByteArrayOutputStream]
trait Visitor[ByteArrayOutputStream, ByteArrayOutputStream]
class Object
trait Matchable
class Any
Show all
abstract class CharParser[J] extends BufferingCharParser

A specialized JSON parse that can parse Chars (Chars or Bytes), sending method calls to the given upickle.core.Visitor.

A specialized JSON parse that can parse Chars (Chars or Bytes), sending method calls to the given upickle.core.Visitor.

Generally has a lot of tricks for performance: e.g. having duplicate implementations for nested v.s. top-level parsing, using an CharBuilder to construct the CharSequences that visitString requires, etc.

Attributes

Supertypes
trait BufferingCharParser
class Object
trait Matchable
class Any
object CharSequenceParser extends Transformer[CharSequence]

Attributes

Supertypes
trait Transformer[CharSequence]
trait Transformer[CharSequence]
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case object False extends Bool

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Bool
trait Value
trait Writable
trait Readable
class Object
trait Matchable
class Any
Show all
Self type
False.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class IncompleteParseException(msg: String) extends Exception, ParsingFailedException

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
final class InputStreamParser[J](val inputStream: InputStream, val minBufferStartSize: Int, val maxBufferStartSize: Int) extends ByteParser[J], 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

Attributes

Companion
object
Supertypes
trait BufferingInputStreamParser
class ByteParser[J]
trait BufferingByteParser
class Object
trait Matchable
class Any
Show all
object InputStreamParser extends Transformer[InputStream]

Attributes

Companion
class
Supertypes
trait Transformer[InputStream]
trait Transformer[InputStream]
class Object
trait Matchable
class Any
Self type
trait JsVisitor[-T, +J] extends Visitor[T, J]

A Visitor specialized to work with JSON types. Forwards the not-JSON-related methods to their JSON equivalents.

A Visitor specialized to work with JSON types. Forwards the not-JSON-related methods to their JSON equivalents.

Attributes

Supertypes
trait Visitor[T, J]
class Object
trait Matchable
class Any
Known subtypes
trait AstTransformer[I]
object Value.type
class BaseByteRenderer[T]
class BaseCharRenderer[T]
class Renderer
object Builder.type
Show all
object MathUtilsByte

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object MathUtilsChar

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case object Null extends Value

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Value
trait Writable
trait Readable
class Object
trait Matchable
class Any
Show all
Self type
Null.type
case class Num(value: Double) extends Value

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Value
trait Writable
trait Readable
class Object
trait Matchable
class Any
Show all
case class Obj(value: LinkedHashMap[String, Value]) extends Value

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Value
trait Writable
trait Readable
class Object
trait Matchable
class Any
Show all
object Obj

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Obj.type
case class ParseException(clue: String, index: Int) extends Exception, ParsingFailedException

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
sealed trait ParsingFailedException extends Exception

Attributes

Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
Known subtypes
trait Readable

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class fromTransformer[T]
trait Value
class Arr
class Bool
object False.type
object True.type
object Null.type
class Num
class Obj
class Str
Show all

Attributes

Companion
trait
Supertypes
trait Transformer[Readable]
class Object
trait Matchable
class Any
Show all
Self type
Readable.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Readable.type
case class Renderer(out: Writer, indent: Int, escapeUnicode: Boolean) extends BaseCharRenderer[Writer]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class BaseCharRenderer[Writer]
trait JsVisitor[Writer, Writer]
trait Visitor[Writer, Writer]
class Object
trait Matchable
class Any
Show all
case class Str(value: String) extends Value

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Value
trait Writable
trait Readable
class Object
trait Matchable
class Any
Show all
object StringParser extends Transformer[String]

Attributes

Supertypes
trait Transformer[String]
trait Transformer[String]
class Object
trait Matchable
class Any
Self type
case class StringRenderer(indent: Int, escapeUnicode: Boolean) extends BaseCharRenderer[StringWriter]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class BaseCharRenderer[StringWriter]
trait JsVisitor[StringWriter, StringWriter]
trait Visitor[StringWriter, StringWriter]
class Object
trait Matchable
class Any
Show all
trait Transformer[I] extends Transformer[I]

Attributes

Supertypes
trait Transformer[I]
class Object
trait Matchable
class Any
Known subtypes
trait AstTransformer[I]
object Value.type
object ByteArrayParser.type
object ByteBufferParser.type
object CharSequenceParser.type
object IndexedValue.type
object InputStreamParser.type
object Readable.type
object StringParser.type
Show all
case object True extends Bool

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Bool
trait Value
trait Writable
trait Readable
class Object
trait Matchable
class Any
Show all
Self type
True.type
sealed trait Value extends Readable, Writable

Attributes

Companion
object
Supertypes
trait Writable
trait Readable
class Object
trait Matchable
class Any
Known subtypes
class Arr
class Bool
object False.type
object True.type
object Null.type
class Num
class Obj
class Str
Show all
object Value extends AstTransformer[Value]

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.

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.

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
trait Visitor[Value, Value]
trait Transformer[Value]
class Object
trait Matchable
class Any
Show all
Self type
Value.type

Deprecated classlikes

sealed trait IndexedValue

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

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

Attributes

Companion
object
Deprecated
true
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Arr
class False
class Null
class Num
class NumRaw
class Obj
class Str
class True
Show all

Attributes

Companion
trait
Deprecated
true
Supertypes
trait Sum
trait Mirror
trait Transformer[IndexedValue]
class Object
trait Matchable
class Any
Show all
Self type

Deprecated types

type Js = Value

Attributes

Deprecated
true

Value members

Concrete methods

def copy(t: Value): Value
def read(s: Readable, trace: Boolean): Value

Read the given JSON input as a JSON struct

Read the given JSON input as a JSON struct

Attributes

def reformat(s: Readable, indent: Int, escapeUnicode: Boolean, sortKeys: Boolean): String

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

Attributes

def reformat(s: Readable, indent: Int, escapeUnicode: Boolean): String
def reformatTo(s: Readable, out: Writer, indent: Int, escapeUnicode: Boolean, sortKeys: Boolean): Unit

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

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

Attributes

def reformatTo(s: Readable, out: Writer, indent: Int, escapeUnicode: Boolean): Unit
def reformatToByteArray(s: Readable, indent: Int, escapeUnicode: Boolean, sortKeys: Boolean): Array[Byte]
def reformatToByteArray(s: Readable, indent: Int, escapeUnicode: Boolean): Array[Byte]
def reformatToOutputStream(s: Readable, out: OutputStream, indent: Int, escapeUnicode: Boolean, sortKeys: Boolean): Unit

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

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

Attributes

def reformatToOutputStream(s: Readable, out: OutputStream, indent: Int, escapeUnicode: Boolean): Unit
def transform[T](t: Readable, v: Visitor[_, T], sortKeys: Boolean): T
def transform[T](t: Readable, v: Visitor[_, T]): T
def validate(s: Readable): Unit

Parse the given JSON input, failing if it is invalid

Parse the given JSON input, failing if it is invalid

Attributes

def write(t: Value, indent: Int, escapeUnicode: Boolean, sortKeys: Boolean): String

Write the given JSON struct as a JSON String

Write the given JSON struct as a JSON String

Attributes

def write(t: Value, indent: Int, escapeUnicode: Boolean): String
def writeTo(t: Value, out: Writer, indent: Int, escapeUnicode: Boolean, sortKeys: Boolean): Unit

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

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

Attributes

def writeTo(t: Value, out: Writer, indent: Int, escapeUnicode: Boolean): Unit
def writeToByteArray(t: Value, indent: Int, escapeUnicode: Boolean, sortKeys: Boolean): Array[Byte]
def writeToByteArray(t: Value, indent: Int, escapeUnicode: Boolean): Array[Byte]
def writeToOutputStream(t: Value, out: OutputStream, indent: Int, escapeUnicode: Boolean, sortKeys: Boolean): Unit
def writeToOutputStream(t: Value, out: OutputStream, indent: Int, escapeUnicode: Boolean): Unit

Deprecated fields

val Js: Value.type

Attributes

Deprecated
true