smile.json

package smile.json

Attributes

Members list

Type members

Classlikes

trait CompactPrinter extends JsonPrinter

A JsonPrinter that produces compact JSON source without any superfluous whitespace. Adopt from spray-json.

A JsonPrinter that produces compact JSON source without any superfluous whitespace. Adopt from spray-json.

Attributes

Companion
object
Supertypes
trait JsonPrinter
trait JsValue => String
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
trait
Supertypes
trait JsonPrinter
trait JsValue => String
class Object
trait Matchable
class Any
Show all
Self type
case class JsArray(elements: ArrayBuffer[JsValue]) extends JsValue, Iterable[JsValue]

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Iterable[JsValue]
trait JsValue
trait Dynamic
class Object
trait Matchable
class Any
Show all
object JsArray

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
JsArray.type
case class JsBinary(value: Array[Byte]) extends JsValue

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait JsValue
trait Dynamic
class Object
trait Matchable
class Any
Show all
case class JsBoolean(value: Boolean) extends JsValue, Ordered[JsBoolean]

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Comparable[JsBoolean]
trait JsValue
trait Dynamic
class Object
trait Matchable
class Any
Show all
object JsBoolean

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
JsBoolean.type
case class JsCounter(value: Long) extends JsValue, Ordered[JsCounter]

A counter is a 64 bit integer. The difference from JsLong is mostly for internal representation in database. For encoding reason, the effective number of bits are 56, which should be big enough in practice.

A counter is a 64 bit integer. The difference from JsLong is mostly for internal representation in database. For encoding reason, the effective number of bits are 56, which should be big enough in practice.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Comparable[JsCounter]
trait JsValue
trait Dynamic
class Object
trait Matchable
class Any
Show all
object JsCounter

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
JsCounter.type
case class JsDate(value: Instant) extends JsValue, Ordered[JsDate]

A single moment in time. Date objects encapsulate an integral number that represents milliseconds since the midnight at the beginning of January 1, 1970, UTC (the epoch).

A single moment in time. Date objects encapsulate an integral number that represents milliseconds since the midnight at the beginning of January 1, 1970, UTC (the epoch).

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Ordered[JsDate]
trait Comparable[JsDate]
trait JsValue
trait Dynamic
class Object
trait Matchable
class Any
Show all
object JsDate

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
JsDate.type
case class JsDecimal(value: BigDecimal) extends JsValue, Ordered[JsDecimal]

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Comparable[JsDecimal]
trait JsValue
trait Dynamic
class Object
trait Matchable
class Any
Show all
object JsDecimal

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
JsDecimal.type
case class JsDouble(value: Double) extends JsValue, Ordered[JsDouble]

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Ordered[JsDouble]
trait Comparable[JsDouble]
trait JsValue
trait Dynamic
class Object
trait Matchable
class Any
Show all
object JsDouble

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
JsDouble.type
case class JsInt(value: Int) extends JsValue, Ordered[JsInt]

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Ordered[JsInt]
trait Comparable[JsInt]
trait JsValue
trait Dynamic
class Object
trait Matchable
class Any
Show all
object JsInt

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
JsInt.type
case class JsLocalDate(value: LocalDate) extends JsValue, Ordered[JsLocalDate]

An immutable date without a time-zone in the ISO-8601 calendar system, often viewed as year-month-day such as 2007-12-03.

An immutable date without a time-zone in the ISO-8601 calendar system, often viewed as year-month-day such as 2007-12-03.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Comparable[JsLocalDate]
trait JsValue
trait Dynamic
class Object
trait Matchable
class Any
Show all
object JsLocalDate

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class JsLocalDateTime(value: LocalDateTime) extends JsValue, Ordered[JsLocalDateTime]

An immutable date-time without a time-zone in the ISO-8601 calendar system, such as 2007-12-03T10:15:30. Although LocalTime/JsTime can be represented to nanosecond precision, a JSON serializer may not store the nano-of-second field to save the space. To preserve the high precision of time, JsTimestamp should be employed.

An immutable date-time without a time-zone in the ISO-8601 calendar system, such as 2007-12-03T10:15:30. Although LocalTime/JsTime can be represented to nanosecond precision, a JSON serializer may not store the nano-of-second field to save the space. To preserve the high precision of time, JsTimestamp should be employed.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Comparable[JsLocalDateTime]
trait JsValue
trait Dynamic
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class JsLocalTime(value: LocalTime) extends JsValue, Ordered[JsLocalTime]

