From the course: JSON Processing with Java EE
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Solution: Output JSON object to a file
From the course: JSON Processing with Java EE
Solution: Output JSON object to a file
- [Instructor] The Challenge was to write code that outputs a JSON model to a file. The solution is to create a file output string instance and pass this to the create writer method. So load up the ObjectExample 7 class to see my solution to this Challenge. The main point of this Challenge is to show that any object that implements either the writer or the output stream interfaces can be used to output the JSON object. So to test that this code actually works, execute the main method and look for the file it produces in the root of the project. It should look something like this.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Introduction to the object model2m 44s
-
(Locked)
Create a model from a JSON string6m 48s
-
(Locked)
Create a model from a JSON file2m 48s
-
(Locked)
JSON builder API1m 24s
-
Build a JSON model8m 30s
-
(Locked)
How to traverse the model1m 36s
-
(Locked)
Traverse the JSON model6m 19s
-
(Locked)
Output the JSON model to a data stream3m 16s
-
(Locked)
Challenge: JSON array object30s
-
(Locked)
Solution: JSON array object1m 11s
-
(Locked)
Challenge: Write unit test27s
-
(Locked)
Solution: Write unit test23s
-
(Locked)
Challenge: Output JSON object to a file18s
-
(Locked)
Solution: Output JSON object to a file36s
-
(Locked)
-
-