Question: Write a Java program that will read a json files ( MidsummerNightsDream.json) parse them with the gson library and the set of Java methods you

Write a Java program that will read a json files ( MidsummerNightsDream.json) parse them with the gson library and the set of Java methods you were provided, and create a set of HTML web pages.

home / study / engineering / computer science / computer science questions and answers / i need help figuring out how to write the following program. i dont know where to start ...

Your question has been answered

Let us know if you got a helpful answer. Rate this answer

Question: I need help figuring out how to write the following program. I dont know where to start ! Any ...

I need help figuring out how to write the following program. I dont know where to start ! Any online resources would also be helpful.

We need to write a simple Java program that will read a JSON file, parse it with the gson library.

We were provided with:

-JSON File

"title": "Midsummer Night\u0027s Dream",

"year": "1595",

"acts": [

"Act1",

"Act2",

"Act3",

"Act4",

"Act5"

],

"Act1": {

"Scene1": {

"paragraphs": [

{

"charID": "Theseus",

"text": "Now, fair Hippolyta, our nuptial hour [p]Draws on apace; four happy days bring in [p]Another moon: but, O, methinks, how slow [p]This old moon wanes! she lingers my desires, [p]Like to a step-dame or a dowager [p]Long withering out a young man revenue. ",

"paragraphNum": 2

},

-PlayJSONReader whose method readPlay reads the JSON file. This class will be provided.

-AccessorUtils.java This class will access elements from the play structure. This class will be provided along with documentation on the methods in the class.

We are to write the following class

public class PlayWriter

{

public static void writePlay(String thePlay,String outputFile) {

try {

JsonElement jelement = new JsonParser().parse(thePlay);

JsonObject thePlayJsonObject= (JsonObject)jelement;

..

}

privatestatic void writePlayTitleAndYear(){}

private static void writeActs(){}

private static void writeAct(){}

private static void writeScenesOfAct(){}

private static void writeSceneOfAct(){}

private static void writeSceneParagraphs(){}

}

HTMLTags.java

package edu.txstate.cs3320.sanchez;;

public class HTMLTags { public static final String HTML_HEADER_START = " " + " " + " " + " " ; public static final String HTML_HEADER_END = " " + " "; public static final String TITLE_START = ""; public static final String HTML_START = ""; public static final String HTML_END = ""; public static final String BODY_START = ""; public static final String BODY_END = "";

public static final String H1_START = "";

public static final String H1_END = " ";

public static final String H2_START = " ";

public static final String H2_END = "";

public static final String H3_START = "";

public static final String H3_END = "";

public static final String H4_START = "";

public static final String H4_END = "";

public static final String H5_START = "";

public static final String H5_END = "";

public static final String H6_START = "";

public static final String H6_END = "";

public static final String UNORDERED_LIST_START = "";

public static final String UNORDERED_LIST_END ="";

public static final String LIST_ITEM_START = "";

public static final String LIST_ITEM_END = "";

public static final String PARAGRAPH_START = "";

public static final String PARAGRAPH_END = "";

public static final String BOLD_START = "";

public static final String BOLD_END = "";

public static final String ITALICS_START = "";

public static final String ITALICS_END = "";

public final static String LINE_BREAK = "";

public static String createHTMLHeaderWithBookmark (int headerLevel, String bookmark)

{ StringBuilder stringBuilder = new StringBuilder ("");

return stringBuilder.toString(); }

public static String createHTMLLinkToBookmark (String linkFile, String bookmark, String linkText)

{ StringBuilder stringBuilder = new StringBuilder(" "); stringBuilder.append(linkText);

stringBuilder.append("");

return stringBuilder.toString(); }

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!