public class CustomJSONWriter extends JSONWriter
Modifier and Type | Field and Description |
---|---|
java.util.Stack<java.lang.String> |
objectStack |
Constructor and Description |
---|
CustomJSONWriter(java.io.Writer w) |
Modifier and Type | Method and Description |
---|---|
CustomJSONWriter |
array()
Begin appending a new array.
|
CustomJSONWriter |
endArray()
End an array.
|
CustomJSONWriter |
endObject()
End an object.
|
CustomJSONWriter |
key(java.lang.String s)
Append a key.
|
CustomJSONWriter |
object()
Begin appending a new object.
|
CustomJSONWriter |
value(boolean b)
Append either the value
true or the value
false . |
CustomJSONWriter |
value(double d)
Append a double value.
|
CustomJSONWriter |
value(long l)
Append a long value.
|
CustomJSONWriter |
value(java.lang.Object o)
Append an object value.
|
isTidy, setTidy, writeArray, writeObject
public CustomJSONWriter array()
JSONWriter
endArray
will be appended to this array. The
endArray
method must be called to mark the array's end.array
in class JSONWriter
public CustomJSONWriter endArray()
JSONWriter
array
.endArray
in class JSONWriter
public CustomJSONWriter endObject()
JSONWriter
object
.endObject
in class JSONWriter
public CustomJSONWriter key(java.lang.String s)
JSONWriter
key
in class JSONWriter
s
- A key string.public CustomJSONWriter object()
JSONWriter
endObject
will be appended to this object. The
endObject
method must be called to mark the object's end.object
in class JSONWriter
public CustomJSONWriter value(boolean b)
JSONWriter
true
or the value
false
.value
in class JSONWriter
b
- A boolean.public CustomJSONWriter value(double d)
JSONWriter
value
in class JSONWriter
d
- A double.public CustomJSONWriter value(long l)
JSONWriter
value
in class JSONWriter
l
- A long.public CustomJSONWriter value(java.lang.Object o)
JSONWriter
value
in class JSONWriter
o
- The object to append. It can be null, or a Boolean, Number,
String, JSONObject, or JSONArray, or an object with a toJSONString()
method.Copyright © 2010 - 2020 Adobe. All Rights Reserved