An immutable time without a time-zone in the ISO-8601 calendar system, often viewed as hour-minute-second such as 10:15:30. Although LocalTime/JsTime can be represented to nanosecond precision, a JSON serializer may not store the nano-of-second field to save the space. To preserve the high precision of time, JsTimestamp should be employed.

An immutable time without a time-zone in the ISO-8601 calendar system, often viewed as hour-minute-second such as 10:15:30. Although LocalTime/JsTime can be represented to nanosecond precision, a JSON serializer may not store the nano-of-second field to save the space. To preserve the high precision of time, JsTimestamp should be employed.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Comparable[JsLocalTime]
trait JsValue
trait Dynamic
class Object
trait Matchable
class Any
Show all
object JsLocalTime

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class JsLong(value: Long) extends JsValue, Ordered[JsLong]

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Ordered[JsLong]
trait Comparable[JsLong]
trait JsValue
trait Dynamic
class Object
trait Matchable
class Any
Show all
object JsLong

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
JsLong.type
case object JsNull extends JsValue

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait JsValue
trait Dynamic
class Object
trait Matchable
class Any
Show all
Self type
JsNull.type
case class JsObject(fields: SeqMap[String, JsValue]) extends JsValue

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait JsValue
trait Dynamic
class Object
trait Matchable
class Any
Show all
object JsObject

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
JsObject.type
case class JsObjectId(value: ObjectId) extends JsValue

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait JsValue
trait Dynamic
class Object
trait Matchable
class Any
Show all
object JsObjectId

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
JsObjectId.type
case class JsString(value: String) extends JsValue, Ordered[JsString]

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Ordered[JsString]
trait Comparable[JsString]
trait JsValue
trait Dynamic
class Object
trait Matchable
class Any
Show all
object JsString

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
JsString.type
case class JsTimestamp(value: Timestamp) extends JsValue, Ordered[JsTimestamp]

An SQL TIMESTAMP value. It adds the ability to hold the SQL TIMESTAMP fractional seconds value, by allowing the specification of fractional seconds to a precision of nanoseconds. Support the JDBC escape syntax for timestamp values.

An SQL TIMESTAMP value. It adds the ability to hold the SQL TIMESTAMP fractional seconds value, by allowing the specification of fractional seconds to a precision of nanoseconds. Support the JDBC escape syntax for timestamp values.

The precision of a Timestamp object is calculated to be either:

  • 19 , which is the number of characters in yyyy-mm-dd hh:mm:ss
  • 20 + s , which is the number of characters in the yyyy-mm-dd hh:mm:ss.[fff...] and s represents the scale of the given Timestamp, its fractional seconds precision.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Comparable[JsTimestamp]
trait JsValue
trait Dynamic
class Object
trait Matchable
class Any
Show all
object JsTimestamp

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class JsUUID(value: UUID) extends JsValue

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait JsValue
trait Dynamic
class Object
trait Matchable
class Any
Show all
object JsUUID

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
JsUUID.type
case object JsUndefined extends JsValue

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait JsValue
trait Dynamic
class Object
trait Matchable
class Any
Show all
Self type
sealed trait JsValue extends Dynamic

JSON value.

JSON value.

Attributes

Supertypes
trait Dynamic
class Object
trait Matchable
class Any
Known subtypes
class JsArray
class JsBinary
class JsBoolean
class JsCounter
class JsDate
class JsDecimal
class JsDouble
class JsInt
class JsLocalDate
class JsLocalTime
class JsLong
object JsNull
class JsObject
class JsObjectId
class JsString
class JsTimestamp
class JsUUID
object JsUndefined
Show all
object JsValueOrdering extends Ordering[JsValue]

Attributes

Supertypes
trait Ordering[JsValue]
trait Equiv[JsValue]
trait Serializable
trait Comparator[JsValue]
class Object
trait Matchable
class Any
Show all
Self type
final implicit class JsonHelper(sc: StringContext) extends AnyVal

String interpolator for JSON. json''' ''' for JSON Object and jarr''' ''' for JSON Array.

String interpolator for JSON. json''' ''' for JSON Object and jarr''' ''' for JSON Array.

Attributes

Supertypes
class AnyVal
trait Matchable
class Any
object JsonParser

Fast, no-dependency parser for JSON as defined by http://tools.ietf.org/html/rfc4627. Adopt from spray-json.

