Description
USE THIS STARTER CODE: https://github.com/usf-cs272-fall2021/homework-SimpleJsonWriter-template.git (Use hints given in attachments)
Includes tests that NEED to all pass
For this homework, you will create a class that outputs various collections as “pretty” JSON objects or arrays to file. Use tab characters for each level of indentation and use line separators between elements. For example, a “pretty” JSON array looks like:
[ 1, 2, 3]
Note that there is no comma after the last element in the array. Objects look like:
{ "ant": 1, "bat": 2, "cat": 3}
Note that strings and keys are always in "
quotation marks, but numbers are not. A nested object looks like:
{ "ant": [ 1 ], "bat": [ 1, 2 ], "cat": [ 1, 2, 3 ]}
The examples here happen to be sorted, but that is not necessary for JSON output.
Use UTF8
when writing files. See the Javadoc comments in the template code for additional details.