Package com.yahoo.text
Class JSONWriter
java.lang.Object
com.yahoo.text.JSONWriter
A class which knows how to write JSON markup. All methods return this to
enable chaining of method calls.
Consider using the Jackson generator API instead, as that may be faster.
- Author:
- bratseth
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionBegin an array valueBegins an array valuebeginField
(String fieldName) Begins an object fieldBegin an object valueendArray()
End an array valueEnds an array valueendField()
Ends an object fieldEnd an object valuevalue()
Writes a null valuevalue
(boolean value) Writes a boolean valueWrites a numeric valueWrites a string value
-
Constructor Details
-
JSONWriter
-
-
Method Details
-
beginField
Begins an object field- Throws:
IOException
-
endField
Ends an object field- Throws:
IOException
-
beginArrayValue
Begins an array value- Throws:
IOException
-
endArrayValue
Ends an array value- Throws:
IOException
-
beginObject
Begin an object value- Throws:
IOException
-
endObject
End an object value- Throws:
IOException
-
beginArray
Begin an array value- Throws:
IOException
-
endArray
End an array value- Throws:
IOException
-
value
Writes a string value- Throws:
IOException
-
value
Writes a numeric value- Throws:
IOException
-
value
Writes a boolean value- Throws:
IOException
-
value
Writes a null value- Throws:
IOException
-