object KryoJsonSerialization extends LazyLogging
Serializes into bson (http://bsonspec.org/). Note this is a limited form of bson that only matches the existing json types - does not cover the bson extensions like binary data, etc. Also note endianness, etc might not match the spec 100%.
Reduced BSON spec - only native JSON elements supported:
byte 1 byte (8-bits) int32 4 bytes (32-bit signed integer, two's complement) int64 8 bytes (64-bit signed integer, two's complement) double 8 bytes (64-bit IEEE 754-2008 binary floating point)
document ::= int32 e_list "\x00" BSON Document. int32 is the total number of bytes comprising the document. e_list ::= element e_list | "" element ::= "\x01" e_name double 64-bit binary floating point | "\x02" e_name string UTF-8 string | "\x03" e_name document Embedded document | "\x04" e_name document Array | "\x08" e_name "\x00" Boolean "false" | "\x08" e_name "\x01" Boolean "true" | "\x09" e_name int64 UTC datetime | "\x0A" e_name Null value | "\x10" e_name int32 32-bit integer | "\x11" e_name int64 Timestamp | "\x12" e_name int64 64-bit integer e_name ::= cstring Key name string ::= int32 (byte*) "\x00" String - The int32 is the number bytes in the (byte*) + 1 (for the trailing '\x00'). The (byte*) is zero or more UTF-8 encoded characters. cstring ::= (byte*) "\x00" Zero or more modified UTF-8 encoded characters followed by '\x00'. The (byte*) MUST NOT contain '\x00', hence it is not full UTF-8.
Note: Array - The document for an array is a normal BSON document with integer values for the keys, starting with 0 and continuing sequentially. For example, the array ['red', 'blue'] would be encoded as the document {'0': 'red', '1': 'blue'}. The keys must be in ascending numerical order.
- Alphabetic
- By Inheritance
- KryoJsonSerialization
- LazyLogging
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
deserialize(in: Input, path: Seq[PathElement]): Any
Deserialize the result of a json-path.
Deserialize the result of a json-path. The input should be pointing to the start of the bytes written by
serialize. There is no guarantee where the input will be pointing after completion.If the path selects leaf elements, they will be returned as primitives. If the path selects objects, they will be returned as json strings. If more than one item is selected, they will be returned in a Seq. If nothing is selected, it will return null.
- in
input, pointing to the start of the json object
- path
json path to evaluate
- returns
result of the path, if any
-
def
deserialize(in: Input): JObject
Deserialize the given input.
Deserialize the given input. The input should be pointing to the start of the bytes written by
serialize. Upon completion, the input will be pointing to the first byte after the bytes written byserialize.- in
input, pointing to the start of the json object
- returns
parsed json object
-
def
deserializeAndRender(in: Input): String
Deserialize the given input.
Deserialize the given input. The input should be pointing to the start of the bytes written by
serialize. Upon completion, the input will be pointing to the first byte after the bytes written byserialize.- in
input, pointing to the start of the json object
- returns
json as a string
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
lazy val
logger: Logger
- Attributes
- protected
- Definition Classes
- LazyLogging
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
serialize(out: Output, json: JObject): Unit
Serialize a json object
Serialize a json object
- out
output to write to
- json
object to serialize
-
def
serialize(out: Output, json: String): Unit
Serialize a json object
Serialize a json object
- out
output to write to
- json
json string to serialize - must be a json object
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()