Question
Create a java program that generates an outline representation of an HTML document based on the requirements below. Write a program called HTMLSummarizer.java that reads
Create a java program that generates an outline representation of an HTML document based on the requirements below.
Write a program called HTMLSummarizer.java that reads in an HTML file and outputs the corresponding outline representation. Your HTMLSummarizer class must implement the provided Tester interface and also contain the main() method where your program starts running. This is because your program will be tested via this interface. The interface contains a single method:
public ArrayList
This method must perform the required computation.
Input
The method takes a Scanner object, which contains a valid HTML file. You may assume that every start tag is properly matched with an end tag, and that there are no errors in the input.
Hint: Use the provided HTMLScanner object to easily parse the input by using its two methods: hasNextTag() and nextTag().
Semantics
The HTML file will contain 0 or more tags.
The depth of a void tag or an element is the number of elements that surround it. For example, the depth of element b in Figure 1 is 3.
An element or void tag is a child of another element, if it is contained in that element and is of depth one greater than the element. For example, in Figure 1, b is a child of p, but is not a child of body. Whereas, p, hr, p, and h1 are all children of body. All tags whose names begins with a ! are to be ignored. For example, tags of the form
and " +
"
Bold Example: bold
" +"