Fast, no-dependency parser for JSON as defined by http://tools.ietf.org/html/rfc4627. Adopt from spray-json.

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
JsonParser.type
class JsonParser(input: ParserInput)

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
trait JsonPrinter extends JsValue => String

A JsonPrinter serializes a JSON AST to a String. Adopt from spray-json.

A JsonPrinter serializes a JSON AST to a String. Adopt from spray-json.

Attributes

Companion
object
Supertypes
trait JsValue => String
class Object
trait Matchable
class Any
Known subtypes
object JsonPrinter

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
class JsonSerializer(buffer: ByteBuffer) extends LazyLogging

JSON Serializer in BSON format as defined by http://bsonspec.org/spec.html. This is not fully compatible with BSON spec, where the root must be a document/JsObject. In contrast, the root can be any JsValue in our implementation. Correspondingly, the root will always has the type byte as the first byte.

JSON Serializer in BSON format as defined by http://bsonspec.org/spec.html. This is not fully compatible with BSON spec, where the root must be a document/JsObject. In contrast, the root can be any JsValue in our implementation. Correspondingly, the root will always has the type byte as the first byte.

Not Multi-threading safe. Each thread should have its own BsonSerializer instance. Data size limit to 10MB by default.

Although JsTime/JsDateTime can be represented to nanosecond precision, we don't store the nano-of-second field to save the space. To preserve the high precision of time, JsTimestamp should be employed and of course consumes more space.

Attributes

Companion
object
Supertypes
trait LazyLogging
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
case class ObjectId(id: Array[Byte])

BSON's 12-byte ObjectId type, constructed using: a 4-byte value representing the seconds since the Unix epoch, a 3-byte machine identifier, a 2-byte process id, and a 3-byte counter, starting with a random value.

BSON's 12-byte ObjectId type, constructed using: a 4-byte value representing the seconds since the Unix epoch, a 3-byte machine identifier, a 2-byte process id, and a 3-byte counter, starting with a random value.

The implementation is adopt from ReactiveMongo.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ObjectId

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
ObjectId.type
trait ParserInput

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ParserInput

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait PrettyPrinter extends JsonPrinter

A JsonPrinter that produces a nicely readable JSON source. Adopt from spray-json.

A JsonPrinter that produces a nicely readable JSON source. Adopt from spray-json.

Attributes

Companion
object
Supertypes
trait JsonPrinter
trait JsValue => String
class Object
trait Matchable
class Any
Known subtypes
object PrettyPrinter
object PrettyPrinter extends PrettyPrinter

Attributes

Companion
trait
Supertypes
trait JsonPrinter
trait JsValue => String
class Object
trait Matchable
class Any
Show all
Self type

Value members

Concrete fields

Implicits

Implicits

final implicit def JsonHelper(sc: StringContext): JsonHelper

String interpolator for JSON. json''' ''' for JSON Object and jarr''' ''' for JSON Array.

String interpolator for JSON. json''' ''' for JSON Object and jarr''' ''' for JSON Array.

Attributes

