Package com.aspectran.utils.json
Class JsonWriterCloseable
java.lang.Object
com.aspectran.utils.json.JsonWriter
com.aspectran.utils.json.JsonWriterCloseable
- All Implemented Interfaces:
Closeable
,AutoCloseable
Converts an object to a JSON formatted string.
If pretty-printing is enabled, the JsonWriter will add newlines and indentation to the written data. Pretty-printing is disabled by default.
Useful with Java 7 for example :
try(JsonWriterCloseable jsonWriter = JsonWriterCloseable(out)) {
....
}
Created: 2008. 06. 12 PM 8:20:54
- Author:
- Juho Jeong
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.aspectran.utils.json.JsonWriter
apply, beginArray, beginObject, close, endArray, endObject, flush, indentString, name, nullWritable, prettyPrint, setIndentString, setNullWritable, setPrettyPrint, setStringifyContext, toString, value, writeJson, writeName, writeNull, writeNull, writeValue
-
Constructor Details
-
JsonWriterCloseable
Instantiates a new JsonWriter. Pretty printing is enabled by default, and the indent string is set to " " (two spaces).- Parameters:
writer
- the character-output stream
-