|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface JsopWriter
A builder for Json and Json diff strings. It knows when a comma is needed. A comma is appended before '{', '[', a value, or a key; but only if the last appended token was '}', ']', or a value. There is no limit to the number of nesting levels.
| Method Summary | |
|---|---|
JsopWriter |
append(JsopWriter diff)
Append all entries of the given writer. |
JsopWriter |
array()
Append '['. |
JsopWriter |
encodedValue(String raw)
Append an already encoded value. |
JsopWriter |
endArray()
Append ']'. |
JsopWriter |
endObject()
Append '}'. |
JsopWriter |
key(String key)
Append the key (in quotes) plus a colon. |
JsopWriter |
newline()
Append a newline character. |
JsopWriter |
object()
Append '{'. |
void |
resetWriter()
Resets this instance, so that all data is discarded. |
void |
setLineLength(int length)
Set the line length, after which a newline is added (to improve readability). |
JsopWriter |
tag(char tag)
Append a Jsop tag character. |
JsopWriter |
value(boolean b)
Append the boolean value 'true' or 'false'. |
JsopWriter |
value(long x)
Append a number. |
JsopWriter |
value(String value)
Append a string or null. |
| Method Detail |
|---|
JsopWriter array()
JsopWriter object()
JsopWriter key(String key)
key - the key
JsopWriter value(String value)
value - the value
JsopWriter encodedValue(String raw)
raw - the value
JsopWriter endObject()
JsopWriter endArray()
JsopWriter tag(char tag)
tag - the string to append
JsopWriter append(JsopWriter diff)
diff - the writer
JsopWriter value(long x)
x - the value
JsopWriter value(boolean b)
b - the value
JsopWriter newline()
void resetWriter()
void setLineLength(int length)
length - the length
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||