class
PrettyJsonWriter
extends JsonWriter
Instance Constructors
-
new
PrettyJsonWriter
(output: Writer, indentation: Int = 2, leftMargin: Int = 0, targetWidth: Int = 78)
Value Members
-
def
!=
(arg0: AnyRef): Boolean
-
def
!=
(arg0: Any): Boolean
-
def
##
(): Int
-
def
==
(arg0: AnyRef): Boolean
-
def
==
(arg0: Any): Boolean
-
def
asInstanceOf
[T0]
: T0
-
def
clone
(): AnyRef
-
def
eq
(arg0: AnyRef): Boolean
-
def
equals
(arg0: Any): Boolean
-
def
finalize
(): Unit
-
def
getClass
(): java.lang.Class[_]
-
def
hashCode
(): Int
-
def
isInstanceOf
[T0]
: Boolean
-
def
ne
(arg0: AnyRef): Boolean
-
def
notify
(): Unit
-
def
notifyAll
(): Unit
-
def
synchronized
[T0]
(arg0: ⇒ T0): T0
-
def
toString
(): String
-
def
wait
(): Unit
-
def
wait
(arg0: Long, arg1: Int): Unit
-
def
wait
(arg0: Long): Unit
-
def
write
(jobject: JValue): Unit
-
def
writeArray
(elements: Seq[JValue]): Unit
-
def
writeBoolean
(b: Boolean): Unit
-
def
writeNull
(): Unit
-
def
writeNumber
(x: BigDecimal): Unit
-
def
writeObject
(fields: Map[String, JValue]): Unit
-
def
writeString
(s: String): Unit
Inherited from AnyRef
Inherited from Any
An object that will write JValues in a human-friendly indented format with no spaces or newlines.
The writer will try to keep as much data on a single line as possible. As a result, arrays and objects have two printing modes (selected automatically), "compact" and "indented".
In the "compact" mode, an array is stored on a single line:
Similarly for objects:
{ "key1" : value1, "key2 : value2, ... }In the "indented" mode, the delimiters appear on lines by themselves, with each element formatted on a separate line:
[ elem1, elem2, ... ]For objects, if a key/value pair does not fit on a single line, the value is printed on a line of its own, indented further:
{ "key" : value }Empty arrays and objects are always represented compactly, as
[]or{}respectively.This does many small writes, so it is probably a good idea to wrap the
Writerin aBufferedWriter.