RFR: JDK-8240138: Cleanup HtmlTree

Hannes Wallnöfer hannes.wallnoefer at oracle.com
Fri Mar 13 14:41:00 UTC 2020


This is not part of the review, just some thoughts on renaming HtmlTag below...

> Am 11.03.2020 um 20:46 schrieb Jonathan Gibbons <jonathan.gibbons at oracle.com>:
> 
> Hi Pavel,
> 
> Thanks for your detailed feedback.  Some responses inline.  Most are discussion points that probably do not lead to another webrev. Some are about minor typos etc.
> 
> -- Jon
> 
> 
> On 03/11/2020 06:30 AM, Pavel Rappo wrote:
>> Hi Jon,
>> 
>> 1. Some methods, constructors, enum constants, and unused imports have gone.
>> 
>> 2. HtmlTree.HEADING(..., boolean printTitle, ...) has been split into 2 methods,
>> HtmlTree.HEADING and HtmlTree.HEADING_TITLE.
>> 
>> On a related note, it's satisfying to see that more and more calls to "new HtmlTree"
>> are being substituted with calls to convenience static factory methods.
> 
> In another HTML-generator project in which I'm using similar HTML classes, I've made
> the constructor for HtmlTree private, to "force" the use of the static factory methods.
> If we did that, we might also consider moving/renaming HtmlTag to HtmlTree.Kind

I think tag names are usually referred to as „element type“ in HTML, so I think I would prefer HtmlTree.Type to HtmlTree.Kind. Of course the term „type“ has a different meaning in Java, so maybe ElementType or TagName?

https://www.w3.org/TR/html51/infrastructure.html#element-type
https://www.w3.org/TR/html51/syntax.html#kind-of-element
https://www.w3.org/TR/html51/syntax.html#tag-name

Hannes


More information about the javadoc-dev mailing list