implicit def array2JsValue[T <: JsValue](x: Array[T]): JsArray
implicit def bigdecimal2JsValue(x: BigDecimal): JsDecimal
implicit def boolean2JsValue(x: Boolean): JsBoolean
implicit def byteArray2JsValue(x: Array[Byte]): JsBinary
implicit def date2JsValue(x: Date): JsTimestamp
implicit def double2JsValue(x: Double): JsDouble
implicit def instant2JsValue(x: Instant): JsDate
implicit def int2JsValue(x: Int): JsInt
implicit def jsArrayTopLevel(x: JsArray): JsTopLevel
implicit def json2BigDecimal(x: JsDecimal): BigDecimal
implicit def json2Binary(x: JsBinary): Array[Byte]
implicit def json2Boolean(x: JsBoolean): Boolean
implicit def json2Date(x: JsTimestamp): Date
implicit def json2Double(x: JsDouble): Double
implicit def json2Instant(x: JsDate): Instant
implicit def json2Int(x: JsInt): Int
implicit def json2LocalDate(x: JsLocalDate): LocalDate
implicit def json2LocalDateTime(x: JsLocalDateTime): LocalDateTime
implicit def json2LocalTime(x: JsLocalTime): LocalTime
implicit def json2Long(x: JsLong): Long
implicit def json2ObjectId(x: JsObjectId): ObjectId
implicit def json2String(x: JsString): String
implicit def json2Timestamp(x: JsTimestamp): Timestamp
implicit def json2UUID(x: JsUUID): UUID
implicit def localDate2JsValue(x: LocalDate): JsLocalDate
implicit def localDateTime2JsValue(x: LocalDateTime): JsLocalDateTime
implicit def localTime2JsValue(x: LocalTime): JsLocalTime
implicit def long2JsValue(x: Long): JsLong
implicit def map2JsValue[T <: JsValue](x: Seq[(String, T)]): JsObject
implicit def map2JsValue(x: Map[String, JsValue]): JsObject
implicit def map2JsValue[T <: JsValue](x: Map[String, T]): JsObject
implicit def pimpBigDecimalArray(x: Array[BigDecimal]): PimpedBigDecimalSeq
implicit def pimpBigDecimalMap(x: Map[String, BigDecimal]): PimpedBigDecimalMap
implicit def pimpBigDecimalMutableMap(x: Map[String, BigDecimal]): PimpedBigDecimalMutableMap
implicit def pimpBigDecimalSeq(x: Seq[BigDecimal]): PimpedBigDecimalSeq
implicit def pimpBooleanArray(x: Array[Boolean]): PimpedBooleanSeq
implicit def pimpBooleanMap(x: Map[String, Boolean]): PimpedBooleanMap
implicit def pimpBooleanMutableMap(x: Map[String, Boolean]): PimpedBooleanMutableMap
implicit def pimpBooleanSeq(x: Seq[Boolean]): PimpedBooleanSeq
implicit def pimpDateArray(x: Seq[Date]): PimpedDateSeq
implicit def pimpDateArray(x: Array[Date]): PimpedDateSeq
implicit def pimpDateMap(x: Map[String, Date]): PimpedDateMap
implicit def pimpDateMutableMap(x: Map[String, Date]): PimpedDateMutableMap
implicit def pimpDoubleArray(x: Array[Double]): PimpedDoubleSeq
implicit def pimpDoubleMap(x: Map[String, Double]): PimpedDoubleMap
implicit def pimpDoubleMutableMap(x: Map[String, Double]): PimpedDoubleMutableMap
implicit def pimpDoubleSeq(x: Seq[Double]): PimpedDoubleSeq
implicit def pimpIntArray(x: Array[Int]): PimpedIntSeq
implicit def pimpIntMap(x: Map[String, Int]): PimpedIntMap
implicit def pimpIntMutableMap(x: Map[String, Int]): PimpedIntMutableMap
implicit def pimpIntSeq(x: Seq[Int]): PimpedIntSeq
implicit def pimpLocalDateArray(x: Seq[LocalDate]): PimpedLocalDateSeq
implicit def pimpLocalDateArray(x: Array[LocalDate]): PimpedLocalDateSeq
implicit def pimpLocalDateTimeArray(x: Seq[LocalDateTime]): PimpedLocalDateTimeSeq
implicit def pimpLocalDateTimeArray(x: Array[LocalDateTime]): PimpedLocalDateTimeSeq
implicit def pimpLocalTimeArray(x: Seq[LocalTime]): PimpedLocalTimeSeq
implicit def pimpLocalTimeArray(x: Array[LocalTime]): PimpedLocalTimeSeq
implicit def pimpLongArray(x: Array[Long]): PimpedLongSeq
implicit def pimpLongMap(x: Map[String, Long]): PimpedLongMap
implicit def pimpLongMutableMap(x: Map[String, Long]): PimpedLongMutableMap
implicit def pimpLongSeq(x: Seq[Long]): PimpedLongSeq
implicit def pimpString(string: String): PimpedString
implicit def pimpStringArray(x: Array[String]): PimpedStringSeq
implicit def pimpStringMap(x: Map[String, String]): PimpedStringMap
implicit def pimpStringMutableMap(x: Map[String, String]): PimpedStringMutableMap
implicit def pimpStringSeq(x: Seq[String]): PimpedStringSeq
implicit def pimpTimestampArray(x: Seq[Timestamp]): PimpedTimestampSeq
implicit def pimpTimestampArray(x: Array[Timestamp]): PimpedTimestampSeq
implicit def seq2JsValue[T <: JsValue](x: Seq[T]): JsArray
implicit def string2JsValue(x: String): JsString
implicit def timestamp2JsValue(x: Timestamp): JsTimestamp
implicit def uuid2JsValue(x: UUID): JsUUID