RFR: JDK-8240138: Cleanup HtmlTree

Jonathan Gibbons jonathan.gibbons at oracle.com
Fri Mar 13 15:10:44 UTC 2020


On 3/13/20 7:41 AM, Hannes Wallnöfer wrote:
> 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


Hannes,

That's good feedback.

Your references are very informative, and of those, "name" or "tag name" 
seems the most appropriate.  I also note why "kind" is _not_ appropriate.

Whatever we decide, we should be accurate in our doc-comments, tying the 
terms back to references such as those you cite.

-- Jon



More information about the javadoc-dev mailing list