8220202: Simplify/standardize method naming for HtmlTree

Reviewed-by: hannesw
This commit is contained in:
Jonathan Gibbons 2019-03-11 12:59:45 -07:00
parent 3a072e4e45
commit 1b9db9b7a1
83 changed files with 1194 additions and 1205 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -78,8 +78,8 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
protected void addTypeParameters(ExecutableElement member, Content htmltree) { protected void addTypeParameters(ExecutableElement member, Content htmltree) {
Content typeParameters = getTypeParameters(member); Content typeParameters = getTypeParameters(member);
if (!typeParameters.isEmpty()) { if (!typeParameters.isEmpty()) {
htmltree.addContent(typeParameters); htmltree.add(typeParameters);
htmltree.addContent(Contents.SPACE); htmltree.add(Contents.SPACE);
} }
} }
@ -100,16 +100,16 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
@Override @Override
protected Content getDeprecatedLink(Element member) { protected Content getDeprecatedLink(Element member) {
Content deprecatedLinkContent = new ContentBuilder(); Content deprecatedLinkContent = new ContentBuilder();
deprecatedLinkContent.addContent(utils.getFullyQualifiedName(member)); deprecatedLinkContent.add(utils.getFullyQualifiedName(member));
if (!utils.isConstructor(member)) { if (!utils.isConstructor(member)) {
deprecatedLinkContent.addContent("."); deprecatedLinkContent.add(".");
deprecatedLinkContent.addContent(member.getSimpleName()); deprecatedLinkContent.add(member.getSimpleName());
} }
String signature = utils.flatSignature((ExecutableElement) member); String signature = utils.flatSignature((ExecutableElement) member);
if (signature.length() > 2) { if (signature.length() > 2) {
deprecatedLinkContent.addContent(Contents.ZERO_WIDTH_SPACE); deprecatedLinkContent.add(Contents.ZERO_WIDTH_SPACE);
} }
deprecatedLinkContent.addContent(signature); deprecatedLinkContent.add(signature);
return writer.getDocLink(MEMBER, utils.getEnclosingTypeElement(member), member, deprecatedLinkContent); return writer.getDocLink(MEMBER, utils.getEnclosingTypeElement(member), member, deprecatedLinkContent);
} }
@ -131,7 +131,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
name(ee), false)); name(ee), false));
Content code = HtmlTree.CODE(memberLink); Content code = HtmlTree.CODE(memberLink);
addParameters(ee, false, code, name(ee).length() - 1); addParameters(ee, false, code, name(ee).length() - 1);
tdSummary.addContent(code); tdSummary.add(code);
} }
/** /**
@ -143,7 +143,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
*/ */
@Override @Override
protected void addInheritedSummaryLink(TypeElement te, Element member, Content linksTree) { protected void addInheritedSummaryLink(TypeElement te, Element member, Content linksTree) {
linksTree.addContent(writer.getDocLink(MEMBER, te, member, name(member), false)); linksTree.add(writer.getDocLink(MEMBER, te, member, name(member), false));
} }
/** /**
@ -158,10 +158,10 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
boolean isVarArg, Content tree) { boolean isVarArg, Content tree) {
Content link = writer.getLink(new LinkInfoImpl(configuration, EXECUTABLE_MEMBER_PARAM, Content link = writer.getLink(new LinkInfoImpl(configuration, EXECUTABLE_MEMBER_PARAM,
param.asType()).varargs(isVarArg)); param.asType()).varargs(isVarArg));
tree.addContent(link); tree.add(link);
if(name(param).length() > 0) { if(name(param).length() > 0) {
tree.addContent(Contents.SPACE); tree.add(Contents.SPACE);
tree.addContent(name(param)); tree.add(name(param));
} }
} }
@ -176,12 +176,12 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
protected void addReceiverAnnotations(ExecutableElement member, TypeMirror rcvrType, protected void addReceiverAnnotations(ExecutableElement member, TypeMirror rcvrType,
List<? extends AnnotationMirror> annotationMirrors, Content tree) { List<? extends AnnotationMirror> annotationMirrors, Content tree) {
writer.addReceiverAnnotationInfo(member, rcvrType, annotationMirrors, tree); writer.addReceiverAnnotationInfo(member, rcvrType, annotationMirrors, tree);
tree.addContent(Contents.SPACE); tree.add(Contents.SPACE);
tree.addContent(utils.getTypeName(rcvrType, false)); tree.add(utils.getTypeName(rcvrType, false));
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, RECEIVER_TYPE, rcvrType); LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, RECEIVER_TYPE, rcvrType);
tree.addContent(writer.getTypeParameterLinks(linkInfo)); tree.add(writer.getTypeParameterLinks(linkInfo));
tree.addContent(Contents.SPACE); tree.add(Contents.SPACE);
tree.addContent("this"); tree.add("this");
} }
@ -216,7 +216,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
} }
int paramstart; int paramstart;
for (paramstart = 0; paramstart < parameters.size(); paramstart++) { for (paramstart = 0; paramstart < parameters.size(); paramstart++) {
paramTree.addContent(sep); paramTree.add(sep);
VariableElement param = parameters.get(paramstart); VariableElement param = parameters.get(paramstart);
if (param.getKind() != ElementKind.INSTANCE_INIT) { if (param.getKind() != ElementKind.INSTANCE_INIT) {
@ -225,8 +225,8 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
writer.addAnnotationInfo(indent.length(), writer.addAnnotationInfo(indent.length(),
member, param, paramTree); member, param, paramTree);
if (foundAnnotations) { if (foundAnnotations) {
paramTree.addContent(DocletConstants.NL); paramTree.add(DocletConstants.NL);
paramTree.addContent(indent); paramTree.add(indent);
} }
} }
addParam(member, param, addParam(member, param,
@ -236,28 +236,28 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
} }
for (int i = paramstart + 1; i < parameters.size(); i++) { for (int i = paramstart + 1; i < parameters.size(); i++) {
paramTree.addContent(","); paramTree.add(",");
paramTree.addContent(DocletConstants.NL); paramTree.add(DocletConstants.NL);
paramTree.addContent(indent); paramTree.add(indent);
if (includeAnnotations) { if (includeAnnotations) {
boolean foundAnnotations = boolean foundAnnotations =
writer.addAnnotationInfo(indent.length(), member, parameters.get(i), writer.addAnnotationInfo(indent.length(), member, parameters.get(i),
paramTree); paramTree);
if (foundAnnotations) { if (foundAnnotations) {
paramTree.addContent(DocletConstants.NL); paramTree.add(DocletConstants.NL);
paramTree.addContent(indent); paramTree.add(indent);
} }
} }
addParam(member, parameters.get(i), (i == parameters.size() - 1) && member.isVarArgs(), addParam(member, parameters.get(i), (i == parameters.size() - 1) && member.isVarArgs(),
paramTree); paramTree);
} }
if (paramTree.isEmpty()) { if (paramTree.isEmpty()) {
htmltree.addContent("()"); htmltree.add("()");
} else { } else {
htmltree.addContent(Contents.ZERO_WIDTH_SPACE); htmltree.add(Contents.ZERO_WIDTH_SPACE);
htmltree.addContent("("); htmltree.add("(");
htmltree.addContent(paramTree); htmltree.add(paramTree);
paramTree.addContent(")"); paramTree.add(")");
} }
} }
@ -271,19 +271,19 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
List<? extends TypeMirror> exceptions = member.getThrownTypes(); List<? extends TypeMirror> exceptions = member.getThrownTypes();
if (!exceptions.isEmpty()) { if (!exceptions.isEmpty()) {
CharSequence indent = makeSpace(indentSize + 1 - 7); CharSequence indent = makeSpace(indentSize + 1 - 7);
htmltree.addContent(DocletConstants.NL); htmltree.add(DocletConstants.NL);
htmltree.addContent(indent); htmltree.add(indent);
htmltree.addContent("throws "); htmltree.add("throws ");
indent = makeSpace(indentSize + 1); indent = makeSpace(indentSize + 1);
Content link = writer.getLink(new LinkInfoImpl(configuration, MEMBER, exceptions.get(0))); Content link = writer.getLink(new LinkInfoImpl(configuration, MEMBER, exceptions.get(0)));
htmltree.addContent(link); htmltree.add(link);
for(int i = 1; i < exceptions.size(); i++) { for(int i = 1; i < exceptions.size(); i++) {
htmltree.addContent(","); htmltree.add(",");
htmltree.addContent(DocletConstants.NL); htmltree.add(DocletConstants.NL);
htmltree.addContent(indent); htmltree.add(indent);
Content exceptionLink = writer.getLink(new LinkInfoImpl(configuration, MEMBER, Content exceptionLink = writer.getLink(new LinkInfoImpl(configuration, MEMBER,
exceptions.get(i))); exceptions.get(i)));
htmltree.addContent(exceptionLink); htmltree.add(exceptionLink);
} }
} }
} }

View File

@ -107,7 +107,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
for (Element element : memberlist) { for (Element element : memberlist) {
addDescription(dl, element); addDescription(dl, element);
} }
contentTree.addContent(dl); contentTree.add(dl);
} }
} }
@ -120,7 +120,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
for (SearchIndexItem sii : searchList) { for (SearchIndexItem sii : searchList) {
addDescription(sii, dl); addDescription(sii, dl);
} }
contentTree.addContent(dl); contentTree.add(dl);
} }
} }
@ -161,16 +161,16 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
i++; i++;
} }
} }
contentTree.addContent(dl); contentTree.add(dl);
} }
protected void addHeading(Character uc, Content contentTree) { protected void addHeading(Character uc, Content contentTree) {
String unicode = uc.toString(); String unicode = uc.toString();
contentTree.addContent(getMarkerAnchorForIndex(unicode)); contentTree.add(getMarkerAnchorForIndex(unicode));
Content headContent = new StringContent(unicode); Content headContent = new StringContent(unicode);
Content heading = HtmlTree.HEADING(Headings.CONTENT_HEADING, false, Content heading = HtmlTree.HEADING(Headings.CONTENT_HEADING, false,
HtmlStyle.title, headContent); HtmlStyle.title, headContent);
contentTree.addContent(heading); contentTree.add(heading);
} }
protected void addDescription(Content dl, Element element) { protected void addDescription(Content dl, Element element) {
@ -223,13 +223,13 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
si.setLabel(moduleName); si.setLabel(moduleName);
si.setCategory(SearchIndexItem.Category.MODULES); si.setCategory(SearchIndexItem.Category.MODULES);
Content dt = HtmlTree.DT(link); Content dt = HtmlTree.DT(link);
dt.addContent(" - "); dt.add(" - ");
dt.addContent(contents.module_); dt.add(contents.module_);
dt.addContent(" " + moduleName); dt.add(" " + moduleName);
dlTree.addContent(dt); dlTree.add(dt);
Content dd = new HtmlTree(HtmlTag.DD); Content dd = new HtmlTree(HtmlTag.DD);
addSummaryComment(mdle, dd); addSummaryComment(mdle, dd);
dlTree.addContent(dd); dlTree.add(dd);
} }
/** /**
@ -247,13 +247,13 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
si.setLabel(utils.getPackageName(pkg)); si.setLabel(utils.getPackageName(pkg));
si.setCategory(SearchIndexItem.Category.PACKAGES); si.setCategory(SearchIndexItem.Category.PACKAGES);
Content dt = HtmlTree.DT(link); Content dt = HtmlTree.DT(link);
dt.addContent(" - "); dt.add(" - ");
dt.addContent(contents.package_); dt.add(contents.package_);
dt.addContent(" " + utils.getPackageName(pkg)); dt.add(" " + utils.getPackageName(pkg));
dlTree.addContent(dt); dlTree.add(dt);
Content dd = new HtmlTree(HtmlTag.DD); Content dd = new HtmlTree(HtmlTag.DD);
addSummaryComment(pkg, dd); addSummaryComment(pkg, dd);
dlTree.addContent(dd); dlTree.add(dd);
} }
/** /**
@ -270,12 +270,12 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
si.setLabel(utils.getSimpleName(typeElement)); si.setLabel(utils.getSimpleName(typeElement));
si.setCategory(SearchIndexItem.Category.TYPES); si.setCategory(SearchIndexItem.Category.TYPES);
Content dt = HtmlTree.DT(link); Content dt = HtmlTree.DT(link);
dt.addContent(" - "); dt.add(" - ");
addClassInfo(typeElement, dt); addClassInfo(typeElement, dt);
dlTree.addContent(dt); dlTree.add(dt);
Content dd = new HtmlTree(HtmlTag.DD); Content dd = new HtmlTree(HtmlTag.DD);
addComment(typeElement, dd); addComment(typeElement, dd);
dlTree.addContent(dd); dlTree.add(dd);
} }
/** /**
@ -286,7 +286,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
* @param contentTree the content tree to which the class info will be added * @param contentTree the content tree to which the class info will be added
*/ */
protected void addClassInfo(TypeElement te, Content contentTree) { protected void addClassInfo(TypeElement te, Content contentTree) {
contentTree.addContent(contents.getContent("doclet.in", contentTree.add(contents.getContent("doclet.in",
utils.getTypeElementName(te, false), utils.getTypeElementName(te, false),
getPackageLink(utils.containingPackage(te), getPackageLink(utils.containingPackage(te),
utils.getPackageName(utils.containingPackage(te))) utils.getPackageName(utils.containingPackage(te)))
@ -320,12 +320,12 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
Content span = HtmlTree.SPAN(HtmlStyle.memberNameLink, Content span = HtmlTree.SPAN(HtmlStyle.memberNameLink,
getDocLink(LinkInfoImpl.Kind.INDEX, member, name)); getDocLink(LinkInfoImpl.Kind.INDEX, member, name));
Content dt = HtmlTree.DT(span); Content dt = HtmlTree.DT(span);
dt.addContent(" - "); dt.add(" - ");
addMemberDesc(member, dt); addMemberDesc(member, dt);
dlTree.addContent(dt); dlTree.add(dt);
Content dd = new HtmlTree(HtmlTag.DD); Content dd = new HtmlTree(HtmlTag.DD);
addComment(member, dd); addComment(member, dd);
dlTree.addContent(dd); dlTree.add(dd);
} }
protected void addDescription(SearchIndexItem sii, Content dlTree) { protected void addDescription(SearchIndexItem sii, Content dlTree) {
@ -333,16 +333,16 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
siiPath += sii.getUrl(); siiPath += sii.getUrl();
HtmlTree labelLink = HtmlTree.A(siiPath, new StringContent(sii.getLabel())); HtmlTree labelLink = HtmlTree.A(siiPath, new StringContent(sii.getLabel()));
Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.searchTagLink, labelLink)); Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.searchTagLink, labelLink));
dt.addContent(" - "); dt.add(" - ");
dt.addContent(contents.getContent("doclet.Search_tag_in", sii.getHolder())); dt.add(contents.getContent("doclet.Search_tag_in", sii.getHolder()));
dlTree.addContent(dt); dlTree.add(dt);
Content dd = new HtmlTree(HtmlTag.DD); Content dd = new HtmlTree(HtmlTag.DD);
if (sii.getDescription().isEmpty()) { if (sii.getDescription().isEmpty()) {
dd.addContent(Contents.SPACE); dd.add(Contents.SPACE);
} else { } else {
dd.addContent(sii.getDescription()); dd.add(sii.getDescription());
} }
dlTree.addContent(dd); dlTree.add(dd);
} }
/** /**
@ -360,17 +360,17 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
HtmlTree div = new HtmlTree(HtmlTag.DIV); HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.deprecationBlock); div.setStyle(HtmlStyle.deprecationBlock);
if (utils.isDeprecated(element)) { if (utils.isDeprecated(element)) {
div.addContent(span); div.add(span);
tags = utils.getBlockTags(element, DocTree.Kind.DEPRECATED); tags = utils.getBlockTags(element, DocTree.Kind.DEPRECATED);
if (!tags.isEmpty()) if (!tags.isEmpty())
addInlineDeprecatedComment(element, tags.get(0), div); addInlineDeprecatedComment(element, tags.get(0), div);
contentTree.addContent(div); contentTree.add(div);
} else { } else {
TypeElement encl = utils.getEnclosingTypeElement(element); TypeElement encl = utils.getEnclosingTypeElement(element);
while (encl != null) { while (encl != null) {
if (utils.isDeprecated(encl)) { if (utils.isDeprecated(encl)) {
div.addContent(span); div.add(span);
contentTree.addContent(div); contentTree.add(div);
break; break;
} }
encl = utils.getEnclosingTypeElement(encl); encl = utils.getEnclosingTypeElement(encl);
@ -393,15 +393,15 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
Content resource = contents.getContent(utils.isStatic(member) Content resource = contents.getContent(utils.isStatic(member)
? "doclet.Static_variable_in" ? "doclet.Static_variable_in"
: "doclet.Variable_in", classdesc); : "doclet.Variable_in", classdesc);
contentTree.addContent(resource); contentTree.add(resource);
} else if (utils.isConstructor(member)) { } else if (utils.isConstructor(member)) {
contentTree.addContent( contentTree.add(
contents.getContent("doclet.Constructor_for", classdesc)); contents.getContent("doclet.Constructor_for", classdesc));
} else if (utils.isMethod(member)) { } else if (utils.isMethod(member)) {
Content resource = contents.getContent(utils.isStatic(member) Content resource = contents.getContent(utils.isStatic(member)
? "doclet.Static_method_in" ? "doclet.Static_method_in"
: "doclet.Method_in", classdesc); : "doclet.Method_in", classdesc);
contentTree.addContent(resource); contentTree.add(resource);
} }
addPreQualifiedClassLink(LinkInfoImpl.Kind.INDEX, containing, addPreQualifiedClassLink(LinkInfoImpl.Kind.INDEX, containing,
false, contentTree); false, contentTree);

View File

@ -218,7 +218,7 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
* @param htmltree the content tree to which the name will be added. * @param htmltree the content tree to which the name will be added.
*/ */
protected void addName(String name, Content htmltree) { protected void addName(String name, Content htmltree) {
htmltree.addContent(name); htmltree.add(name);
} }
/** /**
@ -255,8 +255,8 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
} }
if (!set.isEmpty()) { if (!set.isEmpty()) {
String mods = set.stream().map(Modifier::toString).collect(Collectors.joining(" ")); String mods = set.stream().map(Modifier::toString).collect(Collectors.joining(" "));
htmltree.addContent(mods); htmltree.add(mods);
htmltree.addContent(Contents.SPACE); htmltree.add(Contents.SPACE);
} }
} }
@ -283,8 +283,8 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
HtmlTree code = new HtmlTree(HtmlTag.CODE); HtmlTree code = new HtmlTree(HtmlTag.CODE);
addModifier(member, code); addModifier(member, code);
if (type == null) { if (type == null) {
code.addContent(utils.isClass(member) ? "class" : "interface"); code.add(utils.isClass(member) ? "class" : "interface");
code.addContent(Contents.SPACE); code.add(Contents.SPACE);
} else { } else {
List<? extends TypeParameterElement> list = utils.isExecutableElement(member) List<? extends TypeParameterElement> list = utils.isExecutableElement(member)
? ((ExecutableElement)member).getTypeParameters() ? ((ExecutableElement)member).getTypeParameters()
@ -292,24 +292,24 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
if (list != null && !list.isEmpty()) { if (list != null && !list.isEmpty()) {
Content typeParameters = ((AbstractExecutableMemberWriter) this) Content typeParameters = ((AbstractExecutableMemberWriter) this)
.getTypeParameters((ExecutableElement)member); .getTypeParameters((ExecutableElement)member);
code.addContent(typeParameters); code.add(typeParameters);
//Code to avoid ugly wrapping in member summary table. //Code to avoid ugly wrapping in member summary table.
if (typeParameters.charCount() > 10) { if (typeParameters.charCount() > 10) {
code.addContent(new HtmlTree(HtmlTag.BR)); code.add(new HtmlTree(HtmlTag.BR));
} else { } else {
code.addContent(Contents.SPACE); code.add(Contents.SPACE);
} }
code.addContent( code.add(
writer.getLink(new LinkInfoImpl(configuration, writer.getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.SUMMARY_RETURN_TYPE, type))); LinkInfoImpl.Kind.SUMMARY_RETURN_TYPE, type)));
} else { } else {
code.addContent( code.add(
writer.getLink(new LinkInfoImpl(configuration, writer.getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.SUMMARY_RETURN_TYPE, type))); LinkInfoImpl.Kind.SUMMARY_RETURN_TYPE, type)));
} }
} }
tdSummaryType.addContent(code); tdSummaryType.add(code);
} }
/** /**
@ -320,24 +320,24 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
*/ */
private void addModifier(Element member, Content code) { private void addModifier(Element member, Content code) {
if (utils.isProtected(member)) { if (utils.isProtected(member)) {
code.addContent("protected "); code.add("protected ");
} else if (utils.isPrivate(member)) { } else if (utils.isPrivate(member)) {
code.addContent("private "); code.add("private ");
} else if (!utils.isPublic(member)) { // Package private } else if (!utils.isPublic(member)) { // Package private
code.addContent(resources.getText("doclet.Package_private")); code.add(resources.getText("doclet.Package_private"));
code.addContent(" "); code.add(" ");
} }
boolean isAnnotatedTypeElement = utils.isAnnotationType(member.getEnclosingElement()); boolean isAnnotatedTypeElement = utils.isAnnotationType(member.getEnclosingElement());
if (!isAnnotatedTypeElement && utils.isMethod(member)) { if (!isAnnotatedTypeElement && utils.isMethod(member)) {
if (!utils.isInterface(member.getEnclosingElement()) && utils.isAbstract(member)) { if (!utils.isInterface(member.getEnclosingElement()) && utils.isAbstract(member)) {
code.addContent("abstract "); code.add("abstract ");
} }
if (utils.isDefault(member)) { if (utils.isDefault(member)) {
code.addContent("default "); code.add("default ");
} }
} }
if (utils.isStatic(member)) { if (utils.isStatic(member)) {
code.addContent("static "); code.add("static ");
} }
} }
@ -353,7 +353,7 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
if (!output.isEmpty()) { if (!output.isEmpty()) {
Content deprecatedContent = output; Content deprecatedContent = output;
Content div = HtmlTree.DIV(HtmlStyle.deprecationBlock, deprecatedContent); Content div = HtmlTree.DIV(HtmlStyle.deprecationBlock, deprecatedContent);
contentTree.addContent(div); contentTree.add(div);
} }
} }
@ -424,8 +424,8 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
&& !utils.isAnnotationType(element)) { && !utils.isAnnotationType(element)) {
HtmlTree name = new HtmlTree(HtmlTag.SPAN); HtmlTree name = new HtmlTree(HtmlTag.SPAN);
name.setStyle(HtmlStyle.typeNameLabel); name.setStyle(HtmlStyle.typeNameLabel);
name.addContent(name(te) + "."); name.add(name(te) + ".");
typeContent.addContent(name); typeContent.add(name);
} }
addSummaryLink(utils.isClass(element) || utils.isInterface(element) addSummaryLink(utils.isClass(element) || utils.isInterface(element)
? LinkInfoImpl.Kind.CLASS_USE ? LinkInfoImpl.Kind.CLASS_USE
@ -435,7 +435,7 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
writer.addSummaryLinkComment(this, element, desc); writer.addSummaryLinkComment(this, element, desc);
useTable.addRow(summaryType, typeContent, desc); useTable.addRow(summaryType, typeContent, desc);
} }
contentTree.addContent(useTable.toContent()); contentTree.add(useTable.toContent());
} }
} }

View File

@ -139,9 +139,9 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
addOverview(main); addOverview(main);
Content footer = HtmlTree.FOOTER(); Content footer = HtmlTree.FOOTER();
addNavigationBarFooter(footer); addNavigationBarFooter(footer);
body.addContent(header); body.add(header);
body.addContent(main); body.add(main);
body.addContent(footer); body.add(footer);
printHtmlDocument( printHtmlDocument(
configuration.metakeywords.getOverviewMetaKeywords(title, configuration.doctitle), configuration.metakeywords.getOverviewMetaKeywords(title, configuration.doctitle),
description, description,
@ -171,9 +171,9 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
addOverview(main); addOverview(main);
Content footer = HtmlTree.FOOTER(); Content footer = HtmlTree.FOOTER();
addNavigationBarFooter(footer); addNavigationBarFooter(footer);
body.addContent(header); body.add(header);
body.addContent(main); body.add(main);
body.addContent(footer); body.add(footer);
printHtmlDocument( printHtmlDocument(
configuration.metakeywords.getOverviewMetaKeywords(title, configuration.doctitle), configuration.metakeywords.getOverviewMetaKeywords(title, configuration.doctitle),
description, description,
@ -231,8 +231,8 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
HtmlTree ul = new HtmlTree(HtmlTag.UL); HtmlTree ul = new HtmlTree(HtmlTag.UL);
addAllClassesLink(ul); addAllClassesLink(ul);
addAllPackagesLink(ul); addAllPackagesLink(ul);
htmlTree.addContent(ul); htmlTree.add(ul);
header.addContent(htmlTree); header.add(htmlTree);
addModulesList(main); addModulesList(main);
} }
@ -254,8 +254,8 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
addAllClassesLink(ul); addAllClassesLink(ul);
addAllPackagesLink(ul); addAllPackagesLink(ul);
addAllModulesLink(ul); addAllModulesLink(ul);
htmlTree.addContent(ul); htmlTree.add(ul);
header.addContent(htmlTree); header.add(htmlTree);
addModulePackagesList(modules, text, tableSummary, main, mdle); addModulePackagesList(modules, text, tableSummary, main, mdle);
} }
@ -270,7 +270,7 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
HtmlStyle.title, title); HtmlStyle.title, title);
Content div = HtmlTree.DIV(HtmlStyle.header, heading); Content div = HtmlTree.DIV(HtmlStyle.header, heading);
body.addContent(div); body.add(div);
} }
} }

View File

@ -124,9 +124,9 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
addOverview(main); addOverview(main);
Content footer = HtmlTree.FOOTER(); Content footer = HtmlTree.FOOTER();
addNavigationBarFooter(footer); addNavigationBarFooter(footer);
body.addContent(header); body.add(header);
body.addContent(main); body.add(main);
body.addContent(footer); body.add(footer);
printHtmlDocument( printHtmlDocument(
configuration.metakeywords.getOverviewMetaKeywords(title, configuration.doctitle), configuration.metakeywords.getOverviewMetaKeywords(title, configuration.doctitle),
description, body); description, body);
@ -165,8 +165,8 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
if (configuration.showModules && configuration.modules.size() > 1) { if (configuration.showModules && configuration.modules.size() > 1) {
addAllModulesLink(ul); addAllModulesLink(ul);
} }
htmlTree.addContent(ul); htmlTree.add(ul);
header.addContent(htmlTree); header.add(htmlTree);
addPackagesList(main); addPackagesList(main);
} }
} }
@ -182,7 +182,7 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
HtmlStyle.title, title); HtmlStyle.title, title);
Content div = HtmlTree.DIV(HtmlStyle.header, heading); Content div = HtmlTree.DIV(HtmlStyle.header, heading);
body.addContent(div); body.add(div);
} }
} }

View File

@ -92,9 +92,9 @@ public abstract class AbstractTreeWriter extends HtmlDocletWriter {
addExtendsImplements(parent, local, li); addExtendsImplements(parent, local, li);
addLevelInfo(local, classtree.directSubClasses(local, isEnum), addLevelInfo(local, classtree.directSubClasses(local, isEnum),
isEnum, li); // Recurse isEnum, li); // Recurse
ul.addContent(li); ul.add(li);
} }
contentTree.addContent(ul); contentTree.add(ul);
} }
} }
@ -121,7 +121,7 @@ public abstract class AbstractTreeWriter extends HtmlDocletWriter {
HtmlTree htmlTree = HtmlTree.SECTION(sectionHeading); HtmlTree htmlTree = HtmlTree.SECTION(sectionHeading);
addLevelInfo(!utils.isInterface(firstTypeElement) ? firstTypeElement : null, addLevelInfo(!utils.isInterface(firstTypeElement) ? firstTypeElement : null,
sset, isEnums, htmlTree); sset, isEnums, htmlTree);
div.addContent(htmlTree); div.add(htmlTree);
} }
} }
@ -147,21 +147,21 @@ public abstract class AbstractTreeWriter extends HtmlDocletWriter {
if (isFirst) { if (isFirst) {
isFirst = false; isFirst = false;
if (utils.isInterface(typeElement)) { if (utils.isInterface(typeElement)) {
contentTree.addContent(" ("); contentTree.add(" (");
contentTree.addContent(contents.also); contentTree.add(contents.also);
contentTree.addContent(" extends "); contentTree.add(" extends ");
} else { } else {
contentTree.addContent(" (implements "); contentTree.add(" (implements ");
} }
} else { } else {
contentTree.addContent(", "); contentTree.add(", ");
} }
addPreQualifiedClassLink(LinkInfoImpl.Kind.TREE, intf, contentTree); addPreQualifiedClassLink(LinkInfoImpl.Kind.TREE, intf, contentTree);
} }
} }
} }
if (!isFirst) { if (!isFirst) {
contentTree.addContent(")"); contentTree.add(")");
} }
} }
} }

View File

@ -113,13 +113,13 @@ public class AllClassesFrameWriter extends HtmlDocletWriter {
Content htmlTree = HtmlTree.MAIN(); Content htmlTree = HtmlTree.MAIN();
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
HtmlStyle.bar, contents.allClassesLabel); HtmlStyle.bar, contents.allClassesLabel);
htmlTree.addContent(heading); htmlTree.add(heading);
Content ul = new HtmlTree(HtmlTag.UL); Content ul = new HtmlTree(HtmlTag.UL);
// Generate the class links and add it to the tdFont tree. // Generate the class links and add it to the tdFont tree.
addAllClasses(ul, wantFrames); addAllClasses(ul, wantFrames);
HtmlTree div = HtmlTree.DIV(HtmlStyle.indexContainer, ul); HtmlTree div = HtmlTree.DIV(HtmlStyle.indexContainer, ul);
htmlTree.addContent(div); htmlTree.add(div);
body.addContent(htmlTree); body.add(htmlTree);
printHtmlDocument(null, "all classes (frame)", body); printHtmlDocument(null, "all classes (frame)", body);
} }
@ -163,7 +163,7 @@ public class AllClassesFrameWriter extends HtmlDocletWriter {
linkContent = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.DEFAULT, typeElement).label(label)); linkContent = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.DEFAULT, typeElement).label(label));
} }
Content li = HtmlTree.LI(linkContent); Content li = HtmlTree.LI(linkContent);
content.addContent(li); content.add(li);
} }
} }
} }

View File

@ -105,17 +105,17 @@ public class AllClassesIndexWriter extends HtmlDocletWriter {
HtmlTree header = HtmlTree.HEADER(); HtmlTree header = HtmlTree.HEADER();
addTop(header); addTop(header);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
header.addContent(navBar.getContent(true)); header.add(navBar.getContent(true));
bodyTree.addContent(header); bodyTree.add(header);
Content allClassesContent = new ContentBuilder(); Content allClassesContent = new ContentBuilder();
addContents(allClassesContent); addContents(allClassesContent);
mainTree.addContent(allClassesContent); mainTree.add(allClassesContent);
bodyTree.addContent(mainTree); bodyTree.add(mainTree);
Content footer = HtmlTree.FOOTER(); Content footer = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
footer.addContent(navBar.getContent(false)); footer.add(navBar.getContent(false));
addBottom(footer); addBottom(footer);
bodyTree.addContent(footer); bodyTree.add(footer);
printHtmlDocument(null, "class index", bodyTree); printHtmlDocument(null, "class index", bodyTree);
} }
@ -150,14 +150,14 @@ public class AllClassesIndexWriter extends HtmlDocletWriter {
Content pHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true, Content pHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, titleContent); HtmlStyle.title, titleContent);
Content headerDiv = HtmlTree.DIV(HtmlStyle.header, pHeading); Content headerDiv = HtmlTree.DIV(HtmlStyle.header, pHeading);
content.addContent(headerDiv); content.add(headerDiv);
if (!table.isEmpty()) { if (!table.isEmpty()) {
HtmlTree li = HtmlTree.LI(HtmlStyle.blockList, table.toContent()); HtmlTree li = HtmlTree.LI(HtmlStyle.blockList, table.toContent());
HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li); HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li);
HtmlTree div = new HtmlTree(HtmlTag.DIV); HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.allClassesContainer); div.setStyle(HtmlStyle.allClassesContainer);
div.addContent(ul); div.add(ul);
content.addContent(div); content.add(div);
if (table.needsScript()) { if (table.needsScript()) {
getMainBodyScript().append(table.getScript()); getMainBodyScript().append(table.getScript());
} }
@ -176,7 +176,7 @@ public class AllClassesIndexWriter extends HtmlDocletWriter {
configuration, LinkInfoImpl.Kind.INDEX, klass)); configuration, LinkInfoImpl.Kind.INDEX, klass));
ContentBuilder description = new ContentBuilder(); ContentBuilder description = new ContentBuilder();
if (utils.isDeprecated(klass)) { if (utils.isDeprecated(klass)) {
description.addContent(getDeprecatedPhrase(klass)); description.add(getDeprecatedPhrase(klass));
List<? extends DocTree> tags = utils.getDeprecatedTrees(klass); List<? extends DocTree> tags = utils.getDeprecatedTrees(klass);
if (!tags.isEmpty()) { if (!tags.isEmpty()) {
addSummaryDeprecatedComment(klass, tags.get(0), description); addSummaryDeprecatedComment(klass, tags.get(0), description);

View File

@ -87,8 +87,8 @@ public class AllPackagesIndexWriter extends HtmlDocletWriter {
HtmlTree header = HtmlTree.HEADER(); HtmlTree header = HtmlTree.HEADER();
addTop(header); addTop(header);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
header.addContent(navBar.getContent(true)); header.add(navBar.getContent(true));
bodyTree.addContent(header); bodyTree.add(header);
HtmlTree div = new HtmlTree(HtmlTag.DIV); HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.allPackagesContainer); div.setStyle(HtmlStyle.allPackagesContainer);
addPackages(div); addPackages(div);
@ -96,14 +96,14 @@ public class AllPackagesIndexWriter extends HtmlDocletWriter {
Content pHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true, Content pHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, titleContent); HtmlStyle.title, titleContent);
Content headerDiv = HtmlTree.DIV(HtmlStyle.header, pHeading); Content headerDiv = HtmlTree.DIV(HtmlStyle.header, pHeading);
mainTree.addContent(headerDiv); mainTree.add(headerDiv);
mainTree.addContent(div); mainTree.add(div);
bodyTree.addContent(mainTree); bodyTree.add(mainTree);
Content footer = HtmlTree.FOOTER(); Content footer = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
footer.addContent(navBar.getContent(false)); footer.add(navBar.getContent(false));
addBottom(footer); addBottom(footer);
bodyTree.addContent(footer); bodyTree.add(footer);
printHtmlDocument(null, "package index", bodyTree); printHtmlDocument(null, "package index", bodyTree);
} }
@ -126,6 +126,6 @@ public class AllPackagesIndexWriter extends HtmlDocletWriter {
} }
} }
HtmlTree li = HtmlTree.LI(HtmlStyle.blockList, table.toContent()); HtmlTree li = HtmlTree.LI(HtmlStyle.blockList, table.toContent());
content.addContent(HtmlTree.UL(HtmlStyle.blockList, li)); content.add(HtmlTree.UL(HtmlStyle.blockList, li));
} }
} }

View File

@ -70,7 +70,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
*/ */
public Content getMemberSummaryHeader(TypeElement typeElement, public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) { Content memberSummaryTree) {
memberSummaryTree.addContent( memberSummaryTree.add(
MarkerComments.START_OF_ANNOTATION_TYPE_FIELD_SUMMARY); MarkerComments.START_OF_ANNOTATION_TYPE_FIELD_SUMMARY);
Content memberTree = writer.getMemberTreeHeader(); Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree); writer.addSummaryHeader(this, typeElement, memberTree);
@ -95,7 +95,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
* {@inheritDoc} * {@inheritDoc}
*/ */
public void addAnnotationFieldDetailsMarker(Content memberDetails) { public void addAnnotationFieldDetailsMarker(Content memberDetails) {
memberDetails.addContent(MarkerComments.START_OF_ANNOTATION_TYPE_FIELD_DETAILS); memberDetails.add(MarkerComments.START_OF_ANNOTATION_TYPE_FIELD_DETAILS);
} }
/** /**
@ -104,11 +104,11 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
public void addAnnotationDetailsTreeHeader(TypeElement typeElement, public void addAnnotationDetailsTreeHeader(TypeElement typeElement,
Content memberDetailsTree) { Content memberDetailsTree) {
if (!writer.printedAnnotationFieldHeading) { if (!writer.printedAnnotationFieldHeading) {
memberDetailsTree.addContent(links.createAnchor( memberDetailsTree.add(links.createAnchor(
SectionName.ANNOTATION_TYPE_FIELD_DETAIL)); SectionName.ANNOTATION_TYPE_FIELD_DETAIL));
Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.fieldDetailsLabel); contents.fieldDetailsLabel);
memberDetailsTree.addContent(heading); memberDetailsTree.add(heading);
writer.printedAnnotationFieldHeading = true; writer.printedAnnotationFieldHeading = true;
} }
} }
@ -118,11 +118,11 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
*/ */
public Content getAnnotationDocTreeHeader(Element member, public Content getAnnotationDocTreeHeader(Element member,
Content annotationDetailsTree) { Content annotationDetailsTree) {
annotationDetailsTree.addContent(links.createAnchor(name(member))); annotationDetailsTree.add(links.createAnchor(name(member)));
Content annotationDocTree = writer.getMemberTreeHeader(); Content annotationDocTree = writer.getMemberTreeHeader();
Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING); Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(name(member)); heading.add(name(member));
annotationDocTree.addContent(heading); annotationDocTree.add(heading);
return annotationDocTree; return annotationDocTree;
} }
@ -136,8 +136,8 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
Content link = Content link =
writer.getLink(new LinkInfoImpl(configuration, writer.getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.MEMBER, getType(member))); LinkInfoImpl.Kind.MEMBER, getType(member)));
pre.addContent(link); pre.add(link);
pre.addContent(Contents.SPACE); pre.add(Contents.SPACE);
if (configuration.linksource) { if (configuration.linksource) {
Content memberName = new StringContent(name(member)); Content memberName = new StringContent(name(member));
writer.addSrcLink(member, memberName, pre); writer.addSrcLink(member, memberName, pre);
@ -189,7 +189,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
public void addSummaryLabel(Content memberTree) { public void addSummaryLabel(Content memberTree) {
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.fieldSummaryLabel); contents.fieldSummaryLabel);
memberTree.addContent(label); memberTree.add(label);
} }
/** /**
@ -220,7 +220,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
*/ */
@Override @Override
public void addSummaryAnchor(TypeElement typeElement, Content memberTree) { public void addSummaryAnchor(TypeElement typeElement, Content memberTree) {
memberTree.addContent(links.createAnchor( memberTree.add(links.createAnchor(
SectionName.ANNOTATION_TYPE_FIELD_SUMMARY)); SectionName.ANNOTATION_TYPE_FIELD_SUMMARY));
} }
@ -247,7 +247,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink, Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
writer.getDocLink(context, member, name(member), false)); writer.getDocLink(context, member, name(member), false));
Content code = HtmlTree.CODE(memberLink); Content code = HtmlTree.CODE(memberLink);
tdSummary.addContent(code); tdSummary.add(code);
} }
/** /**

View File

@ -72,7 +72,7 @@ public class AnnotationTypeOptionalMemberWriterImpl extends
@Override @Override
public Content getMemberSummaryHeader(TypeElement typeElement, public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) { Content memberSummaryTree) {
memberSummaryTree.addContent( memberSummaryTree.add(
MarkerComments.START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY); MarkerComments.START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY);
Content memberTree = writer.getMemberTreeHeader(); Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree); writer.addSummaryHeader(this, typeElement, memberTree);
@ -99,8 +99,8 @@ public class AnnotationTypeOptionalMemberWriterImpl extends
Content dt = HtmlTree.DT(contents.default_); Content dt = HtmlTree.DT(contents.default_);
Content dl = HtmlTree.DL(dt); Content dl = HtmlTree.DL(dt);
Content dd = HtmlTree.DD(new StringContent(value.toString())); Content dd = HtmlTree.DD(new StringContent(value.toString()));
dl.addContent(dd); dl.add(dd);
annotationDocTree.addContent(dl); annotationDocTree.add(dl);
} }
} }
} }
@ -112,7 +112,7 @@ public class AnnotationTypeOptionalMemberWriterImpl extends
public void addSummaryLabel(Content memberTree) { public void addSummaryLabel(Content memberTree) {
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.annotateTypeOptionalMemberSummaryLabel); contents.annotateTypeOptionalMemberSummaryLabel);
memberTree.addContent(label); memberTree.add(label);
} }
/** /**
@ -137,7 +137,7 @@ public class AnnotationTypeOptionalMemberWriterImpl extends
*/ */
@Override @Override
public void addSummaryAnchor(TypeElement typeElement, Content memberTree) { public void addSummaryAnchor(TypeElement typeElement, Content memberTree) {
memberTree.addContent(links.createAnchor( memberTree.add(links.createAnchor(
SectionName.ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY)); SectionName.ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY));
} }
} }

View File

@ -72,7 +72,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
*/ */
public Content getMemberSummaryHeader(TypeElement typeElement, public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) { Content memberSummaryTree) {
memberSummaryTree.addContent( memberSummaryTree.add(
MarkerComments.START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY); MarkerComments.START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY);
Content memberTree = writer.getMemberTreeHeader(); Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree); writer.addSummaryHeader(this, typeElement, memberTree);
@ -97,7 +97,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
* {@inheritDoc} * {@inheritDoc}
*/ */
public void addAnnotationDetailsMarker(Content memberDetails) { public void addAnnotationDetailsMarker(Content memberDetails) {
memberDetails.addContent(MarkerComments.START_OF_ANNOTATION_TYPE_DETAILS); memberDetails.add(MarkerComments.START_OF_ANNOTATION_TYPE_DETAILS);
} }
/** /**
@ -106,11 +106,11 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
public void addAnnotationDetailsTreeHeader(TypeElement te, public void addAnnotationDetailsTreeHeader(TypeElement te,
Content memberDetailsTree) { Content memberDetailsTree) {
if (!writer.printedAnnotationHeading) { if (!writer.printedAnnotationHeading) {
memberDetailsTree.addContent(links.createAnchor( memberDetailsTree.add(links.createAnchor(
SectionName.ANNOTATION_TYPE_ELEMENT_DETAIL)); SectionName.ANNOTATION_TYPE_ELEMENT_DETAIL));
Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.annotationTypeDetailsLabel); contents.annotationTypeDetailsLabel);
memberDetailsTree.addContent(heading); memberDetailsTree.add(heading);
writer.printedAnnotationHeading = true; writer.printedAnnotationHeading = true;
} }
} }
@ -121,12 +121,12 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
@Override @Override
public Content getAnnotationDocTreeHeader(Element member, Content annotationDetailsTree) { public Content getAnnotationDocTreeHeader(Element member, Content annotationDetailsTree) {
String simpleName = name(member); String simpleName = name(member);
annotationDetailsTree.addContent(links.createAnchor( annotationDetailsTree.add(links.createAnchor(
simpleName + utils.signature((ExecutableElement) member))); simpleName + utils.signature((ExecutableElement) member)));
Content annotationDocTree = writer.getMemberTreeHeader(); Content annotationDocTree = writer.getMemberTreeHeader();
Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING); Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(simpleName); heading.add(simpleName);
annotationDocTree.addContent(heading); annotationDocTree.add(heading);
return annotationDocTree; return annotationDocTree;
} }
@ -140,8 +140,8 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
Content link = Content link =
writer.getLink(new LinkInfoImpl(configuration, writer.getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.MEMBER, getType(member))); LinkInfoImpl.Kind.MEMBER, getType(member)));
pre.addContent(link); pre.add(link);
pre.addContent(Contents.SPACE); pre.add(Contents.SPACE);
if (configuration.linksource) { if (configuration.linksource) {
Content memberName = new StringContent(name(member)); Content memberName = new StringContent(name(member));
writer.addSrcLink(member, memberName, pre); writer.addSrcLink(member, memberName, pre);
@ -193,7 +193,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
public void addSummaryLabel(Content memberTree) { public void addSummaryLabel(Content memberTree) {
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.annotateTypeRequiredMemberSummaryLabel); contents.annotateTypeRequiredMemberSummaryLabel);
memberTree.addContent(label); memberTree.add(label);
} }
/** /**
@ -230,7 +230,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
* {@inheritDoc} * {@inheritDoc}
*/ */
public void addSummaryAnchor(TypeElement typeElement, Content memberTree) { public void addSummaryAnchor(TypeElement typeElement, Content memberTree) {
memberTree.addContent(links.createAnchor( memberTree.add(links.createAnchor(
SectionName.ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY)); SectionName.ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY));
} }
@ -254,7 +254,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink, Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
writer.getDocLink(context, member, name(member), false)); writer.getDocLink(context, member, name(member), false));
Content code = HtmlTree.CODE(memberLink); Content code = HtmlTree.CODE(memberLink);
tdSummary.addContent(code); tdSummary.add(code);
} }
/** /**

View File

@ -92,36 +92,36 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
navBar.setNavLinkModule(linkContent); navBar.setNavLinkModule(linkContent);
navBar.setMemberSummaryBuilder(configuration.getBuilderFactory().getMemberSummaryBuilder(this)); navBar.setMemberSummaryBuilder(configuration.getBuilderFactory().getMemberSummaryBuilder(this));
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.addContent(navBar.getContent(true)); htmlTree.add(navBar.getContent(true));
bodyTree.addContent(htmlTree); bodyTree.add(htmlTree);
bodyTree.addContent(MarkerComments.START_OF_CLASS_DATA); bodyTree.add(MarkerComments.START_OF_CLASS_DATA);
HtmlTree div = new HtmlTree(HtmlTag.DIV); HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.header); div.setStyle(HtmlStyle.header);
if (configuration.showModules) { if (configuration.showModules) {
ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(annotationType); ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(annotationType);
Content typeModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInType, contents.moduleLabel); Content typeModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInType, contents.moduleLabel);
Content moduleNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, typeModuleLabel); Content moduleNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, typeModuleLabel);
moduleNameDiv.addContent(Contents.SPACE); moduleNameDiv.add(Contents.SPACE);
moduleNameDiv.addContent(getModuleLink(mdle, new StringContent(mdle.getQualifiedName()))); moduleNameDiv.add(getModuleLink(mdle, new StringContent(mdle.getQualifiedName())));
div.addContent(moduleNameDiv); div.add(moduleNameDiv);
} }
PackageElement pkg = utils.containingPackage(annotationType); PackageElement pkg = utils.containingPackage(annotationType);
if (!pkg.isUnnamed()) { if (!pkg.isUnnamed()) {
Content typePackageLabel = HtmlTree.SPAN(HtmlStyle.packageLabelInType, contents.packageLabel); Content typePackageLabel = HtmlTree.SPAN(HtmlStyle.packageLabelInType, contents.packageLabel);
Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, typePackageLabel); Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, typePackageLabel);
pkgNameDiv.addContent(Contents.SPACE); pkgNameDiv.add(Contents.SPACE);
Content pkgNameContent = getPackageLink(pkg, new StringContent(utils.getPackageName(pkg))); Content pkgNameContent = getPackageLink(pkg, new StringContent(utils.getPackageName(pkg)));
pkgNameDiv.addContent(pkgNameContent); pkgNameDiv.add(pkgNameContent);
div.addContent(pkgNameDiv); div.add(pkgNameDiv);
} }
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.CLASS_HEADER, annotationType); LinkInfoImpl.Kind.CLASS_HEADER, annotationType);
Content headerContent = new StringContent(header); Content headerContent = new StringContent(header);
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true, Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, headerContent); HtmlStyle.title, headerContent);
heading.addContent(getTypeParameterLinks(linkInfo)); heading.add(getTypeParameterLinks(linkInfo));
div.addContent(heading); div.add(heading);
mainTree.addContent(div); mainTree.add(div);
return bodyTree; return bodyTree;
} }
@ -138,12 +138,12 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
*/ */
@Override @Override
public void addFooter(Content contentTree) { public void addFooter(Content contentTree) {
contentTree.addContent(MarkerComments.END_OF_CLASS_DATA); contentTree.add(MarkerComments.END_OF_CLASS_DATA);
Content htmlTree = HtmlTree.FOOTER(); Content htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.addContent(navBar.getContent(false)); htmlTree.add(navBar.getContent(false));
addBottom(htmlTree); addBottom(htmlTree);
contentTree.addContent(htmlTree); contentTree.add(htmlTree);
} }
/** /**
@ -180,23 +180,23 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
@Override @Override
public void addAnnotationTypeSignature(String modifiers, Content annotationInfoTree) { public void addAnnotationTypeSignature(String modifiers, Content annotationInfoTree) {
Content hr = new HtmlTree(HtmlTag.HR); Content hr = new HtmlTree(HtmlTag.HR);
annotationInfoTree.addContent(hr); annotationInfoTree.add(hr);
Content pre = new HtmlTree(HtmlTag.PRE); Content pre = new HtmlTree(HtmlTag.PRE);
addAnnotationInfo(annotationType, pre); addAnnotationInfo(annotationType, pre);
pre.addContent(modifiers); pre.add(modifiers);
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.CLASS_SIGNATURE, annotationType); LinkInfoImpl.Kind.CLASS_SIGNATURE, annotationType);
Content annotationName = new StringContent(utils.getSimpleName(annotationType)); Content annotationName = new StringContent(utils.getSimpleName(annotationType));
Content parameterLinks = getTypeParameterLinks(linkInfo); Content parameterLinks = getTypeParameterLinks(linkInfo);
if (configuration.linksource) { if (configuration.linksource) {
addSrcLink(annotationType, annotationName, pre); addSrcLink(annotationType, annotationName, pre);
pre.addContent(parameterLinks); pre.add(parameterLinks);
} else { } else {
Content span = HtmlTree.SPAN(HtmlStyle.memberNameLabel, annotationName); Content span = HtmlTree.SPAN(HtmlStyle.memberNameLabel, annotationName);
span.addContent(parameterLinks); span.add(parameterLinks);
pre.addContent(span); pre.add(span);
} }
annotationInfoTree.addContent(pre); annotationInfoTree.add(pre);
} }
/** /**
@ -238,7 +238,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
addInlineDeprecatedComment(annotationType, deprs.get(0), div); addInlineDeprecatedComment(annotationType, deprs.get(0), div);
} }
} }
annotationInfoTree.addContent(div); annotationInfoTree.add(div);
} }
} }

View File

@ -229,16 +229,16 @@ public class ClassUseWriter extends SubWriterHolderWriter {
if (pkgSet.size() > 0) { if (pkgSet.size() > 0) {
addClassUse(div); addClassUse(div);
} else { } else {
div.addContent(contents.getContent("doclet.ClassUse_No.usage.of.0", div.add(contents.getContent("doclet.ClassUse_No.usage.of.0",
utils.getFullyQualifiedName(typeElement))); utils.getFullyQualifiedName(typeElement)));
} }
mainTree.addContent(div); mainTree.add(div);
body.addContent(mainTree); body.add(mainTree);
HtmlTree footer = HtmlTree.FOOTER(); HtmlTree footer = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
footer.addContent(navBar.getContent(false)); footer.add(navBar.getContent(false));
addBottom(footer); addBottom(footer);
body.addContent(footer); body.add(footer);
String description = getDescription("use", typeElement); String description = getDescription("use", typeElement);
printHtmlDocument(null, description, body); printHtmlDocument(null, description, body);
} }
@ -256,7 +256,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
addPackageAnnotationList(ul); addPackageAnnotationList(ul);
} }
addClassList(ul); addClassList(ul);
contentTree.addContent(ul); contentTree.add(ul);
} }
/** /**
@ -277,7 +277,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
addPackageUse(pkg, table); addPackageUse(pkg, table);
} }
Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent()); Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent());
contentTree.addContent(li); contentTree.add(li);
} }
/** /**
@ -306,7 +306,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
table.addRow(getPackageLink(pkg), summary); table.addRow(getPackageLink(pkg), summary);
} }
Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent()); Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent());
contentTree.addContent(li); contentTree.add(li);
} }
/** /**
@ -325,12 +325,12 @@ public class ClassUseWriter extends SubWriterHolderWriter {
typeElement)), typeElement)),
getPackageLink(pkg, utils.getPackageName(pkg))); getPackageLink(pkg, utils.getPackageName(pkg)));
Content heading = HtmlTree.HEADING(Headings.TypeUse.SUMMARY_HEADING, link); Content heading = HtmlTree.HEADING(Headings.TypeUse.SUMMARY_HEADING, link);
htmlTree.addContent(heading); htmlTree.add(heading);
addClassUse(pkg, htmlTree); addClassUse(pkg, htmlTree);
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
} }
Content li = HtmlTree.LI(HtmlStyle.blockList, ul); Content li = HtmlTree.LI(HtmlStyle.blockList, ul);
contentTree.addContent(li); contentTree.add(li);
} }
/** /**
@ -445,16 +445,16 @@ public class ClassUseWriter extends SubWriterHolderWriter {
.label(resources.getText("doclet.Class"))); .label(resources.getText("doclet.Class")));
navBar.setNavLinkClass(classLinkContent); navBar.setNavLinkClass(classLinkContent);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.addContent(navBar.getContent(true)); htmlTree.add(navBar.getContent(true));
bodyTree.addContent(htmlTree); bodyTree.add(htmlTree);
ContentBuilder headContent = new ContentBuilder(); ContentBuilder headContent = new ContentBuilder();
headContent.addContent(contents.getContent("doclet.ClassUse_Title", cltype)); headContent.add(contents.getContent("doclet.ClassUse_Title", cltype));
headContent.addContent(new HtmlTree(HtmlTag.BR)); headContent.add(new HtmlTree(HtmlTag.BR));
headContent.addContent(clname); headContent.add(clname);
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
true, HtmlStyle.title, headContent); true, HtmlStyle.title, headContent);
Content div = HtmlTree.DIV(HtmlStyle.header, heading); Content div = HtmlTree.DIV(HtmlStyle.header, heading);
mainTree.addContent(div); mainTree.add(div);
return bodyTree; return bodyTree;
} }
} }

View File

@ -113,29 +113,29 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
navBar.setNavLinkModule(linkContent); navBar.setNavLinkModule(linkContent);
navBar.setMemberSummaryBuilder(configuration.getBuilderFactory().getMemberSummaryBuilder(this)); navBar.setMemberSummaryBuilder(configuration.getBuilderFactory().getMemberSummaryBuilder(this));
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.addContent(navBar.getContent(true)); htmlTree.add(navBar.getContent(true));
bodyTree.addContent(htmlTree); bodyTree.add(htmlTree);
bodyTree.addContent(MarkerComments.START_OF_CLASS_DATA); bodyTree.add(MarkerComments.START_OF_CLASS_DATA);
HtmlTree div = new HtmlTree(HtmlTag.DIV); HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.header); div.setStyle(HtmlStyle.header);
if (configuration.showModules) { if (configuration.showModules) {
ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(typeElement); ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(typeElement);
Content classModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInType, contents.moduleLabel); Content classModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInType, contents.moduleLabel);
Content moduleNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classModuleLabel); Content moduleNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classModuleLabel);
moduleNameDiv.addContent(Contents.SPACE); moduleNameDiv.add(Contents.SPACE);
moduleNameDiv.addContent(getModuleLink(mdle, moduleNameDiv.add(getModuleLink(mdle,
new StringContent(mdle.getQualifiedName()))); new StringContent(mdle.getQualifiedName())));
div.addContent(moduleNameDiv); div.add(moduleNameDiv);
} }
PackageElement pkg = utils.containingPackage(typeElement); PackageElement pkg = utils.containingPackage(typeElement);
if (!pkg.isUnnamed()) { if (!pkg.isUnnamed()) {
Content classPackageLabel = HtmlTree.SPAN(HtmlStyle.packageLabelInType, contents.packageLabel); Content classPackageLabel = HtmlTree.SPAN(HtmlStyle.packageLabelInType, contents.packageLabel);
Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classPackageLabel); Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classPackageLabel);
pkgNameDiv.addContent(Contents.SPACE); pkgNameDiv.add(Contents.SPACE);
Content pkgNameContent = getPackageLink(pkg, Content pkgNameContent = getPackageLink(pkg,
new StringContent(utils.getPackageName(pkg))); new StringContent(utils.getPackageName(pkg)));
pkgNameDiv.addContent(pkgNameContent); pkgNameDiv.add(pkgNameContent);
div.addContent(pkgNameDiv); div.add(pkgNameDiv);
} }
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.CLASS_HEADER, typeElement); LinkInfoImpl.Kind.CLASS_HEADER, typeElement);
@ -144,9 +144,9 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
Content headerContent = new StringContent(header); Content headerContent = new StringContent(header);
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true, Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, headerContent); HtmlStyle.title, headerContent);
heading.addContent(getTypeParameterLinks(linkInfo)); heading.add(getTypeParameterLinks(linkInfo));
div.addContent(heading); div.add(heading);
mainTree.addContent(div); mainTree.add(div);
return bodyTree; return bodyTree;
} }
@ -163,12 +163,12 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
*/ */
@Override @Override
public void addFooter(Content contentTree) { public void addFooter(Content contentTree) {
contentTree.addContent(MarkerComments.END_OF_CLASS_DATA); contentTree.add(MarkerComments.END_OF_CLASS_DATA);
Content htmlTree = HtmlTree.FOOTER(); Content htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.addContent(navBar.getContent(false)); htmlTree.add(navBar.getContent(false));
addBottom(htmlTree); addBottom(htmlTree);
contentTree.addContent(htmlTree); contentTree.add(htmlTree);
} }
/** /**
@ -205,10 +205,10 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
@Override @Override
public void addClassSignature(String modifiers, Content classInfoTree) { public void addClassSignature(String modifiers, Content classInfoTree) {
Content hr = new HtmlTree(HtmlTag.HR); Content hr = new HtmlTree(HtmlTag.HR);
classInfoTree.addContent(hr); classInfoTree.add(hr);
Content pre = new HtmlTree(HtmlTag.PRE); Content pre = new HtmlTree(HtmlTag.PRE);
addAnnotationInfo(typeElement, pre); addAnnotationInfo(typeElement, pre);
pre.addContent(modifiers); pre.add(modifiers);
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.CLASS_SIGNATURE, typeElement); LinkInfoImpl.Kind.CLASS_SIGNATURE, typeElement);
//Let's not link to ourselves in the signature. //Let's not link to ourselves in the signature.
@ -217,21 +217,21 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
Content parameterLinks = getTypeParameterLinks(linkInfo); Content parameterLinks = getTypeParameterLinks(linkInfo);
if (configuration.linksource) { if (configuration.linksource) {
addSrcLink(typeElement, className, pre); addSrcLink(typeElement, className, pre);
pre.addContent(parameterLinks); pre.add(parameterLinks);
} else { } else {
Content span = HtmlTree.SPAN(HtmlStyle.typeNameLabel, className); Content span = HtmlTree.SPAN(HtmlStyle.typeNameLabel, className);
span.addContent(parameterLinks); span.add(parameterLinks);
pre.addContent(span); pre.add(span);
} }
if (!utils.isInterface(typeElement)) { if (!utils.isInterface(typeElement)) {
TypeMirror superclass = utils.getFirstVisibleSuperClass(typeElement); TypeMirror superclass = utils.getFirstVisibleSuperClass(typeElement);
if (superclass != null) { if (superclass != null) {
pre.addContent(DocletConstants.NL); pre.add(DocletConstants.NL);
pre.addContent("extends "); pre.add("extends ");
Content link = getLink(new LinkInfoImpl(configuration, Content link = getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME, LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME,
superclass)); superclass));
pre.addContent(link); pre.add(link);
} }
} }
List<? extends TypeMirror> interfaces = typeElement.getInterfaces(); List<? extends TypeMirror> interfaces = typeElement.getInterfaces();
@ -243,19 +243,19 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
continue; continue;
} }
if (isFirst) { if (isFirst) {
pre.addContent(DocletConstants.NL); pre.add(DocletConstants.NL);
pre.addContent(utils.isInterface(typeElement) ? "extends " : "implements "); pre.add(utils.isInterface(typeElement) ? "extends " : "implements ");
isFirst = false; isFirst = false;
} else { } else {
pre.addContent(", "); pre.add(", ");
} }
Content link = getLink(new LinkInfoImpl(configuration, Content link = getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME, LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME,
type)); type));
pre.addContent(link); pre.add(link);
} }
} }
classInfoTree.addContent(pre); classInfoTree.add(pre);
} }
/** /**
@ -298,17 +298,17 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
if (sup != null) { if (sup != null) {
HtmlTree ul = new HtmlTree(HtmlTag.UL); HtmlTree ul = new HtmlTree(HtmlTag.UL);
ul.setStyle(HtmlStyle.inheritance); ul.setStyle(HtmlStyle.inheritance);
ul.addContent(getTreeForClassHelper(type)); ul.add(getTreeForClassHelper(type));
if (liTree != null) if (liTree != null)
ul.addContent(liTree); ul.add(liTree);
Content li = HtmlTree.LI(ul); Content li = HtmlTree.LI(ul);
liTree = li; liTree = li;
type = sup; type = sup;
} else } else
classTreeUl.addContent(getTreeForClassHelper(type)); classTreeUl.add(getTreeForClassHelper(type));
} while (sup != null); } while (sup != null);
if (liTree != null) if (liTree != null)
classTreeUl.addContent(liTree); classTreeUl.add(liTree);
return classTreeUl; return classTreeUl;
} }
@ -325,17 +325,17 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
new LinkInfoImpl(configuration, LinkInfoImpl.Kind.TREE, new LinkInfoImpl(configuration, LinkInfoImpl.Kind.TREE,
typeElement)); typeElement));
if (configuration.shouldExcludeQualifier(utils.containingPackage(typeElement).toString())) { if (configuration.shouldExcludeQualifier(utils.containingPackage(typeElement).toString())) {
li.addContent(utils.asTypeElement(type).getSimpleName()); li.add(utils.asTypeElement(type).getSimpleName());
li.addContent(typeParameters); li.add(typeParameters);
} else { } else {
li.addContent(utils.asTypeElement(type).getQualifiedName()); li.add(utils.asTypeElement(type).getQualifiedName());
li.addContent(typeParameters); li.add(typeParameters);
} }
} else { } else {
Content link = getLink(new LinkInfoImpl(configuration, Content link = getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.CLASS_TREE_PARENT, type) LinkInfoImpl.Kind.CLASS_TREE_PARENT, type)
.label(configuration.getClassName(utils.asTypeElement(type)))); .label(configuration.getClassName(utils.asTypeElement(type))));
li.addContent(link); li.add(link);
} }
return li; return li;
} }
@ -348,7 +348,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
if (!utils.isClass(typeElement)) { if (!utils.isClass(typeElement)) {
return; return;
} }
classContentTree.addContent(getClassInheritenceTree(typeElement.asType())); classContentTree.add(getClassInheritenceTree(typeElement.asType()));
} }
/** /**
@ -360,7 +360,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
Content typeParam = (new ParamTaglet()).getTagletOutput(typeElement, Content typeParam = (new ParamTaglet()).getTagletOutput(typeElement,
getTagletWriterInstance(false)); getTagletWriterInstance(false));
Content dl = HtmlTree.DL(typeParam); Content dl = HtmlTree.DL(typeParam);
classInfoTree.addContent(dl); classInfoTree.add(dl);
} }
} }
@ -380,9 +380,9 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
Content label = contents.subclassesLabel; Content label = contents.subclassesLabel;
Content dt = HtmlTree.DT(label); Content dt = HtmlTree.DT(label);
Content dl = HtmlTree.DL(dt); Content dl = HtmlTree.DL(dt);
dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUBCLASSES, dl.add(getClassLinks(LinkInfoImpl.Kind.SUBCLASSES,
subclasses)); subclasses));
classInfoTree.addContent(dl); classInfoTree.add(dl);
} }
} }
} }
@ -398,9 +398,9 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
Content label = contents.subinterfacesLabel; Content label = contents.subinterfacesLabel;
Content dt = HtmlTree.DT(label); Content dt = HtmlTree.DT(label);
Content dl = HtmlTree.DL(dt); Content dl = HtmlTree.DL(dt);
dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUBINTERFACES, dl.add(getClassLinks(LinkInfoImpl.Kind.SUBINTERFACES,
subInterfaces)); subInterfaces));
classInfoTree.addContent(dl); classInfoTree.add(dl);
} }
} }
} }
@ -423,9 +423,9 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
Content label = contents.implementingClassesLabel; Content label = contents.implementingClassesLabel;
Content dt = HtmlTree.DT(label); Content dt = HtmlTree.DT(label);
Content dl = HtmlTree.DL(dt); Content dl = HtmlTree.DL(dt);
dl.addContent(getClassLinks(LinkInfoImpl.Kind.IMPLEMENTED_CLASSES, dl.add(getClassLinks(LinkInfoImpl.Kind.IMPLEMENTED_CLASSES,
implcl)); implcl));
classInfoTree.addContent(dl); classInfoTree.add(dl);
} }
} }
@ -440,8 +440,8 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
Content label = contents.allImplementedInterfacesLabel; Content label = contents.allImplementedInterfacesLabel;
Content dt = HtmlTree.DT(label); Content dt = HtmlTree.DT(label);
Content dl = HtmlTree.DL(dt); Content dl = HtmlTree.DL(dt);
dl.addContent(getClassLinks(LinkInfoImpl.Kind.IMPLEMENTED_INTERFACES, interfaces)); dl.add(getClassLinks(LinkInfoImpl.Kind.IMPLEMENTED_INTERFACES, interfaces));
classInfoTree.addContent(dl); classInfoTree.add(dl);
} }
} }
@ -458,8 +458,8 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
Content label = contents.allSuperinterfacesLabel; Content label = contents.allSuperinterfacesLabel;
Content dt = HtmlTree.DT(label); Content dt = HtmlTree.DT(label);
Content dl = HtmlTree.DL(dt); Content dl = HtmlTree.DL(dt);
dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUPER_INTERFACES, interfaces)); dl.add(getClassLinks(LinkInfoImpl.Kind.SUPER_INTERFACES, interfaces));
classInfoTree.addContent(dl); classInfoTree.add(dl);
} }
} }
@ -480,10 +480,10 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
Content dt = HtmlTree.DT(label); Content dt = HtmlTree.DT(label);
Content dl = HtmlTree.DL(dt); Content dl = HtmlTree.DL(dt);
Content dd = new HtmlTree(HtmlTag.DD); Content dd = new HtmlTree(HtmlTag.DD);
dd.addContent(getLink(new LinkInfoImpl(configuration, dd.add(getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.CLASS, e))); LinkInfoImpl.Kind.CLASS, e)));
dl.addContent(dd); dl.add(dd);
classInfoTree.addContent(dl); classInfoTree.add(dl);
return null; return null;
} }
}.visit(outerClass); }.visit(outerClass);
@ -498,9 +498,9 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
Content dt = HtmlTree.DT(contents.functionalInterface); Content dt = HtmlTree.DT(contents.functionalInterface);
Content dl = HtmlTree.DL(dt); Content dl = HtmlTree.DL(dt);
Content dd = new HtmlTree(HtmlTag.DD); Content dd = new HtmlTree(HtmlTag.DD);
dd.addContent(contents.functionalInterfaceMessage); dd.add(contents.functionalInterfaceMessage);
dl.addContent(dd); dl.add(dd);
classInfoTree.addContent(dl); classInfoTree.add(dl);
} }
} }
@ -532,7 +532,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
addInlineDeprecatedComment(typeElement, deprs.get(0), div); addInlineDeprecatedComment(typeElement, deprs.get(0), div);
} }
} }
classInfoTree.addContent(div); classInfoTree.add(div);
} }
} }
@ -549,7 +549,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
for (Object type : list) { for (Object type : list) {
if (!isFirst) { if (!isFirst) {
Content separator = new StringContent(", "); Content separator = new StringContent(", ");
dd.addContent(separator); dd.add(separator);
} else { } else {
isFirst = false; isFirst = false;
} }
@ -557,11 +557,11 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
if (type instanceof TypeElement) { if (type instanceof TypeElement) {
Content link = getLink( Content link = getLink(
new LinkInfoImpl(configuration, context, (TypeElement)(type))); new LinkInfoImpl(configuration, context, (TypeElement)(type)));
dd.addContent(HtmlTree.CODE(link)); dd.add(HtmlTree.CODE(link));
} else { } else {
Content link = getLink( Content link = getLink(
new LinkInfoImpl(configuration, context, ((TypeMirror)type))); new LinkInfoImpl(configuration, context, ((TypeMirror)type)));
dd.addContent(HtmlTree.CODE(link)); dd.add(HtmlTree.CODE(link));
} }
} }
return dd; return dd;

View File

@ -109,8 +109,8 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
HtmlTree htmlTree = HtmlTree.HEADER(); HtmlTree htmlTree = HtmlTree.HEADER();
addTop(htmlTree); addTop(htmlTree);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.addContent(navBar.getContent(true)); htmlTree.add(navBar.getContent(true));
bodyTree.addContent(htmlTree); bodyTree.add(htmlTree);
return bodyTree; return bodyTree;
} }
@ -136,13 +136,13 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
} else { } else {
String parsedPackageName = utils.parsePackageName(pkg); String parsedPackageName = utils.parsePackageName(pkg);
Content packageNameContent = getPackageLabel(parsedPackageName); Content packageNameContent = getPackageLabel(parsedPackageName);
packageNameContent.addContent(".*"); packageNameContent.add(".*");
link = links.createLink(DocLink.fragment(parsedPackageName), link = links.createLink(DocLink.fragment(parsedPackageName),
packageNameContent, "", ""); packageNameContent, "", "");
PackageElement abbrevPkg = configuration.workArounds.getAbbreviatedPackageElement(pkg); PackageElement abbrevPkg = configuration.workArounds.getAbbreviatedPackageElement(pkg);
printedPackageHeaders.add(abbrevPkg); printedPackageHeaders.add(abbrevPkg);
} }
contentListTree.addContent(HtmlTree.LI(link)); contentListTree.add(HtmlTree.LI(link));
} }
/** /**
@ -158,9 +158,9 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
Content heading = HtmlTree.HEADING(Headings.CONTENT_HEADING, true, Content heading = HtmlTree.HEADING(Headings.CONTENT_HEADING, true,
headingContent); headingContent);
HtmlTree section = HtmlTree.SECTION(heading); HtmlTree section = HtmlTree.SECTION(heading);
section.addContent(contentListTree); section.add(contentListTree);
div.addContent(section); div.add(section);
mainTree.addContent(div); mainTree.add(div);
} }
/** /**
@ -180,20 +180,20 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
public void addPackageName(PackageElement pkg, Content summariesTree, boolean first) { public void addPackageName(PackageElement pkg, Content summariesTree, boolean first) {
Content pkgNameContent; Content pkgNameContent;
if (!first) { if (!first) {
summariesTree.addContent(summaryTree); summariesTree.add(summaryTree);
} }
if (pkg.isUnnamed()) { if (pkg.isUnnamed()) {
summariesTree.addContent(links.createAnchor(SectionName.UNNAMED_PACKAGE_ANCHOR)); summariesTree.add(links.createAnchor(SectionName.UNNAMED_PACKAGE_ANCHOR));
pkgNameContent = contents.defaultPackageLabel; pkgNameContent = contents.defaultPackageLabel;
} else { } else {
String parsedPackageName = utils.parsePackageName(pkg); String parsedPackageName = utils.parsePackageName(pkg);
summariesTree.addContent(links.createAnchor(parsedPackageName)); summariesTree.add(links.createAnchor(parsedPackageName));
pkgNameContent = getPackageLabel(parsedPackageName); pkgNameContent = getPackageLabel(parsedPackageName);
} }
Content headingContent = new StringContent(".*"); Content headingContent = new StringContent(".*");
Content heading = HtmlTree.HEADING(Headings.ConstantsSummary.PACKAGE_HEADING, true, Content heading = HtmlTree.HEADING(Headings.ConstantsSummary.PACKAGE_HEADING, true,
pkgNameContent); pkgNameContent);
heading.addContent(headingContent); heading.add(headingContent);
summaryTree = HtmlTree.SECTION(heading); summaryTree = HtmlTree.SECTION(heading);
} }
@ -212,7 +212,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
*/ */
@Override @Override
public void addClassConstant(Content summariesTree, Content classConstantTree) { public void addClassConstant(Content summariesTree, Content classConstantTree) {
summaryTree.addContent(classConstantTree); summaryTree.add(classConstantTree);
} }
/** /**
@ -232,10 +232,10 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
PackageElement enclosingPackage = utils.containingPackage(typeElement); PackageElement enclosingPackage = utils.containingPackage(typeElement);
Content caption = new ContentBuilder(); Content caption = new ContentBuilder();
if (!enclosingPackage.isUnnamed()) { if (!enclosingPackage.isUnnamed()) {
caption.addContent(enclosingPackage.getQualifiedName()); caption.add(enclosingPackage.getQualifiedName());
caption.addContent("."); caption.add(".");
} }
caption.addContent(classlink); caption.add(classlink);
Table table = new Table(HtmlStyle.constantsSummary) Table table = new Table(HtmlStyle.constantsSummary)
.setCaption(caption) .setCaption(caption)
@ -247,7 +247,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
table.addRow(getTypeColumn(field), getNameColumn(field), getValue(field)); table.addRow(getTypeColumn(field), getNameColumn(field), getValue(field));
} }
Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent()); Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent());
classConstantTree.addContent(li); classConstantTree.add(li);
} }
/** /**
@ -260,17 +260,17 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
Content anchor = links.createAnchor( Content anchor = links.createAnchor(
currentTypeElement.getQualifiedName() + "." + member.getSimpleName()); currentTypeElement.getQualifiedName() + "." + member.getSimpleName());
Content typeContent = new ContentBuilder(); Content typeContent = new ContentBuilder();
typeContent.addContent(anchor); typeContent.add(anchor);
Content code = new HtmlTree(HtmlTag.CODE); Content code = new HtmlTree(HtmlTag.CODE);
for (Modifier mod : member.getModifiers()) { for (Modifier mod : member.getModifiers()) {
Content modifier = new StringContent(mod.toString()); Content modifier = new StringContent(mod.toString());
code.addContent(modifier); code.add(modifier);
code.addContent(Contents.SPACE); code.add(Contents.SPACE);
} }
Content type = getLink(new LinkInfoImpl(configuration, Content type = getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.CONSTANT_SUMMARY, member.asType())); LinkInfoImpl.Kind.CONSTANT_SUMMARY, member.asType()));
code.addContent(type); code.add(type);
typeContent.addContent(code); typeContent.add(code);
return typeContent; return typeContent;
} }
@ -304,10 +304,10 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
@Override @Override
public void addConstantSummaries(Content contentTree, Content summariesTree) { public void addConstantSummaries(Content contentTree, Content summariesTree) {
if (summaryTree != null) { if (summaryTree != null) {
summariesTree.addContent(summaryTree); summariesTree.add(summaryTree);
} }
mainTree.addContent(summariesTree); mainTree.add(summariesTree);
contentTree.addContent(mainTree); contentTree.add(mainTree);
} }
/** /**
@ -317,9 +317,9 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
public void addFooter(Content contentTree) { public void addFooter(Content contentTree) {
Content htmlTree = HtmlTree.FOOTER(); Content htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.addContent(navBar.getContent(false)); htmlTree.add(navBar.getContent(false));
addBottom(htmlTree); addBottom(htmlTree);
contentTree.addContent(htmlTree); contentTree.add(htmlTree);
} }
/** /**

View File

@ -97,7 +97,7 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
@Override @Override
public Content getMemberSummaryHeader(TypeElement typeElement, public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) { Content memberSummaryTree) {
memberSummaryTree.addContent(MarkerComments.START_OF_CONSTRUCTOR_SUMMARY); memberSummaryTree.add(MarkerComments.START_OF_CONSTRUCTOR_SUMMARY);
Content memberTree = writer.getMemberTreeHeader(); Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree); writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree; return memberTree;
@ -117,13 +117,13 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
@Override @Override
public Content getConstructorDetailsTreeHeader(TypeElement typeElement, public Content getConstructorDetailsTreeHeader(TypeElement typeElement,
Content memberDetailsTree) { Content memberDetailsTree) {
memberDetailsTree.addContent(MarkerComments.START_OF_CONSTRUCTOR_DETAILS); memberDetailsTree.add(MarkerComments.START_OF_CONSTRUCTOR_DETAILS);
Content constructorDetailsTree = writer.getMemberTreeHeader(); Content constructorDetailsTree = writer.getMemberTreeHeader();
constructorDetailsTree.addContent(links.createAnchor( constructorDetailsTree.add(links.createAnchor(
SectionName.CONSTRUCTOR_DETAIL)); SectionName.CONSTRUCTOR_DETAIL));
Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.constructorDetailsLabel); contents.constructorDetailsLabel);
constructorDetailsTree.addContent(heading); constructorDetailsTree.add(heading);
return constructorDetailsTree; return constructorDetailsTree;
} }
@ -135,13 +135,13 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
Content constructorDetailsTree) { Content constructorDetailsTree) {
String erasureAnchor; String erasureAnchor;
if ((erasureAnchor = getErasureAnchor(constructor)) != null) { if ((erasureAnchor = getErasureAnchor(constructor)) != null) {
constructorDetailsTree.addContent(links.createAnchor((erasureAnchor))); constructorDetailsTree.add(links.createAnchor((erasureAnchor)));
} }
constructorDetailsTree.addContent(links.createAnchor(writer.getAnchor(constructor))); constructorDetailsTree.add(links.createAnchor(writer.getAnchor(constructor)));
Content constructorDocTree = writer.getMemberTreeHeader(); Content constructorDocTree = writer.getMemberTreeHeader();
Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING); Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(name(constructor)); heading.add(name(constructor));
constructorDocTree.addContent(heading); constructorDocTree.add(heading);
return constructorDocTree; return constructorDocTree;
} }
@ -224,7 +224,7 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
public void addSummaryLabel(Content memberTree) { public void addSummaryLabel(Content memberTree) {
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.constructorSummaryLabel); contents.constructorSummaryLabel);
memberTree.addContent(label); memberTree.add(label);
} }
/** /**
@ -266,7 +266,7 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
*/ */
@Override @Override
public void addSummaryAnchor(TypeElement typeElement, Content memberTree) { public void addSummaryAnchor(TypeElement typeElement, Content memberTree) {
memberTree.addContent(links.createAnchor(SectionName.CONSTRUCTOR_SUMMARY)); memberTree.add(links.createAnchor(SectionName.CONSTRUCTOR_SUMMARY));
} }
/** /**
@ -291,16 +291,16 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
if (foundNonPubConstructor) { if (foundNonPubConstructor) {
Content code = new HtmlTree(HtmlTag.CODE); Content code = new HtmlTree(HtmlTag.CODE);
if (utils.isProtected(member)) { if (utils.isProtected(member)) {
code.addContent("protected "); code.add("protected ");
} else if (utils.isPrivate(member)) { } else if (utils.isPrivate(member)) {
code.addContent("private "); code.add("private ");
} else if (utils.isPublic(member)) { } else if (utils.isPublic(member)) {
code.addContent(Contents.SPACE); code.add(Contents.SPACE);
} else { } else {
code.addContent( code.add(
resources.getText("doclet.Package_private")); resources.getText("doclet.Package_private"));
} }
tdSummaryType.addContent(code); tdSummaryType.add(code);
} }
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -360,7 +360,7 @@ public class Contents {
Matcher m = p.matcher(text); Matcher m = p.matcher(text);
int start = 0; int start = 0;
while (m.find(start)) { while (m.find(start)) {
c.addContent(text.substring(start, m.start())); c.add(text.substring(start, m.start()));
Object o = null; Object o = null;
switch (m.group(1).charAt(0)) { switch (m.group(1).charAt(0)) {
@ -370,17 +370,17 @@ public class Contents {
} }
if (o == null) { if (o == null) {
c.addContent("{" + m.group(1) + "}"); c.add("{" + m.group(1) + "}");
} else if (o instanceof String) { } else if (o instanceof String) {
c.addContent((String) o); c.add((String) o);
} else if (o instanceof Content) { } else if (o instanceof Content) {
c.addContent((Content) o); c.add((Content) o);
} }
start = m.end(); start = m.end();
} }
c.addContent(text.substring(start)); c.add(text.substring(start));
return c; return c;
} }
@ -399,11 +399,11 @@ public class Contents {
int start = 0; int start = 0;
int p; int p;
while ((p = text.indexOf(" ", start)) != -1) { while ((p = text.indexOf(" ", start)) != -1) {
c.addContent(text.substring(start, p)); c.add(text.substring(start, p));
c.addContent(RawHtml.nbsp); c.add(RawHtml.nbsp);
start = p + 1; start = p + 1;
} }
c.addContent(text.substring(start)); c.add(text.substring(start));
return c; // TODO: should be made immutable return c; // TODO: should be made immutable
} }

View File

@ -284,7 +284,7 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
throws DocFileIOException { throws DocFileIOException {
HtmlTree body = getHeader(); HtmlTree body = getHeader();
HtmlTree htmlTree = HtmlTree.MAIN(); HtmlTree htmlTree = HtmlTree.MAIN();
htmlTree.addContent(getContentsList(deprapi)); htmlTree.add(getContentsList(deprapi));
String memberTableSummary; String memberTableSummary;
HtmlTree div = new HtmlTree(HtmlTag.DIV); HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.contentContainer); div.setStyle(HtmlStyle.contentContainer);
@ -300,13 +300,13 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
getHeadingKey(kind), memberTableSummary, memberTableHeader, div); getHeadingKey(kind), memberTableSummary, memberTableHeader, div);
} }
} }
htmlTree.addContent(div); htmlTree.add(div);
body.addContent(htmlTree); body.add(htmlTree);
htmlTree = HtmlTree.FOOTER(); htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.addContent(navBar.getContent(false)); htmlTree.add(navBar.getContent(false));
addBottom(htmlTree); addBottom(htmlTree);
body.addContent(htmlTree); body.add(htmlTree);
String description = "deprecated elements"; String description = "deprecated elements";
printHtmlDocument(null, description, body); printHtmlDocument(null, description, body);
} }
@ -323,7 +323,7 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
if (builder.hasDocumentation(kind)) { if (builder.hasDocumentation(kind)) {
Content li = HtmlTree.LI(links.createLink(getAnchorName(kind), Content li = HtmlTree.LI(links.createLink(getAnchorName(kind),
contents.getContent(getHeadingKey(kind)))); contents.getContent(getHeadingKey(kind))));
contentTree.addContent(li); contentTree.add(li);
} }
} }
@ -339,13 +339,13 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
HtmlStyle.title, headContent); HtmlStyle.title, headContent);
Content div = HtmlTree.DIV(HtmlStyle.header, heading); Content div = HtmlTree.DIV(HtmlStyle.header, heading);
Content headingContent = contents.contentsHeading; Content headingContent = contents.contentsHeading;
div.addContent(HtmlTree.HEADING(Headings.CONTENT_HEADING, true, div.add(HtmlTree.HEADING(Headings.CONTENT_HEADING, true,
headingContent)); headingContent));
Content ul = new HtmlTree(HtmlTag.UL); Content ul = new HtmlTree(HtmlTag.UL);
for (DeprElementKind kind : DeprElementKind.values()) { for (DeprElementKind kind : DeprElementKind.values()) {
addIndexLink(deprapi, kind, ul); addIndexLink(deprapi, kind, ul);
} }
div.addContent(ul); div.add(ul);
return div; return div;
} }
@ -358,7 +358,7 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
*/ */
private void addAnchor(DeprecatedAPIListBuilder builder, DeprElementKind kind, Content htmlTree) { private void addAnchor(DeprecatedAPIListBuilder builder, DeprElementKind kind, Content htmlTree) {
if (builder.hasDocumentation(kind)) { if (builder.hasDocumentation(kind)) {
htmlTree.addContent(links.createAnchor(getAnchorName(kind))); htmlTree.add(links.createAnchor(getAnchorName(kind)));
} }
} }
@ -373,8 +373,8 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
HtmlTree htmlTree = HtmlTree.HEADER(); HtmlTree htmlTree = HtmlTree.HEADER();
addTop(htmlTree); addTop(htmlTree);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.addContent(navBar.getContent(true)); htmlTree.add(navBar.getContent(true));
bodyTree.addContent(htmlTree); bodyTree.add(htmlTree);
return bodyTree; return bodyTree;
} }
@ -414,13 +414,13 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
if (!tags.isEmpty()) { if (!tags.isEmpty()) {
addInlineDeprecatedComment(e, tags.get(0), desc); addInlineDeprecatedComment(e, tags.get(0), desc);
} else { } else {
desc.addContent(HtmlTree.EMPTY); desc.add(HtmlTree.EMPTY);
} }
table.addRow(link, desc); table.addRow(link, desc);
} }
Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent()); Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent());
Content ul = HtmlTree.UL(HtmlStyle.blockList, li); Content ul = HtmlTree.UL(HtmlStyle.blockList, li);
contentTree.addContent(ul); contentTree.add(ul);
} }
} }

View File

@ -191,21 +191,21 @@ public class DocFilesHandlerImpl implements DocFilesHandler {
navBar.setNavLinkPackage(pkgLinkContent); navBar.setNavLinkPackage(pkgLinkContent);
navBar.setUserHeader(docletWriter.getUserHeaderFooter(true)); navBar.setUserHeader(docletWriter.getUserHeaderFooter(true));
Content header = HtmlTree.HEADER(); Content header = HtmlTree.HEADER();
header.addContent(navBar.getContent(true)); header.add(navBar.getContent(true));
htmlContent.addContent(header); htmlContent.add(header);
List<? extends DocTree> fullBody = utils.getFullBody(dfElement); List<? extends DocTree> fullBody = utils.getFullBody(dfElement);
Content bodyContent = docletWriter.commentTagsToContent(null, dfElement, fullBody, false); Content bodyContent = docletWriter.commentTagsToContent(null, dfElement, fullBody, false);
docletWriter.addTagsInfo(dfElement, bodyContent); docletWriter.addTagsInfo(dfElement, bodyContent);
Content main = HtmlTree.MAIN(); Content main = HtmlTree.MAIN();
main.addContent(bodyContent); main.add(bodyContent);
htmlContent.addContent(main); htmlContent.add(main);
navBar.setUserFooter(docletWriter.getUserHeaderFooter(false)); navBar.setUserFooter(docletWriter.getUserHeaderFooter(false));
Content footer = HtmlTree.FOOTER(); Content footer = HtmlTree.FOOTER();
footer.addContent(navBar.getContent(false)); footer.add(navBar.getContent(false));
docletWriter.addBottom(footer); docletWriter.addBottom(footer);
htmlContent.addContent(footer); htmlContent.add(footer);
docletWriter.printHtmlDocument(Collections.emptyList(), null, localTagsContent, htmlContent); docletWriter.printHtmlDocument(Collections.emptyList(), null, localTagsContent, htmlContent);
} }

View File

@ -69,7 +69,7 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
@Override @Override
public Content getMemberSummaryHeader(TypeElement typeElement, public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) { Content memberSummaryTree) {
memberSummaryTree.addContent(MarkerComments.START_OF_ENUM_CONSTANT_SUMMARY); memberSummaryTree.add(MarkerComments.START_OF_ENUM_CONSTANT_SUMMARY);
Content memberTree = writer.getMemberTreeHeader(); Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree); writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree; return memberTree;
@ -89,13 +89,13 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
@Override @Override
public Content getEnumConstantsDetailsTreeHeader(TypeElement typeElement, public Content getEnumConstantsDetailsTreeHeader(TypeElement typeElement,
Content memberDetailsTree) { Content memberDetailsTree) {
memberDetailsTree.addContent(MarkerComments.START_OF_ENUM_CONSTANT_DETAILS); memberDetailsTree.add(MarkerComments.START_OF_ENUM_CONSTANT_DETAILS);
Content enumConstantsDetailsTree = writer.getMemberTreeHeader(); Content enumConstantsDetailsTree = writer.getMemberTreeHeader();
enumConstantsDetailsTree.addContent(links.createAnchor( enumConstantsDetailsTree.add(links.createAnchor(
SectionName.ENUM_CONSTANT_DETAIL)); SectionName.ENUM_CONSTANT_DETAIL));
Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.enumConstantDetailLabel); contents.enumConstantDetailLabel);
enumConstantsDetailsTree.addContent(heading); enumConstantsDetailsTree.add(heading);
return enumConstantsDetailsTree; return enumConstantsDetailsTree;
} }
@ -105,11 +105,11 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
@Override @Override
public Content getEnumConstantsTreeHeader(VariableElement enumConstant, public Content getEnumConstantsTreeHeader(VariableElement enumConstant,
Content enumConstantsDetailsTree) { Content enumConstantsDetailsTree) {
enumConstantsDetailsTree.addContent(links.createAnchor(name(enumConstant))); enumConstantsDetailsTree.add(links.createAnchor(name(enumConstant)));
Content enumConstantsTree = writer.getMemberTreeHeader(); Content enumConstantsTree = writer.getMemberTreeHeader();
Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING); Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(name(enumConstant)); heading.add(name(enumConstant));
enumConstantsTree.addContent(heading); enumConstantsTree.add(heading);
return enumConstantsTree; return enumConstantsTree;
} }
@ -123,8 +123,8 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
addModifiers(enumConstant, pre); addModifiers(enumConstant, pre);
Content enumConstantLink = writer.getLink(new LinkInfoImpl( Content enumConstantLink = writer.getLink(new LinkInfoImpl(
configuration, LinkInfoImpl.Kind.MEMBER, enumConstant.asType())); configuration, LinkInfoImpl.Kind.MEMBER, enumConstant.asType()));
pre.addContent(enumConstantLink); pre.add(enumConstantLink);
pre.addContent(" "); pre.add(" ");
if (configuration.linksource) { if (configuration.linksource) {
Content enumConstantName = new StringContent(name(enumConstant)); Content enumConstantName = new StringContent(name(enumConstant));
writer.addSrcLink(enumConstant, enumConstantName, pre); writer.addSrcLink(enumConstant, enumConstantName, pre);
@ -182,7 +182,7 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
public void addSummaryLabel(Content memberTree) { public void addSummaryLabel(Content memberTree) {
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.enumConstantSummary); contents.enumConstantSummary);
memberTree.addContent(label); memberTree.add(label);
} }
/** /**
@ -209,7 +209,7 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
*/ */
@Override @Override
public void addSummaryAnchor(TypeElement typeElement, Content memberTree) { public void addSummaryAnchor(TypeElement typeElement, Content memberTree) {
memberTree.addContent(links.createAnchor(SectionName.ENUM_CONSTANT_SUMMARY)); memberTree.add(links.createAnchor(SectionName.ENUM_CONSTANT_SUMMARY));
} }
/** /**
@ -235,7 +235,7 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink, Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
writer.getDocLink(context, member, name(member), false)); writer.getDocLink(context, member, name(member), false));
Content code = HtmlTree.CODE(memberLink); Content code = HtmlTree.CODE(memberLink);
tdSummary.addContent(code); tdSummary.add(code);
} }
/** /**

View File

@ -73,7 +73,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
@Override @Override
public Content getMemberSummaryHeader(TypeElement typeElement, public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) { Content memberSummaryTree) {
memberSummaryTree.addContent(MarkerComments.START_OF_FIELD_SUMMARY); memberSummaryTree.add(MarkerComments.START_OF_FIELD_SUMMARY);
Content memberTree = writer.getMemberTreeHeader(); Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree); writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree; return memberTree;
@ -92,13 +92,13 @@ public class FieldWriterImpl extends AbstractMemberWriter
*/ */
@Override @Override
public Content getFieldDetailsTreeHeader(TypeElement typeElement, Content memberDetailsTree) { public Content getFieldDetailsTreeHeader(TypeElement typeElement, Content memberDetailsTree) {
memberDetailsTree.addContent(MarkerComments.START_OF_FIELD_DETAILS); memberDetailsTree.add(MarkerComments.START_OF_FIELD_DETAILS);
Content fieldDetailsTree = writer.getMemberTreeHeader(); Content fieldDetailsTree = writer.getMemberTreeHeader();
fieldDetailsTree.addContent(links.createAnchor( fieldDetailsTree.add(links.createAnchor(
SectionName.FIELD_DETAIL)); SectionName.FIELD_DETAIL));
Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.fieldDetailsLabel); contents.fieldDetailsLabel);
fieldDetailsTree.addContent(heading); fieldDetailsTree.add(heading);
return fieldDetailsTree; return fieldDetailsTree;
} }
@ -107,11 +107,11 @@ public class FieldWriterImpl extends AbstractMemberWriter
*/ */
@Override @Override
public Content getFieldDocTreeHeader(VariableElement field, Content fieldDetailsTree) { public Content getFieldDocTreeHeader(VariableElement field, Content fieldDetailsTree) {
fieldDetailsTree.addContent(links.createAnchor(name(field))); fieldDetailsTree.add(links.createAnchor(name(field)));
Content fieldTree = writer.getMemberTreeHeader(); Content fieldTree = writer.getMemberTreeHeader();
Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING); Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(name(field)); heading.add(name(field));
fieldTree.addContent(heading); fieldTree.add(heading);
return fieldTree; return fieldTree;
} }
@ -125,8 +125,8 @@ public class FieldWriterImpl extends AbstractMemberWriter
addModifiers(field, pre); addModifiers(field, pre);
Content fieldlink = writer.getLink(new LinkInfoImpl( Content fieldlink = writer.getLink(new LinkInfoImpl(
configuration, LinkInfoImpl.Kind.MEMBER, field.asType())); configuration, LinkInfoImpl.Kind.MEMBER, field.asType()));
pre.addContent(fieldlink); pre.add(fieldlink);
pre.addContent(" "); pre.add(" ");
if (configuration.linksource) { if (configuration.linksource) {
Content fieldName = new StringContent(name(field)); Content fieldName = new StringContent(name(field));
writer.addSrcLink(field, fieldName, pre); writer.addSrcLink(field, fieldName, pre);
@ -186,7 +186,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
public void addSummaryLabel(Content memberTree) { public void addSummaryLabel(Content memberTree) {
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.fieldSummaryLabel); contents.fieldSummaryLabel);
memberTree.addContent(label); memberTree.add(label);
} }
/** /**
@ -215,7 +215,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
*/ */
@Override @Override
public void addSummaryAnchor(TypeElement typeElement, Content memberTree) { public void addSummaryAnchor(TypeElement typeElement, Content memberTree) {
memberTree.addContent(links.createAnchor( memberTree.add(links.createAnchor(
SectionName.FIELD_SUMMARY)); SectionName.FIELD_SUMMARY));
} }
@ -224,7 +224,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
*/ */
@Override @Override
public void addInheritedSummaryAnchor(TypeElement typeElement, Content inheritedTree) { public void addInheritedSummaryAnchor(TypeElement typeElement, Content inheritedTree) {
inheritedTree.addContent(links.createAnchor( inheritedTree.add(links.createAnchor(
SectionName.FIELDS_INHERITANCE, configuration.getClassName(typeElement))); SectionName.FIELDS_INHERITANCE, configuration.getClassName(typeElement)));
} }
@ -247,9 +247,9 @@ public class FieldWriterImpl extends AbstractMemberWriter
} }
Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.INHERITED_SUMMARY_HEADING, Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.INHERITED_SUMMARY_HEADING,
label); label);
labelHeading.addContent(Contents.SPACE); labelHeading.add(Contents.SPACE);
labelHeading.addContent(classLink); labelHeading.add(classLink);
inheritedTree.addContent(labelHeading); inheritedTree.add(labelHeading);
} }
/** /**
@ -261,7 +261,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink, Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
writer.getDocLink(context, typeElement , member, name(member), false)); writer.getDocLink(context, typeElement , member, name(member), false));
Content code = HtmlTree.CODE(memberLink); Content code = HtmlTree.CODE(memberLink);
tdSummary.addContent(code); tdSummary.add(code);
} }
/** /**
@ -269,7 +269,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
*/ */
@Override @Override
protected void addInheritedSummaryLink(TypeElement typeElement, Element member, Content linksTree) { protected void addInheritedSummaryLink(TypeElement typeElement, Element member, Content linksTree) {
linksTree.addContent( linksTree.add(
writer.getDocLink(LinkInfoImpl.Kind.MEMBER, typeElement, member, writer.getDocLink(LinkInfoImpl.Kind.MEMBER, typeElement, member,
name(member), false)); name(member), false));
} }

View File

@ -26,7 +26,6 @@
package jdk.javadoc.internal.doclets.formats.html; package jdk.javadoc.internal.doclets.formats.html;
import jdk.javadoc.internal.doclets.formats.html.markup.Head; import jdk.javadoc.internal.doclets.formats.html.markup.Head;
import jdk.javadoc.internal.doclets.formats.html.markup.DocType;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlDocument; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlDocument;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
@ -96,19 +95,19 @@ public class FrameOutputWriter extends HtmlDocletWriter {
protected void generateFrameFile() throws DocFileIOException { protected void generateFrameFile() throws DocFileIOException {
Content frame = getFrameDetails(); Content frame = getFrameDetails();
HtmlTree body = new HtmlTree(HtmlTag.BODY); HtmlTree body = new HtmlTree(HtmlTag.BODY);
body.addAttr(HtmlAttr.CLASS, "frames"); body.put(HtmlAttr.CLASS, "frames");
body.addAttr(HtmlAttr.ONLOAD, "loadFrames()"); body.put(HtmlAttr.ONLOAD, "loadFrames()");
String topFilePath = configuration.topFile.getPath(); String topFilePath = configuration.topFile.getPath();
Script script = new Script( Script script = new Script(
"\nif (targetPage == \"\" || targetPage == \"undefined\")\n" + "\nif (targetPage == \"\" || targetPage == \"undefined\")\n" +
" window.location.replace(") " window.location.replace(")
.appendStringLiteral(topFilePath, '\'') .appendStringLiteral(topFilePath, '\'')
.append(");\n"); .append(");\n");
body.addContent(script.asContent()); body.add(script.asContent());
Content noScript = HtmlTree.NOSCRIPT(contents.noScriptMessage); Content noScript = HtmlTree.NOSCRIPT(contents.noScriptMessage);
body.addContent(noScript); body.add(noScript);
HtmlTree main = HtmlTree.MAIN(frame); HtmlTree main = HtmlTree.MAIN(frame);
body.addContent(main); body.add(main);
if (configuration.windowtitle.length() > 0) { if (configuration.windowtitle.length() > 0) {
printFramesDocument(configuration.windowtitle, body); printFramesDocument(configuration.windowtitle, body);
} else { } else {
@ -159,7 +158,7 @@ public class FrameOutputWriter extends HtmlDocletWriter {
addAllClassesFrameTag(leftContainerDiv); addAllClassesFrameTag(leftContainerDiv);
addClassFrameTag(rightContainerDiv); addClassFrameTag(rightContainerDiv);
HtmlTree mainContainer = HtmlTree.DIV(HtmlStyle.mainContainer, leftContainerDiv); HtmlTree mainContainer = HtmlTree.DIV(HtmlStyle.mainContainer, leftContainerDiv);
mainContainer.addContent(rightContainerDiv); mainContainer.add(rightContainerDiv);
return mainContainer; return mainContainer;
} }
@ -172,7 +171,7 @@ public class FrameOutputWriter extends HtmlDocletWriter {
HtmlTree frame = HtmlTree.IFRAME(DocPaths.MODULE_OVERVIEW_FRAME.getPath(), HtmlTree frame = HtmlTree.IFRAME(DocPaths.MODULE_OVERVIEW_FRAME.getPath(),
"packageListFrame", resources.getText("doclet.All_Modules")); "packageListFrame", resources.getText("doclet.All_Modules"));
HtmlTree leftTop = HtmlTree.DIV(HtmlStyle.leftTop, frame); HtmlTree leftTop = HtmlTree.DIV(HtmlStyle.leftTop, frame);
contentTree.addContent(leftTop); contentTree.add(leftTop);
} }
/** /**
@ -184,7 +183,7 @@ public class FrameOutputWriter extends HtmlDocletWriter {
HtmlTree frame = HtmlTree.IFRAME(DocPaths.OVERVIEW_FRAME.getPath(), HtmlTree frame = HtmlTree.IFRAME(DocPaths.OVERVIEW_FRAME.getPath(),
"packageListFrame", resources.getText("doclet.All_Packages")); "packageListFrame", resources.getText("doclet.All_Packages"));
HtmlTree leftTop = HtmlTree.DIV(HtmlStyle.leftTop, frame); HtmlTree leftTop = HtmlTree.DIV(HtmlStyle.leftTop, frame);
contentTree.addContent(leftTop); contentTree.add(leftTop);
} }
/** /**
@ -196,7 +195,7 @@ public class FrameOutputWriter extends HtmlDocletWriter {
HtmlTree frame = HtmlTree.IFRAME(DocPaths.ALLCLASSES_FRAME.getPath(), HtmlTree frame = HtmlTree.IFRAME(DocPaths.ALLCLASSES_FRAME.getPath(),
"packageFrame", resources.getText("doclet.All_classes_and_interfaces")); "packageFrame", resources.getText("doclet.All_classes_and_interfaces"));
HtmlTree leftBottom = HtmlTree.DIV(HtmlStyle.leftBottom, frame); HtmlTree leftBottom = HtmlTree.DIV(HtmlStyle.leftBottom, frame);
contentTree.addContent(leftBottom); contentTree.add(leftBottom);
} }
/** /**
@ -208,7 +207,7 @@ public class FrameOutputWriter extends HtmlDocletWriter {
HtmlTree frame = HtmlTree.IFRAME(configuration.topFile.getPath(), "classFrame", HtmlTree frame = HtmlTree.IFRAME(configuration.topFile.getPath(), "classFrame",
resources.getText("doclet.Package_class_and_interface_descriptions")); resources.getText("doclet.Package_class_and_interface_descriptions"));
frame.setStyle(HtmlStyle.rightIframe); frame.setStyle(HtmlStyle.rightIframe);
contentTree.addContent(frame); contentTree.add(frame);
} }
/** /**

View File

@ -91,14 +91,14 @@ public class HelpWriter extends HtmlDocletWriter {
HtmlTree htmlTree = HtmlTree.HEADER(); HtmlTree htmlTree = HtmlTree.HEADER();
addTop(htmlTree); addTop(htmlTree);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.addContent(navBar.getContent(true)); htmlTree.add(navBar.getContent(true));
body.addContent(htmlTree); body.add(htmlTree);
addHelpFileContents(body); addHelpFileContents(body);
htmlTree = HtmlTree.FOOTER(); htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.addContent(navBar.getContent(false)); htmlTree.add(navBar.getContent(false));
addBottom(htmlTree); addBottom(htmlTree);
body.addContent(htmlTree); body.add(htmlTree);
printHtmlDocument(null, "help", body); printHtmlDocument(null, "help", body);
} }
@ -117,8 +117,8 @@ public class HelpWriter extends HtmlDocletWriter {
Content div = HtmlTree.DIV(HtmlStyle.header, heading); Content div = HtmlTree.DIV(HtmlStyle.header, heading);
Content intro = HtmlTree.DIV(HtmlStyle.subTitle, Content intro = HtmlTree.DIV(HtmlStyle.subTitle,
contents.getContent("doclet.help.intro")); contents.getContent("doclet.help.intro"));
div.addContent(intro); div.add(intro);
mainTree.addContent(div); mainTree.add(div);
HtmlTree htmlTree; HtmlTree htmlTree;
HtmlTree ul = new HtmlTree(HtmlTag.UL); HtmlTree ul = new HtmlTree(HtmlTag.UL);
ul.setStyle(HtmlStyle.blockList); ul.setStyle(HtmlStyle.blockList);
@ -136,8 +136,8 @@ public class HelpWriter extends HtmlDocletWriter {
resources.getText("doclet.Overview")); resources.getText("doclet.Overview"));
Content overviewBody = contents.getContent(overviewKey, overviewLink); Content overviewBody = contents.getContent(overviewKey, overviewLink);
Content overviewPara = HtmlTree.P(overviewBody); Content overviewPara = HtmlTree.P(overviewBody);
htmlTree.addContent(overviewPara); htmlTree.add(overviewPara);
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
} }
// Module // Module
@ -147,13 +147,13 @@ public class HelpWriter extends HtmlDocletWriter {
htmlTree = HtmlTree.SECTION(moduleHead); htmlTree = HtmlTree.SECTION(moduleHead);
Content moduleIntro = contents.getContent("doclet.help.module.intro"); Content moduleIntro = contents.getContent("doclet.help.module.intro");
Content modulePara = HtmlTree.P(moduleIntro); Content modulePara = HtmlTree.P(moduleIntro);
htmlTree.addContent(modulePara); htmlTree.add(modulePara);
HtmlTree ulModule = new HtmlTree(HtmlTag.UL); HtmlTree ulModule = new HtmlTree(HtmlTag.UL);
ulModule.addContent(HtmlTree.LI(contents.packagesLabel)); ulModule.add(HtmlTree.LI(contents.packagesLabel));
ulModule.addContent(HtmlTree.LI(contents.modulesLabel)); ulModule.add(HtmlTree.LI(contents.modulesLabel));
ulModule.addContent(HtmlTree.LI(contents.servicesLabel)); ulModule.add(HtmlTree.LI(contents.servicesLabel));
htmlTree.addContent(ulModule); htmlTree.add(ulModule);
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
} }
// Package // Package
@ -162,16 +162,16 @@ public class HelpWriter extends HtmlDocletWriter {
htmlTree = HtmlTree.SECTION(packageHead); htmlTree = HtmlTree.SECTION(packageHead);
Content packageIntro = contents.getContent("doclet.help.package.intro"); Content packageIntro = contents.getContent("doclet.help.package.intro");
Content packagePara = HtmlTree.P(packageIntro); Content packagePara = HtmlTree.P(packageIntro);
htmlTree.addContent(packagePara); htmlTree.add(packagePara);
HtmlTree ulPackage = new HtmlTree(HtmlTag.UL); HtmlTree ulPackage = new HtmlTree(HtmlTag.UL);
ulPackage.addContent(HtmlTree.LI(contents.interfaces)); ulPackage.add(HtmlTree.LI(contents.interfaces));
ulPackage.addContent(HtmlTree.LI(contents.classes)); ulPackage.add(HtmlTree.LI(contents.classes));
ulPackage.addContent(HtmlTree.LI(contents.enums)); ulPackage.add(HtmlTree.LI(contents.enums));
ulPackage.addContent(HtmlTree.LI(contents.exceptions)); ulPackage.add(HtmlTree.LI(contents.exceptions));
ulPackage.addContent(HtmlTree.LI(contents.errors)); ulPackage.add(HtmlTree.LI(contents.errors));
ulPackage.addContent(HtmlTree.LI(contents.annotationTypes)); ulPackage.add(HtmlTree.LI(contents.annotationTypes));
htmlTree.addContent(ulPackage); htmlTree.add(ulPackage);
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
// Class/interface // Class/interface
Content classHead = HtmlTree.HEADING(Headings.CONTENT_HEADING, Content classHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
@ -179,34 +179,34 @@ public class HelpWriter extends HtmlDocletWriter {
htmlTree = HtmlTree.SECTION(classHead); htmlTree = HtmlTree.SECTION(classHead);
Content classIntro = contents.getContent("doclet.help.class_interface.intro"); Content classIntro = contents.getContent("doclet.help.class_interface.intro");
Content classPara = HtmlTree.P(classIntro); Content classPara = HtmlTree.P(classIntro);
htmlTree.addContent(classPara); htmlTree.add(classPara);
HtmlTree ul1 = new HtmlTree(HtmlTag.UL); HtmlTree ul1 = new HtmlTree(HtmlTag.UL);
ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.inheritance_diagram"))); ul1.add(HtmlTree.LI(contents.getContent("doclet.help.class_interface.inheritance_diagram")));
ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.subclasses"))); ul1.add(HtmlTree.LI(contents.getContent("doclet.help.class_interface.subclasses")));
ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.subinterfaces"))); ul1.add(HtmlTree.LI(contents.getContent("doclet.help.class_interface.subinterfaces")));
ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.implementations"))); ul1.add(HtmlTree.LI(contents.getContent("doclet.help.class_interface.implementations")));
ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.declaration"))); ul1.add(HtmlTree.LI(contents.getContent("doclet.help.class_interface.declaration")));
ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.description"))); ul1.add(HtmlTree.LI(contents.getContent("doclet.help.class_interface.description")));
htmlTree.addContent(ul1); htmlTree.add(ul1);
htmlTree.addContent(new HtmlTree(HtmlTag.BR)); htmlTree.add(new HtmlTree(HtmlTag.BR));
HtmlTree ul2 = new HtmlTree(HtmlTag.UL); HtmlTree ul2 = new HtmlTree(HtmlTag.UL);
ul2.addContent(HtmlTree.LI(contents.nestedClassSummary)); ul2.add(HtmlTree.LI(contents.nestedClassSummary));
ul2.addContent(HtmlTree.LI(contents.fieldSummaryLabel)); ul2.add(HtmlTree.LI(contents.fieldSummaryLabel));
ul2.addContent(HtmlTree.LI(contents.propertySummaryLabel)); ul2.add(HtmlTree.LI(contents.propertySummaryLabel));
ul2.addContent(HtmlTree.LI(contents.constructorSummaryLabel)); ul2.add(HtmlTree.LI(contents.constructorSummaryLabel));
ul2.addContent(HtmlTree.LI(contents.methodSummary)); ul2.add(HtmlTree.LI(contents.methodSummary));
htmlTree.addContent(ul2); htmlTree.add(ul2);
htmlTree.addContent(new HtmlTree(HtmlTag.BR)); htmlTree.add(new HtmlTree(HtmlTag.BR));
HtmlTree ul3 = new HtmlTree(HtmlTag.UL); HtmlTree ul3 = new HtmlTree(HtmlTag.UL);
ul3.addContent(HtmlTree.LI(contents.fieldDetailsLabel)); ul3.add(HtmlTree.LI(contents.fieldDetailsLabel));
ul3.addContent(HtmlTree.LI(contents.propertyDetailsLabel)); ul3.add(HtmlTree.LI(contents.propertyDetailsLabel));
ul3.addContent(HtmlTree.LI(contents.constructorDetailsLabel)); ul3.add(HtmlTree.LI(contents.constructorDetailsLabel));
ul3.addContent(HtmlTree.LI(contents.methodDetailLabel)); ul3.add(HtmlTree.LI(contents.methodDetailLabel));
htmlTree.addContent(ul3); htmlTree.add(ul3);
Content classSummary = contents.getContent("doclet.help.class_interface.summary"); Content classSummary = contents.getContent("doclet.help.class_interface.summary");
Content para = HtmlTree.P(classSummary); Content para = HtmlTree.P(classSummary);
htmlTree.addContent(para); htmlTree.add(para);
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
// Annotation Types // Annotation Types
Content aHead = HtmlTree.HEADING(Headings.CONTENT_HEADING, Content aHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
@ -214,29 +214,29 @@ public class HelpWriter extends HtmlDocletWriter {
htmlTree = HtmlTree.SECTION(aHead); htmlTree = HtmlTree.SECTION(aHead);
Content aIntro = contents.getContent("doclet.help.annotation_type.intro"); Content aIntro = contents.getContent("doclet.help.annotation_type.intro");
Content aPara = HtmlTree.P(aIntro); Content aPara = HtmlTree.P(aIntro);
htmlTree.addContent(aPara); htmlTree.add(aPara);
HtmlTree aul = new HtmlTree(HtmlTag.UL); HtmlTree aul = new HtmlTree(HtmlTag.UL);
aul.addContent(HtmlTree.LI(contents.getContent("doclet.help.annotation_type.declaration"))); aul.add(HtmlTree.LI(contents.getContent("doclet.help.annotation_type.declaration")));
aul.addContent(HtmlTree.LI(contents.getContent("doclet.help.annotation_type.description"))); aul.add(HtmlTree.LI(contents.getContent("doclet.help.annotation_type.description")));
aul.addContent(HtmlTree.LI(contents.annotateTypeRequiredMemberSummaryLabel)); aul.add(HtmlTree.LI(contents.annotateTypeRequiredMemberSummaryLabel));
aul.addContent(HtmlTree.LI(contents.annotateTypeOptionalMemberSummaryLabel)); aul.add(HtmlTree.LI(contents.annotateTypeOptionalMemberSummaryLabel));
aul.addContent(HtmlTree.LI(contents.annotationTypeMemberDetail)); aul.add(HtmlTree.LI(contents.annotationTypeMemberDetail));
htmlTree.addContent(aul); htmlTree.add(aul);
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
// Enums // Enums
Content enumHead = HtmlTree.HEADING(Headings.CONTENT_HEADING, contents.enum_); Content enumHead = HtmlTree.HEADING(Headings.CONTENT_HEADING, contents.enum_);
htmlTree = HtmlTree.SECTION(enumHead); htmlTree = HtmlTree.SECTION(enumHead);
Content eIntro = contents.getContent("doclet.help.enum.intro"); Content eIntro = contents.getContent("doclet.help.enum.intro");
Content enumPara = HtmlTree.P(eIntro); Content enumPara = HtmlTree.P(eIntro);
htmlTree.addContent(enumPara); htmlTree.add(enumPara);
HtmlTree eul = new HtmlTree(HtmlTag.UL); HtmlTree eul = new HtmlTree(HtmlTag.UL);
eul.addContent(HtmlTree.LI(contents.getContent("doclet.help.enum.declaration"))); eul.add(HtmlTree.LI(contents.getContent("doclet.help.enum.declaration")));
eul.addContent(HtmlTree.LI(contents.getContent("doclet.help.enum.definition"))); eul.add(HtmlTree.LI(contents.getContent("doclet.help.enum.definition")));
eul.addContent(HtmlTree.LI(contents.enumConstantSummary)); eul.add(HtmlTree.LI(contents.enumConstantSummary));
eul.addContent(HtmlTree.LI(contents.enumConstantDetailLabel)); eul.add(HtmlTree.LI(contents.enumConstantDetailLabel));
htmlTree.addContent(eul); htmlTree.add(eul);
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
// Class Use // Class Use
if (configuration.classuse) { if (configuration.classuse) {
@ -245,8 +245,8 @@ public class HelpWriter extends HtmlDocletWriter {
htmlTree = HtmlTree.SECTION(useHead); htmlTree = HtmlTree.SECTION(useHead);
Content useBody = contents.getContent("doclet.help.use.body"); Content useBody = contents.getContent("doclet.help.use.body");
Content usePara = HtmlTree.P(useBody); Content usePara = HtmlTree.P(useBody);
htmlTree.addContent(usePara); htmlTree.add(usePara);
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
} }
// Tree // Tree
@ -259,12 +259,12 @@ public class HelpWriter extends HtmlDocletWriter {
resources.getText("doclet.Class_Hierarchy")), resources.getText("doclet.Class_Hierarchy")),
HtmlTree.CODE(new StringContent("java.lang.Object"))); HtmlTree.CODE(new StringContent("java.lang.Object")));
Content treePara = HtmlTree.P(treeIntro); Content treePara = HtmlTree.P(treeIntro);
htmlTree.addContent(treePara); htmlTree.add(treePara);
HtmlTree tul = new HtmlTree(HtmlTag.UL); HtmlTree tul = new HtmlTree(HtmlTag.UL);
tul.addContent(HtmlTree.LI(contents.getContent("doclet.help.tree.overview"))); tul.add(HtmlTree.LI(contents.getContent("doclet.help.tree.overview")));
tul.addContent(HtmlTree.LI(contents.getContent("doclet.help.tree.package"))); tul.add(HtmlTree.LI(contents.getContent("doclet.help.tree.package")));
htmlTree.addContent(tul); htmlTree.add(tul);
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
} }
// Deprecated // Deprecated
@ -276,8 +276,8 @@ public class HelpWriter extends HtmlDocletWriter {
links.createLink(DocPaths.DEPRECATED_LIST, links.createLink(DocPaths.DEPRECATED_LIST,
resources.getText("doclet.Deprecated_API"))); resources.getText("doclet.Deprecated_API")));
Content dPara = HtmlTree.P(deprBody); Content dPara = HtmlTree.P(deprBody);
htmlTree.addContent(dPara); htmlTree.add(dPara);
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
} }
// Index // Index
@ -295,8 +295,8 @@ public class HelpWriter extends HtmlDocletWriter {
htmlTree = HtmlTree.SECTION(indexHead); htmlTree = HtmlTree.SECTION(indexHead);
Content indexBody = contents.getContent("doclet.help.index.body", indexlink); Content indexBody = contents.getContent("doclet.help.index.body", indexlink);
Content indexPara = HtmlTree.P(indexBody); Content indexPara = HtmlTree.P(indexBody);
htmlTree.addContent(indexPara); htmlTree.add(indexPara);
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
} }
// Frames // Frames
@ -306,9 +306,9 @@ public class HelpWriter extends HtmlDocletWriter {
htmlTree = HtmlTree.SECTION(frameHead); htmlTree = HtmlTree.SECTION(frameHead);
Content framesBody = contents.getContent("doclet.help.frames.body"); Content framesBody = contents.getContent("doclet.help.frames.body");
Content framePara = HtmlTree.P(framesBody); Content framePara = HtmlTree.P(framesBody);
htmlTree.addContent(framePara); htmlTree.add(framePara);
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
} }
// Serialized Form // Serialized Form
@ -317,8 +317,8 @@ public class HelpWriter extends HtmlDocletWriter {
htmlTree = HtmlTree.SECTION(sHead); htmlTree = HtmlTree.SECTION(sHead);
Content serialBody = contents.getContent("doclet.help.serial_form.body"); Content serialBody = contents.getContent("doclet.help.serial_form.body");
Content serialPara = HtmlTree.P(serialBody); Content serialPara = HtmlTree.P(serialBody);
htmlTree.addContent(serialPara); htmlTree.add(serialPara);
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
// Constant Field Values // Constant Field Values
Content constHead = HtmlTree.HEADING(Headings.CONTENT_HEADING, Content constHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
@ -328,8 +328,8 @@ public class HelpWriter extends HtmlDocletWriter {
links.createLink(DocPaths.CONSTANT_VALUES, links.createLink(DocPaths.CONSTANT_VALUES,
resources.getText("doclet.Constants_Summary"))); resources.getText("doclet.Constants_Summary")));
Content constPara = HtmlTree.P(constantsBody); Content constPara = HtmlTree.P(constantsBody);
htmlTree.addContent(constPara); htmlTree.add(constPara);
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
// Search // Search
Content searchHead = HtmlTree.HEADING(Headings.CONTENT_HEADING, Content searchHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
@ -337,15 +337,15 @@ public class HelpWriter extends HtmlDocletWriter {
htmlTree = HtmlTree.SECTION(searchHead); htmlTree = HtmlTree.SECTION(searchHead);
Content searchBody = contents.getContent("doclet.help.search.body"); Content searchBody = contents.getContent("doclet.help.search.body");
Content searchPara = HtmlTree.P(searchBody); Content searchPara = HtmlTree.P(searchBody);
htmlTree.addContent(searchPara); htmlTree.add(searchPara);
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
Content divContent = HtmlTree.DIV(HtmlStyle.contentContainer, ul); Content divContent = HtmlTree.DIV(HtmlStyle.contentContainer, ul);
divContent.addContent(new HtmlTree(HtmlTag.HR)); divContent.add(new HtmlTree(HtmlTag.HR));
Content footnote = HtmlTree.SPAN(HtmlStyle.emphasizedPhrase, Content footnote = HtmlTree.SPAN(HtmlStyle.emphasizedPhrase,
contents.getContent("doclet.help.footnote")); contents.getContent("doclet.help.footnote"));
divContent.addContent(footnote); divContent.add(footnote);
mainTree.addContent(divContent); mainTree.add(divContent);
contentTree.addContent(mainTree); contentTree.add(mainTree);
} }
} }

View File

@ -30,7 +30,6 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr;
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader; import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
import java.util.*; import java.util.*;
import java.util.function.Supplier;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -72,7 +71,6 @@ import com.sun.source.doctree.TextTree;
import com.sun.source.util.SimpleDocTreeVisitor; import com.sun.source.util.SimpleDocTreeVisitor;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.DocType;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlDocument; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlDocument;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
@ -287,7 +285,7 @@ public class HtmlDocletWriter {
Content div = HtmlTree.DIV(script.asContent()); Content div = HtmlTree.DIV(script.asContent());
Content div_noscript = HtmlTree.DIV(contents.noScriptMessage); Content div_noscript = HtmlTree.DIV(contents.noScriptMessage);
Content noScript = HtmlTree.NOSCRIPT(div_noscript); Content noScript = HtmlTree.NOSCRIPT(div_noscript);
div.addContent(noScript); div.add(noScript);
return div; return div;
} }
@ -336,8 +334,8 @@ public class HtmlDocletWriter {
TagletWriter.genTagOutput(configuration.tagletManager, e, TagletWriter.genTagOutput(configuration.tagletManager, e,
configuration.tagletManager.getBlockTaglets(e), configuration.tagletManager.getBlockTaglets(e),
getTagletWriterInstance(false), output); getTagletWriterInstance(false), output);
dl.addContent(output); dl.add(output);
htmltree.addContent(dl); htmltree.add(dl);
} }
/** /**
@ -509,7 +507,7 @@ public class HtmlDocletWriter {
*/ */
public void addTop(Content htmlTree) { public void addTop(Content htmlTree) {
Content top = new RawHtml(replaceDocRootDir(configuration.top)); Content top = new RawHtml(replaceDocRootDir(configuration.top));
fixedNavDiv.addContent(top); fixedNavDiv.add(top);
} }
/** /**
@ -521,7 +519,7 @@ public class HtmlDocletWriter {
Content bottom = new RawHtml(replaceDocRootDir(configuration.bottom)); Content bottom = new RawHtml(replaceDocRootDir(configuration.bottom));
Content small = HtmlTree.SMALL(bottom); Content small = HtmlTree.SMALL(bottom);
Content p = HtmlTree.P(HtmlStyle.legalCopy, small); Content p = HtmlTree.P(HtmlStyle.legalCopy, small);
htmlTree.addContent(p); htmlTree.add(p);
} }
/** /**
@ -548,7 +546,7 @@ public class HtmlDocletWriter {
Content space = Contents.SPACE; Content space = Contents.SPACE;
Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, space); Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, space);
Content caption = HtmlTree.CAPTION(captionSpan); Content caption = HtmlTree.CAPTION(captionSpan);
caption.addContent(tabSpan); caption.add(tabSpan);
return caption; return caption;
} }
@ -699,9 +697,9 @@ public class HtmlDocletWriter {
.resolve(docPaths.forClass(te)); .resolve(docPaths.forClass(te));
Content content = links.createLink(href Content content = links.createLink(href
.fragment(SourceToHTMLConverter.getAnchorName(utils, element)), label, "", ""); .fragment(SourceToHTMLConverter.getAnchorName(utils, element)), label, "", "");
htmltree.addContent(content); htmltree.add(content);
} else { } else {
htmltree.addContent(label); htmltree.add(label);
} }
} }
@ -823,9 +821,9 @@ public class HtmlDocletWriter {
ContentBuilder classlink = new ContentBuilder(); ContentBuilder classlink = new ContentBuilder();
PackageElement pkg = utils.containingPackage(typeElement); PackageElement pkg = utils.containingPackage(typeElement);
if (pkg != null && ! configuration.shouldExcludeQualifier(pkg.getSimpleName().toString())) { if (pkg != null && ! configuration.shouldExcludeQualifier(pkg.getSimpleName().toString())) {
classlink.addContent(getEnclosingPackageName(typeElement)); classlink.add(getEnclosingPackageName(typeElement));
} }
classlink.addContent(getLink(new LinkInfoImpl(configuration, classlink.add(getLink(new LinkInfoImpl(configuration,
context, typeElement).label(utils.getSimpleName(typeElement)).strong(isStrong))); context, typeElement).label(utils.getSimpleName(typeElement)).strong(isStrong)));
return classlink; return classlink;
} }
@ -844,13 +842,13 @@ public class HtmlDocletWriter {
TypeElement typeElement, boolean isStrong, Content contentTree) { TypeElement typeElement, boolean isStrong, Content contentTree) {
PackageElement pkg = utils.containingPackage(typeElement); PackageElement pkg = utils.containingPackage(typeElement);
if(pkg != null && ! configuration.shouldExcludeQualifier(pkg.getSimpleName().toString())) { if(pkg != null && ! configuration.shouldExcludeQualifier(pkg.getSimpleName().toString())) {
contentTree.addContent(getEnclosingPackageName(typeElement)); contentTree.add(getEnclosingPackageName(typeElement));
} }
LinkInfoImpl linkinfo = new LinkInfoImpl(configuration, context, typeElement) LinkInfoImpl linkinfo = new LinkInfoImpl(configuration, context, typeElement)
.label(utils.getSimpleName(typeElement)) .label(utils.getSimpleName(typeElement))
.strong(isStrong); .strong(isStrong);
Content link = getLink(linkinfo); Content link = getLink(linkinfo);
contentTree.addContent(link); contentTree.add(link);
} }
/** /**
@ -1262,14 +1260,14 @@ public class HtmlDocletWriter {
Content result = commentTagsToContent(null, element, tags, first, inSummary); Content result = commentTagsToContent(null, element, tags, first, inSummary);
if (depr) { if (depr) {
div = HtmlTree.DIV(HtmlStyle.deprecationComment, result); div = HtmlTree.DIV(HtmlStyle.deprecationComment, result);
htmltree.addContent(div); htmltree.add(div);
} }
else { else {
div = HtmlTree.DIV(HtmlStyle.block, result); div = HtmlTree.DIV(HtmlStyle.block, result);
htmltree.addContent(div); htmltree.add(div);
} }
if (tags.isEmpty()) { if (tags.isEmpty()) {
htmltree.addContent(Contents.SPACE); htmltree.add(Contents.SPACE);
} }
} }
@ -1341,8 +1339,8 @@ public class HtmlDocletWriter {
final Content result = new ContentBuilder() { final Content result = new ContentBuilder() {
@Override @Override
public void addContent(CharSequence text) { public void add(CharSequence text) {
super.addContent(utils.normalizeNewlines(text)); super.add(utils.normalizeNewlines(text));
} }
}; };
CommentHelper ch = utils.getCommentHelper(element); CommentHelper ch = utils.getCommentHelper(element);
@ -1392,7 +1390,7 @@ public class HtmlDocletWriter {
public Boolean visitAttribute(AttributeTree node, Content c) { public Boolean visitAttribute(AttributeTree node, Content c) {
StringBuilder sb = new StringBuilder(SPACER).append(node.getName()); StringBuilder sb = new StringBuilder(SPACER).append(node.getName());
if (node.getValueKind() == ValueKind.EMPTY) { if (node.getValueKind() == ValueKind.EMPTY) {
result.addContent(sb); result.add(sb);
return false; return false;
} }
sb.append("="); sb.append("=");
@ -1409,7 +1407,7 @@ public class HtmlDocletWriter {
break; break;
} }
sb.append(quote); sb.append(quote);
result.addContent(sb); result.add(sb);
Content docRootContent = new ContentBuilder(); Content docRootContent = new ContentBuilder();
boolean isHRef = inAnAtag() && node.getName().toString().equalsIgnoreCase("href"); boolean isHRef = inAnAtag() && node.getName().toString().equalsIgnoreCase("href");
@ -1417,16 +1415,16 @@ public class HtmlDocletWriter {
if (utils.isText(dt) && isHRef) { if (utils.isText(dt) && isHRef) {
String text = ((TextTree) dt).getBody(); String text = ((TextTree) dt).getBody();
if (text.startsWith("/..") && !configuration.docrootparent.isEmpty()) { if (text.startsWith("/..") && !configuration.docrootparent.isEmpty()) {
result.addContent(configuration.docrootparent); result.add(configuration.docrootparent);
docRootContent = new ContentBuilder(); docRootContent = new ContentBuilder();
result.addContent(textCleanup(text.substring(3), isLastNode)); result.add(textCleanup(text.substring(3), isLastNode));
} else { } else {
if (!docRootContent.isEmpty()) { if (!docRootContent.isEmpty()) {
docRootContent = copyDocRootContent(docRootContent); docRootContent = copyDocRootContent(docRootContent);
} else { } else {
text = redirectRelativeLinks(element, (TextTree) dt); text = redirectRelativeLinks(element, (TextTree) dt);
} }
result.addContent(textCleanup(text, isLastNode)); result.add(textCleanup(text, isLastNode));
} }
} else { } else {
docRootContent = copyDocRootContent(docRootContent); docRootContent = copyDocRootContent(docRootContent);
@ -1434,19 +1432,19 @@ public class HtmlDocletWriter {
} }
} }
copyDocRootContent(docRootContent); copyDocRootContent(docRootContent);
result.addContent(quote); result.add(quote);
return false; return false;
} }
@Override @Override
public Boolean visitComment(CommentTree node, Content c) { public Boolean visitComment(CommentTree node, Content c) {
result.addContent(new RawHtml(node.getBody())); result.add(new RawHtml(node.getBody()));
return false; return false;
} }
private Content copyDocRootContent(Content content) { private Content copyDocRootContent(Content content) {
if (!content.isEmpty()) { if (!content.isEmpty()) {
result.addContent(content); result.add(content);
return new ContentBuilder(); return new ContentBuilder();
} }
return content; return content;
@ -1460,9 +1458,9 @@ public class HtmlDocletWriter {
node, node,
getTagletWriterInstance(isFirstSentence)); getTagletWriterInstance(isFirstSentence));
if (c != null) { if (c != null) {
c.addContent(docRootContent); c.add(docRootContent);
} else { } else {
result.addContent(docRootContent); result.add(docRootContent);
} }
return false; return false;
} }
@ -1470,13 +1468,13 @@ public class HtmlDocletWriter {
@Override @Override
public Boolean visitEndElement(EndElementTree node, Content c) { public Boolean visitEndElement(EndElementTree node, Content c) {
RawHtml rawHtml = new RawHtml("</" + node.getName() + ">"); RawHtml rawHtml = new RawHtml("</" + node.getName() + ">");
result.addContent(rawHtml); result.add(rawHtml);
return false; return false;
} }
@Override @Override
public Boolean visitEntity(EntityTree node, Content c) { public Boolean visitEntity(EntityTree node, Content c) {
result.addContent(new RawHtml(node.toString())); result.add(new RawHtml(node.toString()));
return false; return false;
} }
@ -1484,7 +1482,7 @@ public class HtmlDocletWriter {
public Boolean visitErroneous(ErroneousTree node, Content c) { public Boolean visitErroneous(ErroneousTree node, Content c) {
messages.warning(ch.getDocTreePath(node), messages.warning(ch.getDocTreePath(node),
"doclet.tag.invalid_usage", node); "doclet.tag.invalid_usage", node);
result.addContent(new RawHtml(node.toString())); result.add(new RawHtml(node.toString()));
return false; return false;
} }
@ -1493,7 +1491,7 @@ public class HtmlDocletWriter {
Content output = TagletWriter.getInlineTagOutput(element, Content output = TagletWriter.getInlineTagOutput(element,
configuration.tagletManager, holderTag, configuration.tagletManager, holderTag,
tag, getTagletWriterInstance(isFirstSentence)); tag, getTagletWriterInstance(isFirstSentence));
result.addContent(output); result.add(output);
// if we obtained the first sentence successfully, nothing more to do // if we obtained the first sentence successfully, nothing more to do
return (isFirstSentence && !output.isEmpty()); return (isFirstSentence && !output.isEmpty());
} }
@ -1504,7 +1502,7 @@ public class HtmlDocletWriter {
configuration.tagletManager, holderTag, tag, configuration.tagletManager, holderTag, tag,
getTagletWriterInstance(isFirstSentence, inSummary)); getTagletWriterInstance(isFirstSentence, inSummary));
if (output != null) { if (output != null) {
result.addContent(output); result.add(output);
} }
return false; return false;
} }
@ -1512,7 +1510,7 @@ public class HtmlDocletWriter {
@Override @Override
public Boolean visitLink(LinkTree node, Content c) { public Boolean visitLink(LinkTree node, Content c) {
// we need to pass the DocTreeImpl here, so ignore node // we need to pass the DocTreeImpl here, so ignore node
result.addContent(seeTagToContent(element, tag)); result.add(seeTagToContent(element, tag));
return false; return false;
} }
@ -1522,14 +1520,14 @@ public class HtmlDocletWriter {
Content content = new StringContent(utils.normalizeNewlines(s)); Content content = new StringContent(utils.normalizeNewlines(s));
if (node.getKind() == CODE) if (node.getKind() == CODE)
content = HtmlTree.CODE(content); content = HtmlTree.CODE(content);
result.addContent(content); result.add(content);
return false; return false;
} }
@Override @Override
public Boolean visitSee(SeeTree node, Content c) { public Boolean visitSee(SeeTree node, Content c) {
// we need to pass the DocTreeImpl here, so ignore node // we need to pass the DocTreeImpl here, so ignore node
result.addContent(seeTagToContent(element, tag)); result.add(seeTagToContent(element, tag));
return false; return false;
} }
@ -1537,12 +1535,12 @@ public class HtmlDocletWriter {
public Boolean visitStartElement(StartElementTree node, Content c) { public Boolean visitStartElement(StartElementTree node, Content c) {
String text = "<" + node.getName(); String text = "<" + node.getName();
RawHtml rawHtml = new RawHtml(utils.normalizeNewlines(text)); RawHtml rawHtml = new RawHtml(utils.normalizeNewlines(text));
result.addContent(rawHtml); result.add(rawHtml);
for (DocTree dt : node.getAttributes()) { for (DocTree dt : node.getAttributes()) {
dt.accept(this, null); dt.accept(this, null);
} }
result.addContent(new RawHtml(node.isSelfClosing() ? "/>" : ">")); result.add(new RawHtml(node.isSelfClosing() ? "/>" : ">"));
return false; return false;
} }
@ -1551,7 +1549,7 @@ public class HtmlDocletWriter {
Content output = TagletWriter.getInlineTagOutput(element, Content output = TagletWriter.getInlineTagOutput(element,
configuration.tagletManager, holderTag, tag, configuration.tagletManager, holderTag, tag,
getTagletWriterInstance(isFirstSentence)); getTagletWriterInstance(isFirstSentence));
result.addContent(output); result.add(output);
return false; return false;
} }
@ -1561,7 +1559,7 @@ public class HtmlDocletWriter {
configuration.tagletManager, holderTag, tag, configuration.tagletManager, holderTag, tag,
getTagletWriterInstance(isFirstSentence, inSummary)); getTagletWriterInstance(isFirstSentence, inSummary));
if (output != null) { if (output != null) {
result.addContent(output); result.add(output);
} }
return false; return false;
} }
@ -1584,7 +1582,7 @@ public class HtmlDocletWriter {
@Override @Override
public Boolean visitText(TextTree node, Content c) { public Boolean visitText(TextTree node, Content c) {
String text = node.getBody(); String text = node.getBody();
result.addContent(new RawHtml(textCleanup(text, isLastNode, commentRemoved))); result.add(new RawHtml(textCleanup(text, isLastNode, commentRemoved)));
return false; return false;
} }
@ -1594,7 +1592,7 @@ public class HtmlDocletWriter {
configuration.tagletManager, holderTag, tag, configuration.tagletManager, holderTag, tag,
getTagletWriterInstance(isFirstSentence)); getTagletWriterInstance(isFirstSentence));
if (output != null) { if (output != null) {
result.addContent(output); result.add(output);
} }
return false; return false;
} }
@ -1804,8 +1802,8 @@ public class HtmlDocletWriter {
return false; return false;
} }
for (Content annotation: annotations) { for (Content annotation: annotations) {
htmltree.addContent(sep); htmltree.add(sep);
htmltree.addContent(annotation); htmltree.add(annotation);
if (!lineBreak) { if (!lineBreak) {
sep = " "; sep = " ";
} }
@ -1894,8 +1892,8 @@ public class HtmlDocletWriter {
String sep = ""; String sep = "";
for (AnnotationValue av : annotationTypeValues) { for (AnnotationValue av : annotationTypeValues) {
annotation.addContent(sep); annotation.add(sep);
annotation.addContent(annotationValueToContent(av)); annotation.add(annotationValueToContent(av));
sep = " "; sep = " ";
} }
} }
@ -1918,8 +1916,8 @@ public class HtmlDocletWriter {
} }
String sep = ""; String sep = "";
for (AnnotationValue av : annotationTypeValues) { for (AnnotationValue av : annotationTypeValues) {
annotation.addContent(sep); annotation.add(sep);
annotation.addContent(annotationValueToContent(av)); annotation.add(annotationValueToContent(av));
sep = " "; sep = " ";
} }
} }
@ -1934,7 +1932,7 @@ public class HtmlDocletWriter {
addAnnotations(annotationElement, linkInfo, annotation, pairs, addAnnotations(annotationElement, linkInfo, annotation, pairs,
indent, linkBreak); indent, linkBreak);
} }
annotation.addContent(linkBreak ? DocletConstants.NL : ""); annotation.add(linkBreak ? DocletConstants.NL : "");
results.add(annotation); results.add(annotation);
} }
return results; return results;
@ -1955,10 +1953,10 @@ public class HtmlDocletWriter {
Map<? extends ExecutableElement, ? extends AnnotationValue> map, Map<? extends ExecutableElement, ? extends AnnotationValue> map,
int indent, boolean linkBreak) { int indent, boolean linkBreak) {
linkInfo.label = new StringContent("@"); linkInfo.label = new StringContent("@");
linkInfo.label.addContent(annotationDoc.getSimpleName()); linkInfo.label.add(annotationDoc.getSimpleName());
annotation.addContent(getLink(linkInfo)); annotation.add(getLink(linkInfo));
if (!map.isEmpty()) { if (!map.isEmpty()) {
annotation.addContent("("); annotation.add("(");
boolean isFirst = true; boolean isFirst = true;
Set<? extends ExecutableElement> keys = map.keySet(); Set<? extends ExecutableElement> keys = map.keySet();
boolean multipleValues = keys.size() > 1; boolean multipleValues = keys.size() > 1;
@ -1966,20 +1964,20 @@ public class HtmlDocletWriter {
if (isFirst) { if (isFirst) {
isFirst = false; isFirst = false;
} else { } else {
annotation.addContent(","); annotation.add(",");
if (linkBreak) { if (linkBreak) {
annotation.addContent(DocletConstants.NL); annotation.add(DocletConstants.NL);
int spaces = annotationDoc.getSimpleName().length() + 2; int spaces = annotationDoc.getSimpleName().length() + 2;
for (int k = 0; k < (spaces + indent); k++) { for (int k = 0; k < (spaces + indent); k++) {
annotation.addContent(" "); annotation.add(" ");
} }
} }
} }
String simpleName = element.getSimpleName().toString(); String simpleName = element.getSimpleName().toString();
if (multipleValues || !"value".equals(simpleName)) { // Omit "value=" where unnecessary if (multipleValues || !"value".equals(simpleName)) { // Omit "value=" where unnecessary
annotation.addContent(getDocLink(LinkInfoImpl.Kind.ANNOTATION, annotation.add(getDocLink(LinkInfoImpl.Kind.ANNOTATION,
element, simpleName, false)); element, simpleName, false));
annotation.addContent("="); annotation.add("=");
} }
AnnotationValue annotationValue = map.get(element); AnnotationValue annotationValue = map.get(element);
List<AnnotationValue> annotationTypeValues = new ArrayList<>(); List<AnnotationValue> annotationTypeValues = new ArrayList<>();
@ -1995,17 +1993,17 @@ public class HtmlDocletWriter {
return null; return null;
} }
}.visit(annotationValue, annotationValue); }.visit(annotationValue, annotationValue);
annotation.addContent(annotationTypeValues.size() == 1 ? "" : "{"); annotation.add(annotationTypeValues.size() == 1 ? "" : "{");
String sep = ""; String sep = "";
for (AnnotationValue av : annotationTypeValues) { for (AnnotationValue av : annotationTypeValues) {
annotation.addContent(sep); annotation.add(sep);
annotation.addContent(annotationValueToContent(av)); annotation.add(annotationValueToContent(av));
sep = ","; sep = ",";
} }
annotation.addContent(annotationTypeValues.size() == 1 ? "" : "}"); annotation.add(annotationTypeValues.size() == 1 ? "" : "}");
isContainerDocumented = false; isContainerDocumented = false;
} }
annotation.addContent(")"); annotation.add(")");
} }
} }
@ -2086,7 +2084,7 @@ public class HtmlDocletWriter {
List<Content> list = getAnnotations(0, a, false); List<Content> list = getAnnotations(0, a, false);
ContentBuilder buf = new ContentBuilder(); ContentBuilder buf = new ContentBuilder();
for (Content c : list) { for (Content c : list) {
buf.addContent(c); buf.add(c);
} }
return buf; return buf;
} }
@ -2100,8 +2098,8 @@ public class HtmlDocletWriter {
ContentBuilder buf = new ContentBuilder(); ContentBuilder buf = new ContentBuilder();
String sep = ""; String sep = "";
for (AnnotationValue av : vals) { for (AnnotationValue av : vals) {
buf.addContent(sep); buf.add(sep);
buf.addContent(visit(av)); buf.add(visit(av));
sep = " "; sep = " ";
} }
return buf; return buf;
@ -2198,7 +2196,7 @@ public class HtmlDocletWriter {
*/ */
public HtmlTree getBody(boolean includeScript, String title) { public HtmlTree getBody(boolean includeScript, String title) {
HtmlTree body = new HtmlTree(HtmlTag.BODY); HtmlTree body = new HtmlTree(HtmlTag.BODY);
body.addAttr(HtmlAttr.CLASS, getBodyClass()); body.put(HtmlAttr.CLASS, getBodyClass());
// Set window title string which is later printed // Set window title string which is later printed
this.winTitle = title; this.winTitle = title;
@ -2206,9 +2204,9 @@ public class HtmlDocletWriter {
// and package-frame // and package-frame
if (includeScript) { if (includeScript) {
this.mainBodyScript = getWinTitleScript(); this.mainBodyScript = getWinTitleScript();
body.addContent(mainBodyScript.asContent()); body.add(mainBodyScript.asContent());
Content noScript = HtmlTree.NOSCRIPT(HtmlTree.DIV(contents.noScriptMessage)); Content noScript = HtmlTree.NOSCRIPT(HtmlTree.DIV(contents.noScriptMessage));
body.addContent(noScript); body.add(noScript);
} }
return body; return body;
} }
@ -2236,7 +2234,7 @@ public class HtmlDocletWriter {
configuration.localStylesheetMap.put(element, localStylesheets); configuration.localStylesheetMap.put(element, localStylesheets);
} }
for (DocPath stylesheet : localStylesheets) { for (DocPath stylesheet : localStylesheets) {
stylesheetContent.addContent(HtmlTree.LINK("stylesheet", stylesheetContent.add(HtmlTree.LINK("stylesheet",
"text/css", stylesheet.getPath(), "Style")); "text/css", stylesheet.getPath(), "Style"));
} }
return stylesheetContent; return stylesheetContent;

View File

@ -108,8 +108,8 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl
if (serializableFieldsTree.isValid()) { if (serializableFieldsTree.isValid()) {
Content headingContent = new StringContent(heading); Content headingContent = new StringContent(heading);
Content serialHeading = HtmlTree.HEADING(Headings.SerializedForm.CLASS_SUBHEADING, headingContent); Content serialHeading = HtmlTree.HEADING(Headings.SerializedForm.CLASS_SUBHEADING, headingContent);
li.addContent(serialHeading); li.add(serialHeading);
li.addContent(serializableFieldsTree); li.add(serializableFieldsTree);
} }
return li; return li;
} }
@ -119,32 +119,32 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl
String fieldDimensions, String fieldName, Content contentTree) { String fieldDimensions, String fieldName, Content contentTree) {
Content nameContent = new StringContent(fieldName); Content nameContent = new StringContent(fieldName);
Content heading = HtmlTree.HEADING(Headings.SerializedForm.MEMBER_HEADING, nameContent); Content heading = HtmlTree.HEADING(Headings.SerializedForm.MEMBER_HEADING, nameContent);
contentTree.addContent(heading); contentTree.add(heading);
Content pre = new HtmlTree(HtmlTag.PRE); Content pre = new HtmlTree(HtmlTag.PRE);
if (fieldType == null) { if (fieldType == null) {
pre.addContent(fieldTypeStr); pre.add(fieldTypeStr);
} else { } else {
Content fieldContent = writer.getLink(new LinkInfoImpl( Content fieldContent = writer.getLink(new LinkInfoImpl(
configuration, LinkInfoImpl.Kind.SERIAL_MEMBER, fieldType)); configuration, LinkInfoImpl.Kind.SERIAL_MEMBER, fieldType));
pre.addContent(fieldContent); pre.add(fieldContent);
} }
pre.addContent(fieldDimensions + " "); pre.add(fieldDimensions + " ");
pre.addContent(fieldName); pre.add(fieldName);
contentTree.addContent(pre); contentTree.add(pre);
} }
@Override @Override
public void addMemberHeader(TypeMirror fieldType, String fieldName, Content contentTree) { public void addMemberHeader(TypeMirror fieldType, String fieldName, Content contentTree) {
Content nameContent = new StringContent(fieldName); Content nameContent = new StringContent(fieldName);
Content heading = HtmlTree.HEADING(HtmlTag.H5, nameContent); Content heading = HtmlTree.HEADING(HtmlTag.H5, nameContent);
contentTree.addContent(heading); contentTree.add(heading);
Content pre = new HtmlTree(HtmlTag.PRE); Content pre = new HtmlTree(HtmlTag.PRE);
Content fieldContent = writer.getLink(new LinkInfoImpl( Content fieldContent = writer.getLink(new LinkInfoImpl(
configuration, LinkInfoImpl.Kind.SERIAL_MEMBER, fieldType)); configuration, LinkInfoImpl.Kind.SERIAL_MEMBER, fieldType));
pre.addContent(fieldContent); pre.add(fieldContent);
pre.addContent(" "); pre.add(" ");
pre.addContent(fieldName); pre.add(fieldName);
contentTree.addContent(pre); contentTree.add(pre);
} }
/** /**
@ -185,7 +185,7 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl
if (!description.isEmpty()) { if (!description.isEmpty()) {
Content serialFieldContent = new RawHtml(ch.getText(description)); Content serialFieldContent = new RawHtml(ch.getText(description));
Content div = HtmlTree.DIV(HtmlStyle.block, serialFieldContent); Content div = HtmlTree.DIV(HtmlStyle.block, serialFieldContent);
contentTree.addContent(div); contentTree.add(div);
} }
} }
@ -201,8 +201,8 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl
configuration.tagletManager.getBlockTaglets(field), configuration.tagletManager.getBlockTaglets(field),
writer.getTagletWriterInstance(false), tagContent); writer.getTagletWriterInstance(false), tagContent);
Content dlTags = new HtmlTree(HtmlTag.DL); Content dlTags = new HtmlTree(HtmlTag.DL);
dlTags.addContent(tagContent); dlTags.add(tagContent);
contentTree.addContent(dlTags); // TODO: what if empty? contentTree.add(dlTags); // TODO: what if empty?
} }
/** /**

View File

@ -96,7 +96,7 @@ public class HtmlSerialMethodWriter extends MethodWriterImpl implements
Content headingContent = new StringContent(heading); Content headingContent = new StringContent(heading);
Content serialHeading = HtmlTree.HEADING(Headings.SerializedForm.CLASS_SUBHEADING, headingContent); Content serialHeading = HtmlTree.HEADING(Headings.SerializedForm.CLASS_SUBHEADING, headingContent);
Content li = HtmlTree.LI(HtmlStyle.blockList, serialHeading); Content li = HtmlTree.LI(HtmlStyle.blockList, serialHeading);
li.addContent(serializableMethodContent); li.add(serializableMethodContent);
return li; return li;
} }
@ -120,8 +120,8 @@ public class HtmlSerialMethodWriter extends MethodWriterImpl implements
public void addMemberHeader(ExecutableElement member, Content methodsContentTree) { public void addMemberHeader(ExecutableElement member, Content methodsContentTree) {
Content memberContent = new StringContent(name(member)); Content memberContent = new StringContent(name(member));
Content heading = HtmlTree.HEADING(Headings.SerializedForm.MEMBER_HEADING, memberContent); Content heading = HtmlTree.HEADING(Headings.SerializedForm.MEMBER_HEADING, memberContent);
methodsContentTree.addContent(heading); methodsContentTree.add(heading);
methodsContentTree.addContent(getSignature(member)); methodsContentTree.add(getSignature(member));
} }
/** /**
@ -158,8 +158,8 @@ public class HtmlSerialMethodWriter extends MethodWriterImpl implements
tagletManager.getSerializedFormTaglets(), tagletManager.getSerializedFormTaglets(),
writer.getTagletWriterInstance(false), tagContent); writer.getTagletWriterInstance(false), tagContent);
Content dlTags = new HtmlTree(HtmlTag.DL); Content dlTags = new HtmlTree(HtmlTag.DL);
dlTags.addContent(tagContent); dlTags.add(tagContent);
methodsContentTree.addContent(dlTags); methodsContentTree.add(dlTags);
if (name(member).compareTo("writeExternal") == 0 if (name(member).compareTo("writeExternal") == 0
&& utils.getSerialDataTrees(member).isEmpty()) { && utils.getSerialDataTrees(member).isEmpty()) {
serialWarning(member, "doclet.MissingSerialDataTag", serialWarning(member, "doclet.MissingSerialDataTag",

View File

@ -29,7 +29,6 @@ import java.util.Collections;
import jdk.javadoc.internal.doclets.formats.html.markup.Head; import jdk.javadoc.internal.doclets.formats.html.markup.Head;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.DocType;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlDocument; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlDocument;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
@ -42,8 +41,6 @@ import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
import jdk.javadoc.internal.doclets.toolkit.util.DocPath; import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
import java.util.Collections;
/** /**
* Writes a file that tries to redirect to an alternate page. * Writes a file that tries to redirect to an alternate page.
* The redirect uses JavaScript, if enabled, falling back on * The redirect uses JavaScript, if enabled, falling back on
@ -97,20 +94,20 @@ public class IndexRedirectWriter extends HtmlDocletWriter {
.appendStringLiteral(targetPath, '\'') .appendStringLiteral(targetPath, '\'')
.append(")"); .append(")");
HtmlTree metaRefresh = new HtmlTree(HtmlTag.META) HtmlTree metaRefresh = new HtmlTree(HtmlTag.META)
.addAttr(HtmlAttr.HTTP_EQUIV, "Refresh") .put(HtmlAttr.HTTP_EQUIV, "Refresh")
.addAttr(HtmlAttr.CONTENT, "0;" + targetPath); .put(HtmlAttr.CONTENT, "0;" + targetPath);
head.addContent(script.asContent(), HtmlTree.NOSCRIPT(metaRefresh)); head.addContent(script.asContent(), HtmlTree.NOSCRIPT(metaRefresh));
ContentBuilder bodyContent = new ContentBuilder(); ContentBuilder bodyContent = new ContentBuilder();
bodyContent.addContent(HtmlTree.NOSCRIPT( bodyContent.add(HtmlTree.NOSCRIPT(
HtmlTree.P(contents.getContent("doclet.No_Script_Message")))); HtmlTree.P(contents.getContent("doclet.No_Script_Message"))));
bodyContent.addContent(HtmlTree.P(HtmlTree.A(targetPath, new StringContent(targetPath)))); bodyContent.add(HtmlTree.P(HtmlTree.A(targetPath, new StringContent(targetPath))));
Content body = new HtmlTree(HtmlTag.BODY) Content body = new HtmlTree(HtmlTag.BODY)
.addAttr(HtmlAttr.CLASS, "index-redirect"); .put(HtmlAttr.CLASS, "index-redirect");
HtmlTree main = HtmlTree.MAIN(bodyContent); HtmlTree main = HtmlTree.MAIN(bodyContent);
body.addContent(main); body.add(main);
Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head.toContent(), body); Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head.toContent(), body);
HtmlDocument htmlDocument = new HtmlDocument(htmlComment, htmlTree); HtmlDocument htmlDocument = new HtmlDocument(htmlComment, htmlTree);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -97,14 +97,14 @@ public class LinkFactoryImpl extends LinkFactory {
DocPath filename = getPath(classLinkInfo); DocPath filename = getPath(classLinkInfo);
if (linkInfo.linkToSelf || if (linkInfo.linkToSelf ||
!(docPaths.forName(typeElement)).equals(m_writer.filename)) { !(docPaths.forName(typeElement)).equals(m_writer.filename)) {
link.addContent(m_writer.links.createLink( link.add(m_writer.links.createLink(
filename.fragment(classLinkInfo.where), filename.fragment(classLinkInfo.where),
label, label,
classLinkInfo.isStrong, classLinkInfo.isStrong,
title, title,
classLinkInfo.target)); classLinkInfo.target));
if (noLabel && !classLinkInfo.excludeTypeParameterLinks) { if (noLabel && !classLinkInfo.excludeTypeParameterLinks) {
link.addContent(getTypeParameterLinks(linkInfo)); link.add(getTypeParameterLinks(linkInfo));
} }
return link; return link;
} }
@ -114,17 +114,17 @@ public class LinkFactoryImpl extends LinkFactory {
typeElement, classLinkInfo.where, typeElement, classLinkInfo.where,
label, classLinkInfo.isStrong, true); label, classLinkInfo.isStrong, true);
if (crossLink != null) { if (crossLink != null) {
link.addContent(crossLink); link.add(crossLink);
if (noLabel && !classLinkInfo.excludeTypeParameterLinks) { if (noLabel && !classLinkInfo.excludeTypeParameterLinks) {
link.addContent(getTypeParameterLinks(linkInfo)); link.add(getTypeParameterLinks(linkInfo));
} }
return link; return link;
} }
} }
// Can't link so just write label. // Can't link so just write label.
link.addContent(label); link.add(label);
if (noLabel && !classLinkInfo.excludeTypeParameterLinks) { if (noLabel && !classLinkInfo.excludeTypeParameterLinks) {
link.addContent(getTypeParameterLinks(linkInfo)); link.add(getTypeParameterLinks(linkInfo));
} }
return link; return link;
} }
@ -157,17 +157,17 @@ public class LinkFactoryImpl extends LinkFactory {
} }
if (((linkInfo.includeTypeInClassLinkLabel && isClassLabel) if (((linkInfo.includeTypeInClassLinkLabel && isClassLabel)
|| (linkInfo.includeTypeAsSepLink && !isClassLabel)) && !vars.isEmpty()) { || (linkInfo.includeTypeAsSepLink && !isClassLabel)) && !vars.isEmpty()) {
links.addContent("<"); links.add("<");
boolean many = false; boolean many = false;
for (TypeMirror t : vars) { for (TypeMirror t : vars) {
if (many) { if (many) {
links.addContent(","); links.add(",");
links.addContent(Contents.ZERO_WIDTH_SPACE); links.add(Contents.ZERO_WIDTH_SPACE);
} }
links.addContent(getTypeParameterLink(linkInfo, t)); links.add(getTypeParameterLink(linkInfo, t));
many = true; many = true;
} }
links.addContent(">"); links.add(">");
} }
return links; return links;
} }
@ -222,13 +222,13 @@ public class LinkFactoryImpl extends LinkFactory {
boolean isFirst = true; boolean isFirst = true;
for (Content anno : annos) { for (Content anno : annos) {
if (!isFirst) { if (!isFirst) {
links.addContent(" "); links.add(" ");
} }
links.addContent(anno); links.add(anno);
isFirst = false; isFirst = false;
} }
if (!annos.isEmpty()) { if (!annos.isEmpty()) {
links.addContent(" "); links.add(" ");
} }
return links; return links;

View File

@ -86,7 +86,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
*/ */
@Override @Override
public Content getMemberSummaryHeader(TypeElement typeElement, Content memberSummaryTree) { public Content getMemberSummaryHeader(TypeElement typeElement, Content memberSummaryTree) {
memberSummaryTree.addContent(MarkerComments.START_OF_METHOD_SUMMARY); memberSummaryTree.add(MarkerComments.START_OF_METHOD_SUMMARY);
Content memberTree = writer.getMemberTreeHeader(); Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree); writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree; return memberTree;
@ -105,12 +105,12 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
*/ */
@Override @Override
public Content getMethodDetailsTreeHeader(TypeElement typeElement, Content memberDetailsTree) { public Content getMethodDetailsTreeHeader(TypeElement typeElement, Content memberDetailsTree) {
memberDetailsTree.addContent(MarkerComments.START_OF_METHOD_DETAILS); memberDetailsTree.add(MarkerComments.START_OF_METHOD_DETAILS);
Content methodDetailsTree = writer.getMemberTreeHeader(); Content methodDetailsTree = writer.getMemberTreeHeader();
methodDetailsTree.addContent(links.createAnchor(SectionName.METHOD_DETAIL)); methodDetailsTree.add(links.createAnchor(SectionName.METHOD_DETAIL));
Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.methodDetailLabel); contents.methodDetailLabel);
methodDetailsTree.addContent(heading); methodDetailsTree.add(heading);
return methodDetailsTree; return methodDetailsTree;
} }
@ -121,13 +121,13 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
public Content getMethodDocTreeHeader(ExecutableElement method, Content methodDetailsTree) { public Content getMethodDocTreeHeader(ExecutableElement method, Content methodDetailsTree) {
String erasureAnchor; String erasureAnchor;
if ((erasureAnchor = getErasureAnchor(method)) != null) { if ((erasureAnchor = getErasureAnchor(method)) != null) {
methodDetailsTree.addContent(links.createAnchor((erasureAnchor))); methodDetailsTree.add(links.createAnchor((erasureAnchor)));
} }
methodDetailsTree.addContent(links.createAnchor(writer.getAnchor(method))); methodDetailsTree.add(links.createAnchor(writer.getAnchor(method)));
Content methodDocTree = writer.getMemberTreeHeader(); Content methodDocTree = writer.getMemberTreeHeader();
Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING); Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(name(method)); heading.add(name(method));
methodDocTree.addContent(heading); methodDocTree.add(heading);
return methodDocTree; return methodDocTree;
} }
@ -190,9 +190,9 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
utils.isClass(holder) utils.isClass(holder)
? contents.descfrmClassLabel ? contents.descfrmClassLabel
: contents.descfrmInterfaceLabel); : contents.descfrmInterfaceLabel);
descfrmLabel.addContent(Contents.SPACE); descfrmLabel.add(Contents.SPACE);
descfrmLabel.addContent(codelLink); descfrmLabel.add(codelLink);
methodDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, descfrmLabel)); methodDocTree.add(HtmlTree.DIV(HtmlStyle.block, descfrmLabel));
writer.addInlineComment(method, methodDocTree); writer.addInlineComment(method, methodDocTree);
} }
} }
@ -230,7 +230,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
public void addSummaryLabel(Content memberTree) { public void addSummaryLabel(Content memberTree) {
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.methodSummary); contents.methodSummary);
memberTree.addContent(label); memberTree.add(label);
} }
/** /**
@ -265,7 +265,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
*/ */
@Override @Override
public void addSummaryAnchor(TypeElement typeElement, Content memberTree) { public void addSummaryAnchor(TypeElement typeElement, Content memberTree) {
memberTree.addContent(links.createAnchor(SectionName.METHOD_SUMMARY)); memberTree.add(links.createAnchor(SectionName.METHOD_SUMMARY));
} }
/** /**
@ -273,7 +273,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
*/ */
@Override @Override
public void addInheritedSummaryAnchor(TypeElement typeElement, Content inheritedTree) { public void addInheritedSummaryAnchor(TypeElement typeElement, Content inheritedTree) {
inheritedTree.addContent(links.createAnchor( inheritedTree.add(links.createAnchor(
SectionName.METHODS_INHERITANCE, configuration.getClassName(typeElement))); SectionName.METHODS_INHERITANCE, configuration.getClassName(typeElement)));
} }
@ -296,9 +296,9 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
} }
Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.INHERITED_SUMMARY_HEADING, Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.INHERITED_SUMMARY_HEADING,
label); label);
labelHeading.addContent(Contents.SPACE); labelHeading.add(Contents.SPACE);
labelHeading.addContent(classLink); labelHeading.add(classLink);
inheritedTree.addContent(labelHeading); inheritedTree.add(labelHeading);
} }
/** /**
@ -342,7 +342,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
context = LinkInfoImpl.Kind.METHOD_SPECIFIED_BY; context = LinkInfoImpl.Kind.METHOD_SPECIFIED_BY;
} }
Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.overrideSpecifyLabel, label)); Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.overrideSpecifyLabel, label));
dl.addContent(dt); dl.add(dt);
Content overriddenTypeLink = Content overriddenTypeLink =
writer.getLink(new LinkInfoImpl(writer.configuration, context, overriddenType)); writer.getLink(new LinkInfoImpl(writer.configuration, context, overriddenType));
Content codeOverridenTypeLink = HtmlTree.CODE(overriddenTypeLink); Content codeOverridenTypeLink = HtmlTree.CODE(overriddenTypeLink);
@ -352,11 +352,11 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
.where(writer.links.getName(writer.getAnchor(method))).label(method.getSimpleName())); .where(writer.links.getName(writer.getAnchor(method))).label(method.getSimpleName()));
Content codeMethLink = HtmlTree.CODE(methlink); Content codeMethLink = HtmlTree.CODE(methlink);
Content dd = HtmlTree.DD(codeMethLink); Content dd = HtmlTree.DD(codeMethLink);
dd.addContent(Contents.SPACE); dd.add(Contents.SPACE);
dd.addContent(writer.contents.inClass); dd.add(writer.contents.inClass);
dd.addContent(Contents.SPACE); dd.add(Contents.SPACE);
dd.addContent(codeOverridenTypeLink); dd.add(codeOverridenTypeLink);
dl.addContent(dd); dl.add(dd);
} }
} }
@ -382,17 +382,17 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
writer.configuration, LinkInfoImpl.Kind.METHOD_SPECIFIED_BY, intfac)); writer.configuration, LinkInfoImpl.Kind.METHOD_SPECIFIED_BY, intfac));
Content codeIntfacLink = HtmlTree.CODE(intfaclink); Content codeIntfacLink = HtmlTree.CODE(intfaclink);
Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.overrideSpecifyLabel, contents.specifiedByLabel)); Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.overrideSpecifyLabel, contents.specifiedByLabel));
dl.addContent(dt); dl.add(dt);
Content methlink = writer.getDocLink( Content methlink = writer.getDocLink(
LinkInfoImpl.Kind.MEMBER, implementedMeth, LinkInfoImpl.Kind.MEMBER, implementedMeth,
implementedMeth.getSimpleName(), false); implementedMeth.getSimpleName(), false);
Content codeMethLink = HtmlTree.CODE(methlink); Content codeMethLink = HtmlTree.CODE(methlink);
Content dd = HtmlTree.DD(codeMethLink); Content dd = HtmlTree.DD(codeMethLink);
dd.addContent(Contents.SPACE); dd.add(Contents.SPACE);
dd.addContent(contents.inInterface); dd.add(contents.inInterface);
dd.addContent(Contents.SPACE); dd.add(Contents.SPACE);
dd.addContent(codeIntfacLink); dd.add(codeIntfacLink);
dl.addContent(dd); dl.add(dd);
} }
} }
@ -407,8 +407,8 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
if (type != null) { if (type != null) {
Content linkContent = writer.getLink( Content linkContent = writer.getLink(
new LinkInfoImpl(configuration, LinkInfoImpl.Kind.RETURN_TYPE, type)); new LinkInfoImpl(configuration, LinkInfoImpl.Kind.RETURN_TYPE, type));
htmltree.addContent(linkContent); htmltree.add(linkContent);
htmltree.addContent(Contents.SPACE); htmltree.add(Contents.SPACE);
} }
} }
} }

View File

@ -102,12 +102,12 @@ public class ModuleFrameWriter extends HtmlDocletWriter {
: configuration.docPaths.moduleSummary(moduleElement); : configuration.docPaths.moduleSummary(moduleElement);
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, HtmlStyle.bar, Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, HtmlStyle.bar,
mdlgen.links.createLink(moduleSummary, mdlLabel, "", "classFrame")); mdlgen.links.createLink(moduleSummary, mdlLabel, "", "classFrame"));
htmlTree.addContent(heading); htmlTree.add(heading);
HtmlTree div = new HtmlTree(HtmlTag.DIV); HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.indexContainer); div.setStyle(HtmlStyle.indexContainer);
mdlgen.addClassListing(div); mdlgen.addClassListing(div);
htmlTree.addContent(div); htmlTree.add(div);
body.addContent(htmlTree); body.add(htmlTree);
mdlgen.printHtmlDocument( mdlgen.printHtmlDocument(
configuration.metakeywords.getMetaKeywordsForModule(moduleElement), configuration.metakeywords.getMetaKeywordsForModule(moduleElement),
"module summary (frame)", "module summary (frame)",
@ -172,7 +172,7 @@ public class ModuleFrameWriter extends HtmlDocletWriter {
if (!printedHeader) { if (!printedHeader) {
Content heading = HtmlTree.HEADING(Headings.CONTENT_HEADING, Content heading = HtmlTree.HEADING(Headings.CONTENT_HEADING,
true, labelContent); true, labelContent);
htmlTree.addContent(heading); htmlTree.add(heading);
printedHeader = true; printedHeader = true;
} }
Content arr_i_name = new StringContent(utils.getSimpleName(typeElement)); Content arr_i_name = new StringContent(utils.getSimpleName(typeElement));
@ -182,10 +182,10 @@ public class ModuleFrameWriter extends HtmlDocletWriter {
Content link = getLink(new LinkInfoImpl(configuration, Content link = getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.ALL_CLASSES_FRAME, typeElement).label(arr_i_name).target("classFrame")); LinkInfoImpl.Kind.ALL_CLASSES_FRAME, typeElement).label(arr_i_name).target("classFrame"));
Content li = HtmlTree.LI(link); Content li = HtmlTree.LI(link);
ul.addContent(li); ul.add(li);
} }
htmlTree.addContent(ul); htmlTree.add(ul);
contentTree.addContent(htmlTree); contentTree.add(htmlTree);
} }
} }
} }

View File

@ -96,10 +96,10 @@ public class ModuleIndexFrameWriter extends AbstractModuleIndexWriter {
HtmlTree ul = new HtmlTree(HtmlTag.UL); HtmlTree ul = new HtmlTree(HtmlTag.UL);
ul.setTitle(contents.modulesLabel); ul.setTitle(contents.modulesLabel);
for (ModuleElement mdle: configuration.modules) { for (ModuleElement mdle: configuration.modules) {
ul.addContent(getModuleLink(mdle)); ul.add(getModuleLink(mdle));
} }
htmlTree.addContent(ul); htmlTree.add(ul);
main.addContent(htmlTree); main.add(htmlTree);
} }
/** /**
@ -122,8 +122,8 @@ public class ModuleIndexFrameWriter extends AbstractModuleIndexWriter {
DocLink cFrameLink = new DocLink(docPaths.moduleSummary(mdle)); DocLink cFrameLink = new DocLink(docPaths.moduleSummary(mdle));
HtmlTree anchor = HtmlTree.A(mdlLink.toString(), label); HtmlTree anchor = HtmlTree.A(mdlLink.toString(), label);
String onclickStr = "updateModuleFrame('" + mtFrameLink + "','" + cFrameLink + "');"; String onclickStr = "updateModuleFrame('" + mtFrameLink + "','" + cFrameLink + "');";
anchor.addAttr(HtmlAttr.TARGET, target); anchor.put(HtmlAttr.TARGET, target);
anchor.addAttr(HtmlAttr.ONCLICK, onclickStr); anchor.put(HtmlAttr.ONCLICK, onclickStr);
return anchor; return anchor;
} }
@ -136,7 +136,7 @@ public class ModuleIndexFrameWriter extends AbstractModuleIndexWriter {
if (!headerContent.isEmpty()) { if (!headerContent.isEmpty()) {
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true, Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.bar, new RawHtml(replaceDocRootDir(headerContent))); HtmlStyle.bar, new RawHtml(replaceDocRootDir(headerContent)));
header.addContent(heading); header.add(heading);
moduleListHeading = Headings.IndexFrames.MODULE_HEADING; moduleListHeading = Headings.IndexFrames.MODULE_HEADING;
} else { } else {
moduleListHeading = Headings.PAGE_TITLE_HEADING; moduleListHeading = Headings.PAGE_TITLE_HEADING;
@ -159,7 +159,7 @@ public class ModuleIndexFrameWriter extends AbstractModuleIndexWriter {
Content linkContent = links.createLink(DocPaths.ALLCLASSES_FRAME, Content linkContent = links.createLink(DocPaths.ALLCLASSES_FRAME,
contents.allClassesLabel, "", "packageFrame"); contents.allClassesLabel, "", "packageFrame");
Content li = HtmlTree.LI(linkContent); Content li = HtmlTree.LI(linkContent);
ul.addContent(li); ul.add(li);
} }
/** /**
@ -172,7 +172,7 @@ public class ModuleIndexFrameWriter extends AbstractModuleIndexWriter {
Content linkContent = links.createLink(DocPaths.OVERVIEW_FRAME, Content linkContent = links.createLink(DocPaths.OVERVIEW_FRAME,
contents.allPackagesLabel, "", "packageListFrame"); contents.allPackagesLabel, "", "packageListFrame");
Content li = HtmlTree.LI(linkContent); Content li = HtmlTree.LI(linkContent);
ul.addContent(li); ul.add(li);
} }
/** /**
@ -180,7 +180,7 @@ public class ModuleIndexFrameWriter extends AbstractModuleIndexWriter {
*/ */
protected void addNavigationBarFooter(Content footer) { protected void addNavigationBarFooter(Content footer) {
Content p = HtmlTree.P(Contents.SPACE); Content p = HtmlTree.P(Contents.SPACE);
footer.addContent(p); footer.add(p);
} }
protected void addModulePackagesList(Map<ModuleElement, Set<PackageElement>> modules, String text, protected void addModulePackagesList(Map<ModuleElement, Set<PackageElement>> modules, String text,

View File

@ -102,8 +102,8 @@ public class ModuleIndexWriter extends AbstractModuleIndexWriter {
if (configuration.showModules) { if (configuration.showModules) {
addAllModulesLink(ul); addAllModulesLink(ul);
} }
htmltree.addContent(ul); htmltree.add(ul);
header.addContent(htmltree); header.add(htmltree);
addModulesList(main); addModulesList(main);
} }
@ -148,7 +148,7 @@ public class ModuleIndexWriter extends AbstractModuleIndexWriter {
} }
Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table.toContent()); Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table.toContent());
main.addContent(div); main.add(div);
if (table.needsScript()) { if (table.needsScript()) {
mainBodyScript.append(table.getScript()); mainBodyScript.append(table.getScript());
@ -170,7 +170,7 @@ public class ModuleIndexWriter extends AbstractModuleIndexWriter {
HtmlTree div = new HtmlTree(HtmlTag.DIV); HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.contentContainer); div.setStyle(HtmlStyle.contentContainer);
addOverviewComment(div); addOverviewComment(div);
main.addContent(div); main.add(div);
} }
} }
@ -198,7 +198,7 @@ public class ModuleIndexWriter extends AbstractModuleIndexWriter {
protected void addNavigationBarHeader(Content header) { protected void addNavigationBarHeader(Content header) {
addTop(header); addTop(header);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
header.addContent(navBar.getContent(true)); header.add(navBar.getContent(true));
} }
/** /**
@ -210,7 +210,7 @@ public class ModuleIndexWriter extends AbstractModuleIndexWriter {
@Override @Override
protected void addNavigationBarFooter(Content footer) { protected void addNavigationBarFooter(Content footer) {
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
footer.addContent(navBar.getContent(false)); footer.add(navBar.getContent(false));
addBottom(footer); addBottom(footer);
} }

View File

@ -96,19 +96,19 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
Content profNameContent = new StringContent(mdle.getQualifiedName().toString()); Content profNameContent = new StringContent(mdle.getQualifiedName().toString());
Content heading = HtmlTree.HEADING(modulePackagesListHeading, true, Content heading = HtmlTree.HEADING(modulePackagesListHeading, true,
getTargetModuleLink("classFrame", profNameContent, mdle)); getTargetModuleLink("classFrame", profNameContent, mdle));
heading.addContent(Contents.SPACE); heading.add(Contents.SPACE);
heading.addContent(contents.packagesLabel); heading.add(contents.packagesLabel);
HtmlTree htmlTree = HtmlTree.DIV(HtmlStyle.indexContainer, heading); HtmlTree htmlTree = HtmlTree.DIV(HtmlStyle.indexContainer, heading);
HtmlTree ul = new HtmlTree(HtmlTag.UL); HtmlTree ul = new HtmlTree(HtmlTag.UL);
ul.setTitle(contents.packagesLabel); ul.setTitle(contents.packagesLabel);
List<PackageElement> packages = new ArrayList<>(modules.get(mdle)); List<PackageElement> packages = new ArrayList<>(modules.get(mdle));
for (PackageElement pkg : packages) { for (PackageElement pkg : packages) {
if ((!(configuration.nodeprecated && utils.isDeprecated(pkg)))) { if ((!(configuration.nodeprecated && utils.isDeprecated(pkg)))) {
ul.addContent(getPackage(pkg, mdle)); ul.add(getPackage(pkg, mdle));
} }
} }
htmlTree.addContent(ul); htmlTree.add(ul);
main.addContent(htmlTree); main.add(htmlTree);
} }
/** /**
@ -119,19 +119,19 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
Content moduleNameContent = new StringContent(mdle.getQualifiedName().toString()); Content moduleNameContent = new StringContent(mdle.getQualifiedName().toString());
Content heading = HtmlTree.HEADING(modulePackagesListHeading, true, Content heading = HtmlTree.HEADING(modulePackagesListHeading, true,
getTargetModuleLink("classFrame", moduleNameContent, mdle)); getTargetModuleLink("classFrame", moduleNameContent, mdle));
heading.addContent(Contents.SPACE); heading.add(Contents.SPACE);
heading.addContent(contents.packagesLabel); heading.add(contents.packagesLabel);
HtmlTree htmlTree = HtmlTree.MAIN(HtmlStyle.indexContainer, heading); HtmlTree htmlTree = HtmlTree.MAIN(HtmlStyle.indexContainer, heading);
HtmlTree ul = new HtmlTree(HtmlTag.UL); HtmlTree ul = new HtmlTree(HtmlTag.UL);
ul.setTitle(contents.packagesLabel); ul.setTitle(contents.packagesLabel);
Set<PackageElement> modulePackages = configuration.modulePackages.get(mdle); Set<PackageElement> modulePackages = configuration.modulePackages.get(mdle);
for (PackageElement pkg: modulePackages) { for (PackageElement pkg: modulePackages) {
if ((!(configuration.nodeprecated && utils.isDeprecated(pkg)))) { if ((!(configuration.nodeprecated && utils.isDeprecated(pkg)))) {
ul.addContent(getPackage(pkg, mdle)); ul.add(getPackage(pkg, mdle));
} }
} }
htmlTree.addContent(ul); htmlTree.add(ul);
body.addContent(htmlTree); body.add(htmlTree);
} }
/** /**
@ -167,7 +167,7 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
if (!headerContent.isEmpty()) { if (!headerContent.isEmpty()) {
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true, Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.bar, new RawHtml(replaceDocRootDir(headerContent))); HtmlStyle.bar, new RawHtml(replaceDocRootDir(headerContent)));
header.addContent(heading); header.add(heading);
modulePackagesListHeading = Headings.IndexFrames.PACKAGE_HEADING; modulePackagesListHeading = Headings.IndexFrames.PACKAGE_HEADING;
} else { } else {
modulePackagesListHeading = Headings.PAGE_TITLE_HEADING; modulePackagesListHeading = Headings.PAGE_TITLE_HEADING;
@ -200,7 +200,7 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
Content linkContent = links.createLink(allClassesFrame, Content linkContent = links.createLink(allClassesFrame,
contents.allClassesLabel, "", "packageFrame"); contents.allClassesLabel, "", "packageFrame");
Content li = HtmlTree.LI(linkContent); Content li = HtmlTree.LI(linkContent);
ul.addContent(li); ul.add(li);
} }
/** /**
@ -216,7 +216,7 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
Content linkContent = links.createLink(overviewFrame, Content linkContent = links.createLink(overviewFrame,
contents.allPackagesLabel, "", "packageListFrame"); contents.allPackagesLabel, "", "packageListFrame");
Content li = HtmlTree.LI(linkContent); Content li = HtmlTree.LI(linkContent);
ul.addContent(li); ul.add(li);
} }
/** /**
@ -232,7 +232,7 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
Content linkContent = links.createLink(moduleOverviewFrame, Content linkContent = links.createLink(moduleOverviewFrame,
contents.allModulesLabel, "", "packageListFrame"); contents.allModulesLabel, "", "packageListFrame");
Content li = HtmlTree.LI(linkContent); Content li = HtmlTree.LI(linkContent);
ul.addContent(li); ul.add(li);
} }
/** /**
@ -240,6 +240,6 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
*/ */
protected void addNavigationBarFooter(Content footer) { protected void addNavigationBarFooter(Content footer) {
Content p = HtmlTree.P(Contents.SPACE); Content p = HtmlTree.P(Contents.SPACE);
footer.addContent(p); footer.add(p);
} }
} }

View File

@ -203,22 +203,22 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|| display(indirectOpenPackages)); || display(indirectOpenPackages));
navBar.setDisplaySummaryServicesLink(displayServices(uses, usesTrees) || displayServices(provides.keySet(), providesTrees)); navBar.setDisplaySummaryServicesLink(displayServices(uses, usesTrees) || displayServices(provides.keySet(), providesTrees));
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.addContent(navBar.getContent(true)); htmlTree.add(navBar.getContent(true));
bodyTree.addContent(htmlTree); bodyTree.add(htmlTree);
HtmlTree div = new HtmlTree(HtmlTag.DIV); HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.header); div.setStyle(HtmlStyle.header);
Content annotationContent = new HtmlTree(HtmlTag.P); Content annotationContent = new HtmlTree(HtmlTag.P);
addAnnotationInfo(mdle, annotationContent); addAnnotationInfo(mdle, annotationContent);
div.addContent(annotationContent); div.add(annotationContent);
Content label = mdle.isOpen() && (configuration.docEnv.getModuleMode() == ModuleMode.ALL) Content label = mdle.isOpen() && (configuration.docEnv.getModuleMode() == ModuleMode.ALL)
? contents.openModuleLabel : contents.moduleLabel; ? contents.openModuleLabel : contents.moduleLabel;
Content tHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true, Content tHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, label); HtmlStyle.title, label);
tHeading.addContent(Contents.SPACE); tHeading.add(Contents.SPACE);
Content moduleHead = new RawHtml(heading); Content moduleHead = new RawHtml(heading);
tHeading.addContent(moduleHead); tHeading.add(moduleHead);
div.addContent(tHeading); div.add(tHeading);
mainTree.addContent(div); mainTree.add(div);
return bodyTree; return bodyTree;
} }
@ -458,9 +458,9 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
*/ */
public void addSummaryHeader(Content startMarker, SectionName markerAnchor, Content heading, public void addSummaryHeader(Content startMarker, SectionName markerAnchor, Content heading,
Content htmltree) { Content htmltree) {
htmltree.addContent(startMarker); htmltree.add(startMarker);
htmltree.addContent(links.createAnchor(markerAnchor)); htmltree.add(links.createAnchor(markerAnchor));
htmltree.addContent(HtmlTree.HEADING(Headings.ModuleDeclaration.SUMMARY_HEADING, heading)); htmltree.add(HtmlTree.HEADING(Headings.ModuleDeclaration.SUMMARY_HEADING, heading));
} }
/** /**
@ -519,7 +519,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
Table table = getTable3(caption, tableSummary, HtmlStyle.requiresSummary, Table table = getTable3(caption, tableSummary, HtmlStyle.requiresSummary,
requiresTableHeader); requiresTableHeader);
addModulesList(requires, table); addModulesList(requires, table);
li.addContent(table.toContent()); li.add(table.toContent());
} }
// Display indirect modules table in both "api" and "all" mode. // Display indirect modules table in both "api" and "all" mode.
if (display(indirectModules)) { if (display(indirectModules)) {
@ -531,10 +531,10 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
Table amrTable = getTable3(amrCaption, amrTableSummary, HtmlStyle.requiresSummary, Table amrTable = getTable3(amrCaption, amrTableSummary, HtmlStyle.requiresSummary,
requiresTableHeader); requiresTableHeader);
addModulesList(indirectModules, amrTable); addModulesList(indirectModules, amrTable);
li.addContent(amrTable.toContent()); li.add(amrTable.toContent());
} }
HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li); HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li);
summaryContentTree.addContent(ul); summaryContentTree.add(ul);
} }
} }
@ -572,17 +572,17 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
Table aepTable = getTable2(new StringContent(aepText), Table aepTable = getTable2(new StringContent(aepText),
HtmlStyle.packagesSummary, indirectPackagesHeader); HtmlStyle.packagesSummary, indirectPackagesHeader);
addIndirectPackages(aepTable, indirectPackages); addIndirectPackages(aepTable, indirectPackages);
li.addContent(aepTable.toContent()); li.add(aepTable.toContent());
} }
if (display(indirectOpenPackages)) { if (display(indirectOpenPackages)) {
String aopText = resources.getText("doclet.Indirect_Opens_Summary"); String aopText = resources.getText("doclet.Indirect_Opens_Summary");
Table aopTable = getTable2(new StringContent(aopText), HtmlStyle.packagesSummary, Table aopTable = getTable2(new StringContent(aopText), HtmlStyle.packagesSummary,
indirectPackagesHeader); indirectPackagesHeader);
addIndirectPackages(aopTable, indirectOpenPackages); addIndirectPackages(aopTable, indirectOpenPackages);
li.addContent(aopTable.toContent()); li.add(aopTable.toContent());
} }
HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li); HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li);
summaryContentTree.addContent(ul); summaryContentTree.add(ul);
} }
} }
@ -667,7 +667,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
table.addRow(pkg, row); table.addRow(pkg, row);
} }
li.addContent(table.toContent()); li.add(table.toContent());
if (table.needsScript()) { if (table.needsScript()) {
mainBodyScript.append(table.getScript()); mainBodyScript.append(table.getScript());
} }
@ -697,9 +697,9 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
Content list = new ContentBuilder(); Content list = new ContentBuilder();
for (ModuleElement m : modules) { for (ModuleElement m : modules) {
if (!list.isEmpty()) { if (!list.isEmpty()) {
list.addContent(new StringContent(", ")); list.add(new StringContent(", "));
} }
list.addContent(getModuleLink(m, new StringContent(m.getQualifiedName()))); list.add(getModuleLink(m, new StringContent(m.getQualifiedName())));
} }
return list; return list;
} }
@ -719,8 +719,8 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
Content list = new ContentBuilder(); Content list = new ContentBuilder();
String sep = ""; String sep = "";
for (PackageElement pkg : pkgList) { for (PackageElement pkg : pkgList) {
list.addContent(sep); list.add(sep);
list.addContent(getPackageLink(pkg, new StringContent(utils.getPackageName(pkg)))); list.add(getPackageLink(pkg, new StringContent(utils.getPackageName(pkg))));
sep = " "; sep = " ";
} }
table.addRow(moduleLinkContent, list); table.addRow(moduleLinkContent, list);
@ -749,7 +749,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
usesProvidesTableHeader); usesProvidesTableHeader);
addProvidesList(table); addProvidesList(table);
if (!table.isEmpty()) { if (!table.isEmpty()) {
li.addContent(table.toContent()); li.add(table.toContent());
} }
} }
if (haveUses){ if (haveUses){
@ -758,11 +758,11 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
usesProvidesTableHeader); usesProvidesTableHeader);
addUsesList(table); addUsesList(table);
if (!table.isEmpty()) { if (!table.isEmpty()) {
li.addContent(table.toContent()); li.add(table.toContent());
} }
} }
HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li); HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li);
summaryContentTree.addContent(ul); summaryContentTree.add(ul);
} }
} }
@ -783,12 +783,12 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
if (display(usesTrees)) { if (display(usesTrees)) {
description = usesTrees.get(t); description = usesTrees.get(t);
if (description != null && !description.isEmpty()) { if (description != null && !description.isEmpty()) {
summary.addContent(HtmlTree.DIV(HtmlStyle.block, description)); summary.add(HtmlTree.DIV(HtmlStyle.block, description));
} else { } else {
addSummaryComment(t, summary); addSummaryComment(t, summary);
} }
} else { } else {
summary.addContent(Contents.SPACE); summary.add(Contents.SPACE);
} }
table.addRow(typeLinkContent, summary); table.addRow(typeLinkContent, summary);
} }
@ -812,26 +812,26 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
Content desc = new ContentBuilder(); Content desc = new ContentBuilder();
if (display(providesTrees)) { if (display(providesTrees)) {
description = providesTrees.get(srv); description = providesTrees.get(srv);
desc.addContent((description != null && !description.isEmpty()) desc.add((description != null && !description.isEmpty())
? HtmlTree.DIV(HtmlStyle.block, description) ? HtmlTree.DIV(HtmlStyle.block, description)
: Contents.SPACE); : Contents.SPACE);
} else { } else {
desc.addContent(Contents.SPACE); desc.add(Contents.SPACE);
} }
// Only display the implementation details in the "all" mode. // Only display the implementation details in the "all" mode.
if (moduleMode == ModuleMode.ALL && !implSet.isEmpty()) { if (moduleMode == ModuleMode.ALL && !implSet.isEmpty()) {
desc.addContent(new HtmlTree(HtmlTag.BR)); desc.add(new HtmlTree(HtmlTag.BR));
desc.addContent("("); desc.add("(");
HtmlTree implSpan = HtmlTree.SPAN(HtmlStyle.implementationLabel, contents.implementation); HtmlTree implSpan = HtmlTree.SPAN(HtmlStyle.implementationLabel, contents.implementation);
desc.addContent(implSpan); desc.add(implSpan);
desc.addContent(Contents.SPACE); desc.add(Contents.SPACE);
String sep = ""; String sep = "";
for (TypeElement impl : implSet) { for (TypeElement impl : implSet) {
desc.addContent(sep); desc.add(sep);
desc.addContent(getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.PACKAGE, impl))); desc.add(getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.PACKAGE, impl)));
sep = ", "; sep = ", ";
} }
desc.addContent(")"); desc.add(")");
} }
table.addRow(srvLinkContent, desc); table.addRow(srvLinkContent, desc);
} }
@ -849,14 +849,14 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV); HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
deprDiv.setStyle(HtmlStyle.deprecationBlock); deprDiv.setStyle(HtmlStyle.deprecationBlock);
Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(mdle)); Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(mdle));
deprDiv.addContent(deprPhrase); deprDiv.add(deprPhrase);
if (!deprs.isEmpty()) { if (!deprs.isEmpty()) {
List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0)); List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0));
if (!commentTags.isEmpty()) { if (!commentTags.isEmpty()) {
addInlineDeprecatedComment(mdle, deprs.get(0), deprDiv); addInlineDeprecatedComment(mdle, deprs.get(0), deprDiv);
} }
} }
div.addContent(deprDiv); div.add(deprDiv);
} }
} }
@ -868,10 +868,10 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
if (!utils.getFullBody(mdle).isEmpty()) { if (!utils.getFullBody(mdle).isEmpty()) {
Content tree = HtmlTree.SECTION(); Content tree = HtmlTree.SECTION();
addDeprecationInfo(tree); addDeprecationInfo(tree);
tree.addContent(MarkerComments.START_OF_MODULE_DESCRIPTION); tree.add(MarkerComments.START_OF_MODULE_DESCRIPTION);
tree.addContent(links.createAnchor(SectionName.MODULE_DESCRIPTION)); tree.add(links.createAnchor(SectionName.MODULE_DESCRIPTION));
addInlineComment(mdle, tree); addInlineComment(mdle, tree);
moduleContentTree.addContent(tree); moduleContentTree.add(tree);
} }
} }
@ -882,7 +882,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
public void addModuleTags(Content moduleContentTree) { public void addModuleTags(Content moduleContentTree) {
Content tree = HtmlTree.SECTION(); Content tree = HtmlTree.SECTION();
addTagsInfo(mdle, tree); addTagsInfo(mdle, tree);
moduleContentTree.addContent(tree); moduleContentTree.add(tree);
} }
/** /**
@ -890,8 +890,8 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
*/ */
@Override @Override
public void addModuleContent(Content contentTree, Content moduleContentTree) { public void addModuleContent(Content contentTree, Content moduleContentTree) {
mainTree.addContent(moduleContentTree); mainTree.add(moduleContentTree);
contentTree.addContent(mainTree); contentTree.add(mainTree);
} }
/** /**
@ -901,9 +901,9 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
public void addModuleFooter(Content contentTree) { public void addModuleFooter(Content contentTree) {
Content htmlTree = HtmlTree.FOOTER(); Content htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.addContent(navBar.getContent(false)); htmlTree.add(navBar.getContent(false));
addBottom(htmlTree); addBottom(htmlTree);
contentTree.addContent(htmlTree); contentTree.add(htmlTree);
} }
/** /**
@ -931,7 +931,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV); HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
deprDiv.setStyle(HtmlStyle.deprecationBlock); deprDiv.setStyle(HtmlStyle.deprecationBlock);
Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(pkg)); Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(pkg));
deprDiv.addContent(deprPhrase); deprDiv.add(deprPhrase);
if (!deprs.isEmpty()) { if (!deprs.isEmpty()) {
CommentHelper ch = utils.getCommentHelper(pkg); CommentHelper ch = utils.getCommentHelper(pkg);
List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0)); List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0));
@ -939,7 +939,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
addInlineDeprecatedComment(pkg, deprs.get(0), deprDiv); addInlineDeprecatedComment(pkg, deprs.get(0), deprDiv);
} }
} }
li.addContent(deprDiv); li.add(deprDiv);
} }
} }
} }

View File

@ -70,7 +70,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
@Override @Override
public Content getMemberSummaryHeader(TypeElement typeElement, public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) { Content memberSummaryTree) {
memberSummaryTree.addContent(MarkerComments.START_OF_NESTED_CLASS_SUMMARY); memberSummaryTree.add(MarkerComments.START_OF_NESTED_CLASS_SUMMARY);
Content memberTree = writer.getMemberTreeHeader(); Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree); writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree; return memberTree;
@ -91,7 +91,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
public void addSummaryLabel(Content memberTree) { public void addSummaryLabel(Content memberTree) {
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.nestedClassSummary); contents.nestedClassSummary);
memberTree.addContent(label); memberTree.add(label);
} }
/** /**
@ -122,7 +122,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
*/ */
@Override @Override
public void addSummaryAnchor(TypeElement typeElement, Content memberTree) { public void addSummaryAnchor(TypeElement typeElement, Content memberTree) {
memberTree.addContent(links.createAnchor( memberTree.add(links.createAnchor(
SectionName.NESTED_CLASS_SUMMARY)); SectionName.NESTED_CLASS_SUMMARY));
} }
@ -131,7 +131,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
*/ */
@Override @Override
public void addInheritedSummaryAnchor(TypeElement typeElement, Content inheritedTree) { public void addInheritedSummaryAnchor(TypeElement typeElement, Content inheritedTree) {
inheritedTree.addContent(links.createAnchor( inheritedTree.add(links.createAnchor(
SectionName.NESTED_CLASSES_INHERITANCE, SectionName.NESTED_CLASSES_INHERITANCE,
utils.getFullyQualifiedName(typeElement))); utils.getFullyQualifiedName(typeElement)));
} }
@ -154,9 +154,9 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
: resources.getText("doclet.Nested_Classes_Interfaces_Inherited_From_Class")); : resources.getText("doclet.Nested_Classes_Interfaces_Inherited_From_Class"));
} }
Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, label); Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, label);
labelHeading.addContent(Contents.SPACE); labelHeading.add(Contents.SPACE);
labelHeading.addContent(classLink); labelHeading.add(classLink);
inheritedTree.addContent(labelHeading); inheritedTree.add(labelHeading);
} }
/** /**
@ -168,7 +168,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink, Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
writer.getLink(new LinkInfoImpl(configuration, context, (TypeElement)member))); writer.getLink(new LinkInfoImpl(configuration, context, (TypeElement)member)));
Content code = HtmlTree.CODE(memberLink); Content code = HtmlTree.CODE(memberLink);
tdSummary.addContent(code); tdSummary.add(code);
} }
/** /**
@ -176,7 +176,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
*/ */
@Override @Override
protected void addInheritedSummaryLink(TypeElement typeElement, Element member, Content linksTree) { protected void addInheritedSummaryLink(TypeElement typeElement, Element member, Content linksTree) {
linksTree.addContent( linksTree.add(
writer.getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.MEMBER, writer.getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.MEMBER,
(TypeElement)member))); (TypeElement)member)));
} }

View File

@ -103,12 +103,12 @@ public class PackageFrameWriter extends HtmlDocletWriter {
HtmlTree htmlTree = HtmlTree.MAIN(); HtmlTree htmlTree = HtmlTree.MAIN();
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, HtmlStyle.bar, Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, HtmlStyle.bar,
packgen.getTargetPackageLink(packageElement, "classFrame", pkgNameContent)); packgen.getTargetPackageLink(packageElement, "classFrame", pkgNameContent));
htmlTree.addContent(heading); htmlTree.add(heading);
HtmlTree div = new HtmlTree(HtmlTag.DIV); HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.indexContainer); div.setStyle(HtmlStyle.indexContainer);
packgen.addClassListing(div); packgen.addClassListing(div);
htmlTree.addContent(div); htmlTree.add(div);
body.addContent(htmlTree); body.add(htmlTree);
packgen.printHtmlDocument( packgen.printHtmlDocument(
configuration.metakeywords.getMetaKeywords(packageElement), configuration.metakeywords.getMetaKeywords(packageElement),
getDescription("package summary (frame)", packageElement), getDescription("package summary (frame)", packageElement),
@ -178,7 +178,7 @@ public class PackageFrameWriter extends HtmlDocletWriter {
if (!printedHeader) { if (!printedHeader) {
Content heading = HtmlTree.HEADING(Headings.CONTENT_HEADING, Content heading = HtmlTree.HEADING(Headings.CONTENT_HEADING,
true, labelContent); true, labelContent);
htmlTree.addContent(heading); htmlTree.add(heading);
printedHeader = true; printedHeader = true;
} }
Content arr_i_name = new StringContent(utils.getSimpleName(typeElement)); Content arr_i_name = new StringContent(utils.getSimpleName(typeElement));
@ -187,10 +187,10 @@ public class PackageFrameWriter extends HtmlDocletWriter {
Content link = getLink(new LinkInfoImpl(configuration, Content link = getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.PACKAGE_FRAME, typeElement).label(arr_i_name).target("classFrame")); LinkInfoImpl.Kind.PACKAGE_FRAME, typeElement).label(arr_i_name).target("classFrame"));
Content li = HtmlTree.LI(link); Content li = HtmlTree.LI(link);
ul.addContent(li); ul.add(li);
} }
htmlTree.addContent(ul); htmlTree.add(ul);
contentTree.addContent(htmlTree); contentTree.add(htmlTree);
} }
} }
} }

View File

@ -94,11 +94,11 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter {
// package is marked as deprecated. // package is marked as deprecated.
if (aPackage != null && if (aPackage != null &&
(!(configuration.nodeprecated && utils.isDeprecated(aPackage)))) { (!(configuration.nodeprecated && utils.isDeprecated(aPackage)))) {
ul.addContent(getPackage(aPackage)); ul.add(getPackage(aPackage));
} }
} }
htmlTree.addContent(ul); htmlTree.add(ul);
main.addContent(htmlTree); main.add(htmlTree);
} }
/** /**
@ -138,7 +138,7 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter {
if (!headerContent.isEmpty()) { if (!headerContent.isEmpty()) {
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true, Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.bar, headerContent); HtmlStyle.bar, headerContent);
header.addContent(heading); header.add(heading);
packageListHeading = Headings.IndexFrames.PACKAGE_HEADING; packageListHeading = Headings.IndexFrames.PACKAGE_HEADING;
} else { } else {
packageListHeading = Headings.PAGE_TITLE_HEADING; packageListHeading = Headings.PAGE_TITLE_HEADING;
@ -163,7 +163,7 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter {
Content linkContent = links.createLink(DocPaths.ALLCLASSES_FRAME, Content linkContent = links.createLink(DocPaths.ALLCLASSES_FRAME,
contents.allClassesLabel, "", "packageFrame"); contents.allClassesLabel, "", "packageFrame");
Content li = HtmlTree.LI(linkContent); Content li = HtmlTree.LI(linkContent);
ul.addContent(li); ul.add(li);
} }
/** /**
@ -177,7 +177,7 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter {
Content linkContent = links.createLink(DocPaths.MODULE_OVERVIEW_FRAME, Content linkContent = links.createLink(DocPaths.MODULE_OVERVIEW_FRAME,
contents.allModulesLabel, "", "packageListFrame"); contents.allModulesLabel, "", "packageListFrame");
Content li = HtmlTree.LI(linkContent); Content li = HtmlTree.LI(linkContent);
ul.addContent(li); ul.add(li);
} }
/** /**
@ -186,6 +186,6 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter {
@Override @Override
protected void addNavigationBarFooter(Content footer) { protected void addNavigationBarFooter(Content footer) {
Content p = HtmlTree.P(Contents.SPACE); Content p = HtmlTree.P(Contents.SPACE);
footer.addContent(p); footer.add(p);
} }
} }

View File

@ -129,7 +129,7 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
} }
Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table.toContent()); Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table.toContent());
main.addContent(div); main.add(div);
if (table.needsScript()) { if (table.needsScript()) {
getMainBodyScript().append(table.getScript()); getMainBodyScript().append(table.getScript());
@ -151,7 +151,7 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
HtmlTree div = new HtmlTree(HtmlTag.DIV); HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.contentContainer); div.setStyle(HtmlStyle.contentContainer);
addOverviewComment(div); addOverviewComment(div);
main.addContent(div); main.add(div);
} }
} }
@ -179,7 +179,7 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
protected void addNavigationBarHeader(Content header) { protected void addNavigationBarHeader(Content header) {
addTop(header); addTop(header);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
header.addContent(navBar.getContent(true)); header.add(navBar.getContent(true));
} }
/** /**
@ -191,7 +191,7 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
@Override @Override
protected void addNavigationBarFooter(Content footer) { protected void addNavigationBarFooter(Content footer) {
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
footer.addContent(navBar.getContent(false)); footer.add(navBar.getContent(false));
addBottom(footer); addBottom(footer);
} }
} }

View File

@ -106,20 +106,20 @@ public class PackageTreeWriter extends AbstractTreeWriter {
if (configuration.packages.size() > 1) { if (configuration.packages.size() > 1) {
addLinkToMainTree(div); addLinkToMainTree(div);
} }
mainTree.addContent(div); mainTree.add(div);
HtmlTree divTree = new HtmlTree(HtmlTag.DIV); HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
divTree.setStyle(HtmlStyle.contentContainer); divTree.setStyle(HtmlStyle.contentContainer);
addTree(classtree.baseClasses(), "doclet.Class_Hierarchy", divTree); addTree(classtree.baseClasses(), "doclet.Class_Hierarchy", divTree);
addTree(classtree.baseInterfaces(), "doclet.Interface_Hierarchy", divTree); addTree(classtree.baseInterfaces(), "doclet.Interface_Hierarchy", divTree);
addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree); addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree);
addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree, true); addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree, true);
mainTree.addContent(divTree); mainTree.add(divTree);
body.addContent(mainTree); body.add(mainTree);
HtmlTree footer = HtmlTree.FOOTER(); HtmlTree footer = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
footer.addContent(navBar.getContent(false)); footer.add(navBar.getContent(false));
addBottom(footer); addBottom(footer);
body.addContent(footer); body.add(footer);
printHtmlDocument(null, getDescription("tree", packageElement), body); printHtmlDocument(null, getDescription("tree", packageElement), body);
} }
@ -138,8 +138,8 @@ public class PackageTreeWriter extends AbstractTreeWriter {
contents.moduleLabel); contents.moduleLabel);
navBar.setNavLinkModule(linkContent); navBar.setNavLinkModule(linkContent);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.addContent(navBar.getContent(true)); htmlTree.add(navBar.getContent(true));
bodyTree.addContent(htmlTree); bodyTree.add(htmlTree);
return bodyTree; return bodyTree;
} }
@ -151,10 +151,10 @@ public class PackageTreeWriter extends AbstractTreeWriter {
protected void addLinkToMainTree(Content div) { protected void addLinkToMainTree(Content div) {
Content span = HtmlTree.SPAN(HtmlStyle.packageHierarchyLabel, Content span = HtmlTree.SPAN(HtmlStyle.packageHierarchyLabel,
contents.packageHierarchies); contents.packageHierarchies);
div.addContent(span); div.add(span);
HtmlTree ul = new HtmlTree (HtmlTag.UL); HtmlTree ul = new HtmlTree (HtmlTag.UL);
ul.setStyle(HtmlStyle.horizontal); ul.setStyle(HtmlStyle.horizontal);
ul.addContent(getNavLinkMainTree(resources.getText("doclet.All_Packages"))); ul.add(getNavLinkMainTree(resources.getText("doclet.All_Packages")));
div.addContent(ul); div.add(ul);
} }
} }

View File

@ -129,17 +129,17 @@ public class PackageUseWriter extends SubWriterHolderWriter {
HtmlTree div = new HtmlTree(HtmlTag.DIV); HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.contentContainer); div.setStyle(HtmlStyle.contentContainer);
if (usingPackageToUsedClasses.isEmpty()) { if (usingPackageToUsedClasses.isEmpty()) {
div.addContent(contents.getContent("doclet.ClassUse_No.usage.of.0", utils.getPackageName(packageElement))); div.add(contents.getContent("doclet.ClassUse_No.usage.of.0", utils.getPackageName(packageElement)));
} else { } else {
addPackageUse(div); addPackageUse(div);
} }
mainTree.addContent(div); mainTree.add(div);
body.addContent(mainTree); body.add(mainTree);
HtmlTree footer = HtmlTree.FOOTER(); HtmlTree footer = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
footer.addContent(navBar.getContent(false)); footer.add(navBar.getContent(false));
addBottom(footer); addBottom(footer);
body.addContent(footer); body.add(footer);
printHtmlDocument(null, printHtmlDocument(null,
getDescription("use", packageElement), getDescription("use", packageElement),
body); body);
@ -157,7 +157,7 @@ public class PackageUseWriter extends SubWriterHolderWriter {
addPackageList(ul); addPackageList(ul);
} }
addClassList(ul); addClassList(ul);
contentTree.addContent(ul); contentTree.add(ul);
} }
/** /**
@ -181,12 +181,12 @@ public class PackageUseWriter extends SubWriterHolderWriter {
if (pkg != null && !pkg.isUnnamed()) { if (pkg != null && !pkg.isUnnamed()) {
addSummaryComment(pkg, summary); addSummaryComment(pkg, summary);
} else { } else {
summary.addContent(Contents.SPACE); summary.add(Contents.SPACE);
} }
table.addRow(packageLink, summary); table.addRow(packageLink, summary);
} }
Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent()); Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent());
contentTree.addContent(li); contentTree.add(li);
} }
/** /**
@ -201,7 +201,7 @@ public class PackageUseWriter extends SubWriterHolderWriter {
PackageElement usingPackage = utils.elementUtils.getPackageElement(packageName); PackageElement usingPackage = utils.elementUtils.getPackageElement(packageName);
HtmlTree li = new HtmlTree(HtmlTag.LI); HtmlTree li = new HtmlTree(HtmlTag.LI);
li.setStyle(HtmlStyle.blockList); li.setStyle(HtmlStyle.blockList);
li.addContent(links.createAnchor(getPackageAnchorName(usingPackage))); li.add(links.createAnchor(getPackageAnchorName(usingPackage)));
String tableSummary = resources.getText("doclet.Use_Table_Summary", String tableSummary = resources.getText("doclet.Use_Table_Summary",
resources.getText("doclet.classes")); resources.getText("doclet.classes"));
Content caption = contents.getContent( Content caption = contents.getContent(
@ -223,8 +223,8 @@ public class PackageUseWriter extends SubWriterHolderWriter {
table.addRow(typeContent, summary); table.addRow(typeContent, summary);
} }
li.addContent(table.toContent()); li.add(table.toContent());
contentTree.addContent(li); contentTree.add(li);
} }
} }
@ -244,16 +244,16 @@ public class PackageUseWriter extends SubWriterHolderWriter {
contents.moduleLabel); contents.moduleLabel);
navBar.setNavLinkModule(linkContent); navBar.setNavLinkModule(linkContent);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.addContent(navBar.getContent(true)); htmlTree.add(navBar.getContent(true));
bodyTree.addContent(htmlTree); bodyTree.add(htmlTree);
ContentBuilder headContent = new ContentBuilder(); ContentBuilder headContent = new ContentBuilder();
headContent.addContent(contents.getContent("doclet.ClassUse_Title", packageText)); headContent.add(contents.getContent("doclet.ClassUse_Title", packageText));
headContent.addContent(new HtmlTree(HtmlTag.BR)); headContent.add(new HtmlTree(HtmlTag.BR));
headContent.addContent(name); headContent.add(name);
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true, Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, headContent); HtmlStyle.title, headContent);
Content div = HtmlTree.DIV(HtmlStyle.header, heading); Content div = HtmlTree.DIV(HtmlStyle.header, heading);
mainTree.addContent(div); mainTree.add(div);
return bodyTree; return bodyTree;
} }
} }

View File

@ -112,29 +112,29 @@ public class PackageWriterImpl extends HtmlDocletWriter
contents.moduleLabel); contents.moduleLabel);
navBar.setNavLinkModule(linkContent); navBar.setNavLinkModule(linkContent);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.addContent(navBar.getContent(true)); htmlTree.add(navBar.getContent(true));
bodyTree.addContent(htmlTree); bodyTree.add(htmlTree);
HtmlTree div = new HtmlTree(HtmlTag.DIV); HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.header); div.setStyle(HtmlStyle.header);
if (configuration.showModules) { if (configuration.showModules) {
ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(packageElement); ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(packageElement);
Content classModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInPackage, contents.moduleLabel); Content classModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInPackage, contents.moduleLabel);
Content moduleNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classModuleLabel); Content moduleNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classModuleLabel);
moduleNameDiv.addContent(Contents.SPACE); moduleNameDiv.add(Contents.SPACE);
moduleNameDiv.addContent(getModuleLink(mdle, moduleNameDiv.add(getModuleLink(mdle,
new StringContent(mdle.getQualifiedName().toString()))); new StringContent(mdle.getQualifiedName().toString())));
div.addContent(moduleNameDiv); div.add(moduleNameDiv);
} }
Content annotationContent = new HtmlTree(HtmlTag.P); Content annotationContent = new HtmlTree(HtmlTag.P);
addAnnotationInfo(packageElement, annotationContent); addAnnotationInfo(packageElement, annotationContent);
div.addContent(annotationContent); div.add(annotationContent);
Content tHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true, Content tHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, contents.packageLabel); HtmlStyle.title, contents.packageLabel);
tHeading.addContent(Contents.SPACE); tHeading.add(Contents.SPACE);
Content packageHead = new StringContent(heading); Content packageHead = new StringContent(heading);
tHeading.addContent(packageHead); tHeading.add(packageHead);
div.addContent(tHeading); div.add(tHeading);
mainTree.addContent(div); mainTree.add(div);
return bodyTree; return bodyTree;
} }
@ -160,14 +160,14 @@ public class PackageWriterImpl extends HtmlDocletWriter
HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV); HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
deprDiv.setStyle(HtmlStyle.deprecationBlock); deprDiv.setStyle(HtmlStyle.deprecationBlock);
Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(packageElement)); Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(packageElement));
deprDiv.addContent(deprPhrase); deprDiv.add(deprPhrase);
if (!deprs.isEmpty()) { if (!deprs.isEmpty()) {
List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0)); List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0));
if (!commentTags.isEmpty()) { if (!commentTags.isEmpty()) {
addInlineDeprecatedComment(packageElement, deprs.get(0), deprDiv); addInlineDeprecatedComment(packageElement, deprs.get(0), deprDiv);
} }
} }
div.addContent(deprDiv); div.add(deprDiv);
} }
} }
@ -251,7 +251,7 @@ public class PackageWriterImpl extends HtmlDocletWriter
configuration, LinkInfoImpl.Kind.PACKAGE, klass)); configuration, LinkInfoImpl.Kind.PACKAGE, klass));
ContentBuilder description = new ContentBuilder(); ContentBuilder description = new ContentBuilder();
if (utils.isDeprecated(klass)) { if (utils.isDeprecated(klass)) {
description.addContent(getDeprecatedPhrase(klass)); description.add(getDeprecatedPhrase(klass));
List<? extends DocTree> tags = utils.getDeprecatedTrees(klass); List<? extends DocTree> tags = utils.getDeprecatedTrees(klass);
if (!tags.isEmpty()) { if (!tags.isEmpty()) {
addSummaryDeprecatedComment(klass, tags.get(0), description); addSummaryDeprecatedComment(klass, tags.get(0), description);
@ -262,7 +262,7 @@ public class PackageWriterImpl extends HtmlDocletWriter
table.addRow(classLink, description); table.addRow(classLink, description);
} }
Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent()); Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent());
summaryContentTree.addContent(li); summaryContentTree.add(li);
} }
} }
@ -273,7 +273,7 @@ public class PackageWriterImpl extends HtmlDocletWriter
public void addPackageDescription(Content packageContentTree) { public void addPackageDescription(Content packageContentTree) {
if (!utils.getBody(packageElement).isEmpty()) { if (!utils.getBody(packageElement).isEmpty()) {
Content tree = sectionTree; Content tree = sectionTree;
tree.addContent(links.createAnchor(SectionName.PACKAGE_DESCRIPTION)); tree.add(links.createAnchor(SectionName.PACKAGE_DESCRIPTION));
addDeprecationInfo(tree); addDeprecationInfo(tree);
addInlineComment(packageElement, tree); addInlineComment(packageElement, tree);
} }
@ -286,7 +286,7 @@ public class PackageWriterImpl extends HtmlDocletWriter
public void addPackageTags(Content packageContentTree) { public void addPackageTags(Content packageContentTree) {
Content htmlTree = sectionTree; Content htmlTree = sectionTree;
addTagsInfo(packageElement, htmlTree); addTagsInfo(packageElement, htmlTree);
packageContentTree.addContent(sectionTree); packageContentTree.add(sectionTree);
} }
/** /**
@ -294,8 +294,8 @@ public class PackageWriterImpl extends HtmlDocletWriter
*/ */
@Override @Override
public void addPackageContent(Content contentTree, Content packageContentTree) { public void addPackageContent(Content contentTree, Content packageContentTree) {
mainTree.addContent(packageContentTree); mainTree.add(packageContentTree);
contentTree.addContent(mainTree); contentTree.add(mainTree);
} }
/** /**
@ -305,9 +305,9 @@ public class PackageWriterImpl extends HtmlDocletWriter
public void addPackageFooter(Content contentTree) { public void addPackageFooter(Content contentTree) {
Content htmlTree = HtmlTree.FOOTER(); Content htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.addContent(navBar.getContent(false)); htmlTree.add(navBar.getContent(false));
addBottom(htmlTree); addBottom(htmlTree);
contentTree.addContent(htmlTree); contentTree.add(htmlTree);
} }
/** /**

View File

@ -67,7 +67,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
*/ */
@Override @Override
public Content getMemberSummaryHeader(TypeElement typeElement, Content memberSummaryTree) { public Content getMemberSummaryHeader(TypeElement typeElement, Content memberSummaryTree) {
memberSummaryTree.addContent(MarkerComments.START_OF_PROPERTY_SUMMARY); memberSummaryTree.add(MarkerComments.START_OF_PROPERTY_SUMMARY);
Content memberTree = writer.getMemberTreeHeader(); Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree); writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree; return memberTree;
@ -87,12 +87,12 @@ public class PropertyWriterImpl extends AbstractMemberWriter
@Override @Override
public Content getPropertyDetailsTreeHeader(TypeElement typeElement, public Content getPropertyDetailsTreeHeader(TypeElement typeElement,
Content memberDetailsTree) { Content memberDetailsTree) {
memberDetailsTree.addContent(MarkerComments.START_OF_PROPERTY_DETAILS); memberDetailsTree.add(MarkerComments.START_OF_PROPERTY_DETAILS);
Content propertyDetailsTree = writer.getMemberTreeHeader(); Content propertyDetailsTree = writer.getMemberTreeHeader();
propertyDetailsTree.addContent(links.createAnchor(SectionName.PROPERTY_DETAIL)); propertyDetailsTree.add(links.createAnchor(SectionName.PROPERTY_DETAIL));
Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.propertyDetailsLabel); contents.propertyDetailsLabel);
propertyDetailsTree.addContent(heading); propertyDetailsTree.add(heading);
return propertyDetailsTree; return propertyDetailsTree;
} }
@ -102,11 +102,11 @@ public class PropertyWriterImpl extends AbstractMemberWriter
@Override @Override
public Content getPropertyDocTreeHeader(ExecutableElement property, public Content getPropertyDocTreeHeader(ExecutableElement property,
Content propertyDetailsTree) { Content propertyDetailsTree) {
propertyDetailsTree.addContent(links.createAnchor(name(property))); propertyDetailsTree.add(links.createAnchor(name(property)));
Content propertyDocTree = writer.getMemberTreeHeader(); Content propertyDocTree = writer.getMemberTreeHeader();
Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING); Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(utils.getPropertyLabel(name(property))); heading.add(utils.getPropertyLabel(name(property)));
propertyDocTree.addContent(heading); propertyDocTree.add(heading);
return propertyDocTree; return propertyDocTree;
} }
@ -121,8 +121,8 @@ public class PropertyWriterImpl extends AbstractMemberWriter
Content propertylink = writer.getLink(new LinkInfoImpl( Content propertylink = writer.getLink(new LinkInfoImpl(
configuration, LinkInfoImpl.Kind.MEMBER, configuration, LinkInfoImpl.Kind.MEMBER,
utils.getReturnType(property))); utils.getReturnType(property)));
pre.addContent(propertylink); pre.add(propertylink);
pre.addContent(" "); pre.add(" ");
if (configuration.linksource) { if (configuration.linksource) {
Content propertyName = new StringContent(name(property)); Content propertyName = new StringContent(name(property));
writer.addSrcLink(property, propertyName, pre); writer.addSrcLink(property, propertyName, pre);
@ -161,9 +161,9 @@ public class PropertyWriterImpl extends AbstractMemberWriter
utils.isClass(holder) utils.isClass(holder)
? contents.descfrmClassLabel ? contents.descfrmClassLabel
: contents.descfrmInterfaceLabel); : contents.descfrmInterfaceLabel);
descfrmLabel.addContent(Contents.SPACE); descfrmLabel.add(Contents.SPACE);
descfrmLabel.addContent(codeLink); descfrmLabel.add(codeLink);
propertyDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, descfrmLabel)); propertyDocTree.add(HtmlTree.DIV(HtmlStyle.block, descfrmLabel));
writer.addInlineComment(property, propertyDocTree); writer.addInlineComment(property, propertyDocTree);
} }
} }
@ -201,7 +201,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
public void addSummaryLabel(Content memberTree) { public void addSummaryLabel(Content memberTree) {
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.propertySummaryLabel); contents.propertySummaryLabel);
memberTree.addContent(label); memberTree.add(label);
} }
/** /**
@ -230,7 +230,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
*/ */
@Override @Override
public void addSummaryAnchor(TypeElement typeElement, Content memberTree) { public void addSummaryAnchor(TypeElement typeElement, Content memberTree) {
memberTree.addContent(links.createAnchor(SectionName.PROPERTY_SUMMARY)); memberTree.add(links.createAnchor(SectionName.PROPERTY_SUMMARY));
} }
/** /**
@ -238,7 +238,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
*/ */
@Override @Override
public void addInheritedSummaryAnchor(TypeElement typeElement, Content inheritedTree) { public void addInheritedSummaryAnchor(TypeElement typeElement, Content inheritedTree) {
inheritedTree.addContent(links.createAnchor( inheritedTree.add(links.createAnchor(
SectionName.PROPERTIES_INHERITANCE, SectionName.PROPERTIES_INHERITANCE,
configuration.getClassName(typeElement))); configuration.getClassName(typeElement)));
} }
@ -262,9 +262,9 @@ public class PropertyWriterImpl extends AbstractMemberWriter
} }
Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.INHERITED_SUMMARY_HEADING, Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.INHERITED_SUMMARY_HEADING,
label); label);
labelHeading.addContent(Contents.SPACE); labelHeading.add(Contents.SPACE);
labelHeading.addContent(classLink); labelHeading.add(classLink);
inheritedTree.addContent(labelHeading); inheritedTree.add(labelHeading);
} }
/** /**
@ -281,7 +281,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
true)); true));
Content code = HtmlTree.CODE(memberLink); Content code = HtmlTree.CODE(memberLink);
tdSummary.addContent(code); tdSummary.add(code);
} }
/** /**
@ -293,7 +293,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
Content content = writer.getDocLink(LinkInfoImpl.Kind.MEMBER, typeElement, member, Content content = writer.getDocLink(LinkInfoImpl.Kind.MEMBER, typeElement, member,
utils.isProperty(mname) ? utils.getPropertyName(mname) : mname, utils.isProperty(mname) ? utils.getPropertyName(mname) : mname,
false, true); false, true);
linksTree.addContent(content); linksTree.add(content);
} }
/** /**

View File

@ -82,13 +82,13 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
HtmlTree htmlTree = HtmlTree.HEADER(); HtmlTree htmlTree = HtmlTree.HEADER();
addTop(htmlTree); addTop(htmlTree);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.addContent(navBar.getContent(true)); htmlTree.add(navBar.getContent(true));
bodyTree.addContent(htmlTree); bodyTree.add(htmlTree);
Content h1Content = new StringContent(header); Content h1Content = new StringContent(header);
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true, Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, h1Content); HtmlStyle.title, h1Content);
Content div = HtmlTree.DIV(HtmlStyle.header, heading); Content div = HtmlTree.DIV(HtmlStyle.header, heading);
mainTree.addContent(div); mainTree.add(div);
return bodyTree; return bodyTree;
} }
@ -121,8 +121,8 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
public Content getPackageHeader(String packageName) { public Content getPackageHeader(String packageName) {
Content heading = HtmlTree.HEADING(Headings.SerializedForm.PACKAGE_HEADING, true, Content heading = HtmlTree.HEADING(Headings.SerializedForm.PACKAGE_HEADING, true,
contents.packageLabel); contents.packageLabel);
heading.addContent(Contents.SPACE); heading.add(Contents.SPACE);
heading.addContent(packageName); heading.add(packageName);
return heading; return heading;
} }
@ -172,7 +172,7 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
contents.getContent( contents.getContent(
"doclet.Class_0_extends_implements_serializable", classLink, "doclet.Class_0_extends_implements_serializable", classLink,
superClassLink); superClassLink);
li.addContent(HtmlTree.HEADING(Headings.SerializedForm.CLASS_HEADING, className)); li.add(HtmlTree.HEADING(Headings.SerializedForm.CLASS_HEADING, className));
return li; return li;
} }
@ -198,9 +198,9 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
public void addSerialUIDInfo(String header, String serialUID, public void addSerialUIDInfo(String header, String serialUID,
Content serialUidTree) { Content serialUidTree) {
Content headerContent = new StringContent(header); Content headerContent = new StringContent(header);
serialUidTree.addContent(HtmlTree.DT(headerContent)); serialUidTree.add(HtmlTree.DT(headerContent));
Content serialContent = new StringContent(serialUID); Content serialContent = new StringContent(serialUID);
serialUidTree.addContent(HtmlTree.DD(serialContent)); serialUidTree.add(HtmlTree.DD(serialContent));
} }
/** /**
@ -223,7 +223,7 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
public Content getSerializedContent(Content serializedTreeContent) { public Content getSerializedContent(Content serializedTreeContent) {
HtmlTree divContent = HtmlTree.DIV(HtmlStyle.serializedFormContainer, HtmlTree divContent = HtmlTree.DIV(HtmlStyle.serializedFormContainer,
serializedTreeContent); serializedTreeContent);
mainTree.addContent(divContent); mainTree.add(divContent);
return mainTree; return mainTree;
} }
@ -232,7 +232,7 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
*/ */
public void addPackageSerializedTree(Content serializedSummariesTree, public void addPackageSerializedTree(Content serializedSummariesTree,
Content packageSerializedTree) { Content packageSerializedTree) {
serializedSummariesTree.addContent(HtmlTree.LI(HtmlStyle.blockList, packageSerializedTree)); serializedSummariesTree.add(HtmlTree.LI(HtmlStyle.blockList, packageSerializedTree));
} }
/** /**
@ -243,9 +243,9 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
public void addFooter(Content serializedTree) { public void addFooter(Content serializedTree) {
Content htmlTree = HtmlTree.FOOTER(); Content htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.addContent(navBar.getContent(false)); htmlTree.add(navBar.getContent(false));
addBottom(htmlTree); addBottom(htmlTree);
serializedTree.addContent(htmlTree); serializedTree.add(htmlTree);
} }
/** /**

View File

@ -96,10 +96,10 @@ public class SingleIndexWriter extends AbstractIndexWriter {
HtmlTree header = HtmlTree.HEADER(); HtmlTree header = HtmlTree.HEADER();
addTop(header); addTop(header);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
header.addContent(navBar.getContent(true)); header.add(navBar.getContent(true));
body.addContent(header); body.add(header);
HtmlTree main = HtmlTree.MAIN(); HtmlTree main = HtmlTree.MAIN();
main.addContent(HtmlTree.DIV(HtmlStyle.header, main.add(HtmlTree.DIV(HtmlStyle.header,
HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
contents.getContent("doclet.Index")))); contents.getContent("doclet.Index"))));
HtmlTree divTree = new HtmlTree(HtmlTag.DIV); HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
@ -118,13 +118,13 @@ public class SingleIndexWriter extends AbstractIndexWriter {
} }
} }
addLinksForIndexes(divTree); addLinksForIndexes(divTree);
main.addContent(divTree); main.add(divTree);
body.addContent(main); body.add(main);
HtmlTree footer = HtmlTree.FOOTER(); HtmlTree footer = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
footer.addContent(navBar.getContent(false)); footer.add(navBar.getContent(false));
addBottom(footer); addBottom(footer);
body.addContent(footer); body.add(footer);
createSearchIndexFiles(); createSearchIndexFiles();
printHtmlDocument(null, "index", body); printHtmlDocument(null, "index", body);
} }
@ -137,17 +137,17 @@ public class SingleIndexWriter extends AbstractIndexWriter {
protected void addLinksForIndexes(Content contentTree) { protected void addLinksForIndexes(Content contentTree) {
for (Object ch : elements) { for (Object ch : elements) {
String unicode = ch.toString(); String unicode = ch.toString();
contentTree.addContent( contentTree.add(
links.createLink(getNameForIndex(unicode), links.createLink(getNameForIndex(unicode),
new StringContent(unicode))); new StringContent(unicode)));
contentTree.addContent(Contents.SPACE); contentTree.add(Contents.SPACE);
} }
contentTree.addContent(new HtmlTree(HtmlTag.BR)); contentTree.add(new HtmlTree(HtmlTag.BR));
contentTree.addContent(links.createLink(DocPaths.ALLCLASSES_INDEX, contentTree.add(links.createLink(DocPaths.ALLCLASSES_INDEX,
contents.allClassesLabel)); contents.allClassesLabel));
if (!configuration.packages.isEmpty()) { if (!configuration.packages.isEmpty()) {
contentTree.addContent(Contents.SPACE); contentTree.add(Contents.SPACE);
contentTree.addContent(links.createLink(DocPaths.ALLPACKAGES_INDEX, contentTree.add(links.createLink(DocPaths.ALLPACKAGES_INDEX,
contents.allPackagesLabel)); contents.allPackagesLabel));
} }
} }

View File

@ -36,7 +36,6 @@ import javax.lang.model.element.TypeElement;
import javax.tools.FileObject; import javax.tools.FileObject;
import jdk.javadoc.doclet.DocletEnvironment; import jdk.javadoc.doclet.DocletEnvironment;
import jdk.javadoc.internal.doclets.formats.html.markup.DocType;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlDocument; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlDocument;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
@ -196,7 +195,7 @@ public class SourceToHTMLConverter {
} }
addBlankLines(pre); addBlankLines(pre);
Content div = HtmlTree.DIV(HtmlStyle.sourceContainer, pre); Content div = HtmlTree.DIV(HtmlStyle.sourceContainer, pre);
body.addContent(HtmlTree.MAIN(div)); body.add(HtmlTree.MAIN(div));
writeToFile(body, outputdir.resolve(configuration.docPaths.forClass(te)), te); writeToFile(body, outputdir.resolve(configuration.docPaths.forClass(te)), te);
} catch (IOException e) { } catch (IOException e) {
String message = resources.getText("doclet.exception.read.file", fo.getName()); String message = resources.getText("doclet.exception.read.file", fo.getName());
@ -242,7 +241,7 @@ public class SourceToHTMLConverter {
} }
DocPath p = relativePath.resolve(stylesheet); DocPath p = relativePath.resolve(stylesheet);
HtmlTree link = HtmlTree.LINK("stylesheet", "text/css", p.getPath(), "Style"); HtmlTree link = HtmlTree.LINK("stylesheet", "text/css", p.getPath(), "Style");
head.addContent(link); head.add(link);
addStylesheets(head); addStylesheets(head);
} }
@ -254,7 +253,7 @@ public class SourceToHTMLConverter {
DocPath ssheetPath = DocPath.create(file.getName()); DocPath ssheetPath = DocPath.create(file.getName());
HtmlTree slink = HtmlTree.LINK("stylesheet", "text/css", relativePath.resolve(ssheetPath).getPath(), HtmlTree slink = HtmlTree.LINK("stylesheet", "text/css", relativePath.resolve(ssheetPath).getPath(),
"Style"); "Style");
tree.addContent(slink); tree.add(slink);
}); });
} }
} }
@ -265,7 +264,7 @@ public class SourceToHTMLConverter {
* @return the header content for the HTML file * @return the header content for the HTML file
*/ */
private static Content getHeader() { private static Content getHeader() {
return new HtmlTree(HtmlTag.BODY).addAttr(HtmlAttr.CLASS, "source"); return new HtmlTree(HtmlTag.BODY).put(HtmlAttr.CLASS, "source");
} }
/** /**
@ -278,13 +277,13 @@ public class SourceToHTMLConverter {
HtmlTree span = new HtmlTree(HtmlTag.SPAN); HtmlTree span = new HtmlTree(HtmlTag.SPAN);
span.setStyle(HtmlStyle.sourceLineNo); span.setStyle(HtmlStyle.sourceLineNo);
if (lineno < 10) { if (lineno < 10) {
span.addContent("00" + Integer.toString(lineno)); span.add("00" + Integer.toString(lineno));
} else if (lineno < 100) { } else if (lineno < 100) {
span.addContent("0" + Integer.toString(lineno)); span.add("0" + Integer.toString(lineno));
} else { } else {
span.addContent(Integer.toString(lineno)); span.add(Integer.toString(lineno));
} }
pre.addContent(span); pre.add(span);
} }
/** /**
@ -299,8 +298,8 @@ public class SourceToHTMLConverter {
Content anchor = HtmlTree.A_ID( Content anchor = HtmlTree.A_ID(
"line." + Integer.toString(currentLineNo), "line." + Integer.toString(currentLineNo),
new StringContent(utils.replaceTabs(line))); new StringContent(utils.replaceTabs(line)));
pre.addContent(anchor); pre.add(anchor);
pre.addContent(NEW_LINE); pre.add(NEW_LINE);
} }
} }
@ -311,7 +310,7 @@ public class SourceToHTMLConverter {
*/ */
private static void addBlankLines(Content pre) { private static void addBlankLines(Content pre) {
for (int i = 0; i < NUM_BLANK_LINES; i++) { for (int i = 0; i < NUM_BLANK_LINES; i++) {
pre.addContent(NEW_LINE); pre.add(NEW_LINE);
} }
} }

View File

@ -124,10 +124,10 @@ public class SplitIndexWriter extends AbstractIndexWriter {
HtmlTree header = HtmlTree.HEADER(); HtmlTree header = HtmlTree.HEADER();
addTop(header); addTop(header);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
header.addContent(navBar.getContent(true)); header.add(navBar.getContent(true));
body.addContent(header); body.add(header);
HtmlTree main = HtmlTree.MAIN(); HtmlTree main = HtmlTree.MAIN();
main.addContent(HtmlTree.DIV(HtmlStyle.header, main.add(HtmlTree.DIV(HtmlStyle.header,
HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
contents.getContent("doclet.Index")))); contents.getContent("doclet.Index"))));
HtmlTree divTree = new HtmlTree(HtmlTag.DIV); HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
@ -142,13 +142,13 @@ public class SplitIndexWriter extends AbstractIndexWriter {
configuration.tagSearchIndexMap.get(unicode), divTree); configuration.tagSearchIndexMap.get(unicode), divTree);
} }
addLinksForIndexes(divTree); addLinksForIndexes(divTree);
main.addContent(divTree); main.add(divTree);
body.addContent(main); body.add(main);
HtmlTree footer = HtmlTree.FOOTER(); HtmlTree footer = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
footer.addContent(navBar.getContent(false)); footer.add(navBar.getContent(false));
addBottom(footer); addBottom(footer);
body.addContent(footer); body.add(footer);
String description = "index: " + unicode; String description = "index: " + unicode;
printHtmlDocument(null, description, body); printHtmlDocument(null, description, body);
} }
@ -161,16 +161,16 @@ public class SplitIndexWriter extends AbstractIndexWriter {
protected void addLinksForIndexes(Content contentTree) { protected void addLinksForIndexes(Content contentTree) {
for (int i = 0; i < indexElements.size(); i++) { for (int i = 0; i < indexElements.size(); i++) {
int j = i + 1; int j = i + 1;
contentTree.addContent(links.createLink(DocPaths.indexN(j), contentTree.add(links.createLink(DocPaths.indexN(j),
new StringContent(indexElements.get(i).toString()))); new StringContent(indexElements.get(i).toString())));
contentTree.addContent(Contents.SPACE); contentTree.add(Contents.SPACE);
} }
contentTree.addContent(new HtmlTree(HtmlTag.BR)); contentTree.add(new HtmlTree(HtmlTag.BR));
contentTree.addContent(links.createLink(pathToRoot.resolve(DocPaths.ALLCLASSES_INDEX), contentTree.add(links.createLink(pathToRoot.resolve(DocPaths.ALLCLASSES_INDEX),
contents.allClassesLabel)); contents.allClassesLabel));
if (!configuration.packages.isEmpty()) { if (!configuration.packages.isEmpty()) {
contentTree.addContent(Contents.SPACE); contentTree.add(Contents.SPACE);
contentTree.addContent(links.createLink(pathToRoot.resolve(DocPaths.ALLPACKAGES_INDEX), contentTree.add(links.createLink(pathToRoot.resolve(DocPaths.ALLPACKAGES_INDEX),
contents.allPackagesLabel)); contents.allPackagesLabel));
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -122,14 +122,14 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
if (!deprs.isEmpty()) { if (!deprs.isEmpty()) {
addSummaryDeprecatedComment(member, deprs.get(0), div); addSummaryDeprecatedComment(member, deprs.get(0), div);
} }
tdSummary.addContent(div); tdSummary.add(div);
return; return;
} else { } else {
Element te = member.getEnclosingElement(); Element te = member.getEnclosingElement();
if (te != null && utils.isTypeElement(te) && utils.isDeprecated(te)) { if (te != null && utils.isTypeElement(te) && utils.isDeprecated(te)) {
Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(te)); Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(te));
div = HtmlTree.DIV(HtmlStyle.block, deprLabel); div = HtmlTree.DIV(HtmlStyle.block, deprLabel);
tdSummary.addContent(div); tdSummary.add(div);
} }
} }
addSummaryComment(member, firstSentenceTags, tdSummary); addSummaryComment(member, firstSentenceTags, tdSummary);
@ -172,7 +172,7 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
public void addInheritedMemberSummary(AbstractMemberWriter mw, TypeElement typeElement, public void addInheritedMemberSummary(AbstractMemberWriter mw, TypeElement typeElement,
Element member, boolean isFirst, Content linksTree) { Element member, boolean isFirst, Content linksTree) {
if (! isFirst) { if (! isFirst) {
linksTree.addContent(", "); linksTree.add(", ");
} }
mw.addInheritedSummaryLink(typeElement, member, linksTree); mw.addInheritedSummaryLink(typeElement, member, linksTree);
} }
@ -195,8 +195,8 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
* @param classContentTree class content tree which will be added to the content tree * @param classContentTree class content tree which will be added to the content tree
*/ */
public void addClassContentTree(Content contentTree, Content classContentTree) { public void addClassContentTree(Content contentTree, Content classContentTree) {
mainTree.addContent(classContentTree); mainTree.add(classContentTree);
contentTree.addContent(mainTree); contentTree.add(mainTree);
} }
/** /**
@ -228,7 +228,7 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
*/ */
public void addMemberTree(Content memberSummaryTree, Content memberTree) { public void addMemberTree(Content memberSummaryTree, Content memberTree) {
HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(memberTree)); HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(memberTree));
memberSummaryTree.addContent(htmlTree); memberSummaryTree.add(htmlTree);
} }
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -28,8 +28,6 @@ package jdk.javadoc.internal.doclets.formats.html;
import java.util.List; import java.util.List;
import javax.lang.model.element.Element; import javax.lang.model.element.Element;
import javax.lang.model.element.ModuleElement;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement; import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement; import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeMirror; import javax.lang.model.type.TypeMirror;
@ -140,29 +138,29 @@ public class TagletWriterImpl extends TagletWriter {
List<? extends DocTree> deprs = utils.getBlockTags(element, DocTree.Kind.DEPRECATED); List<? extends DocTree> deprs = utils.getBlockTags(element, DocTree.Kind.DEPRECATED);
if (utils.isTypeElement(element)) { if (utils.isTypeElement(element)) {
if (utils.isDeprecated(element)) { if (utils.isDeprecated(element)) {
result.addContent(HtmlTree.SPAN(HtmlStyle.deprecatedLabel, result.add(HtmlTree.SPAN(HtmlStyle.deprecatedLabel,
htmlWriter.getDeprecatedPhrase(element))); htmlWriter.getDeprecatedPhrase(element)));
if (!deprs.isEmpty()) { if (!deprs.isEmpty()) {
List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0)); List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0));
if (!commentTags.isEmpty()) { if (!commentTags.isEmpty()) {
result.addContent(commentTagsToOutput(null, element, commentTags, false)); result.add(commentTagsToOutput(null, element, commentTags, false));
} }
} }
} }
} else { } else {
if (utils.isDeprecated(element)) { if (utils.isDeprecated(element)) {
result.addContent(HtmlTree.SPAN(HtmlStyle.deprecatedLabel, result.add(HtmlTree.SPAN(HtmlStyle.deprecatedLabel,
htmlWriter.getDeprecatedPhrase(element))); htmlWriter.getDeprecatedPhrase(element)));
if (!deprs.isEmpty()) { if (!deprs.isEmpty()) {
List<? extends DocTree> bodyTags = ch.getBody(configuration, deprs.get(0)); List<? extends DocTree> bodyTags = ch.getBody(configuration, deprs.get(0));
Content body = commentTagsToOutput(null, element, bodyTags, false); Content body = commentTagsToOutput(null, element, bodyTags, false);
if (!body.isEmpty()) if (!body.isEmpty())
result.addContent(HtmlTree.DIV(HtmlStyle.deprecationComment, body)); result.add(HtmlTree.DIV(HtmlStyle.deprecationComment, body));
} }
} else { } else {
Element ee = utils.getEnclosingTypeElement(element); Element ee = utils.getEnclosingTypeElement(element);
if (utils.isDeprecated(ee)) { if (utils.isDeprecated(ee)) {
result.addContent(HtmlTree.SPAN(HtmlStyle.deprecatedLabel, result.add(HtmlTree.SPAN(HtmlStyle.deprecatedLabel,
htmlWriter.getDeprecatedPhrase(ee))); htmlWriter.getDeprecatedPhrase(ee)));
} }
} }
@ -194,10 +192,10 @@ public class TagletWriterImpl extends TagletWriter {
public Content paramTagOutput(Element element, DocTree paramTag, String paramName) { public Content paramTagOutput(Element element, DocTree paramTag, String paramName) {
ContentBuilder body = new ContentBuilder(); ContentBuilder body = new ContentBuilder();
CommentHelper ch = utils.getCommentHelper(element); CommentHelper ch = utils.getCommentHelper(element);
body.addContent(HtmlTree.CODE(new RawHtml(paramName))); body.add(HtmlTree.CODE(new RawHtml(paramName)));
body.addContent(" - "); body.add(" - ");
List<? extends DocTree> description = ch.getDescription(configuration, paramTag); List<? extends DocTree> description = ch.getDescription(configuration, paramTag);
body.addContent(htmlWriter.commentTagsToContent(paramTag, element, description, false, inSummary)); body.add(htmlWriter.commentTagsToContent(paramTag, element, description, false, inSummary));
HtmlTree result = HtmlTree.DD(body); HtmlTree result = HtmlTree.DD(body);
return result; return result;
} }
@ -208,10 +206,10 @@ public class TagletWriterImpl extends TagletWriter {
public Content propertyTagOutput(Element element, DocTree tag, String prefix) { public Content propertyTagOutput(Element element, DocTree tag, String prefix) {
Content body = new ContentBuilder(); Content body = new ContentBuilder();
CommentHelper ch = utils.getCommentHelper(element); CommentHelper ch = utils.getCommentHelper(element);
body.addContent(new RawHtml(prefix)); body.add(new RawHtml(prefix));
body.addContent(" "); body.add(" ");
body.addContent(HtmlTree.CODE(new RawHtml(ch.getText(tag)))); body.add(HtmlTree.CODE(new RawHtml(ch.getText(tag))));
body.addContent("."); body.add(".");
Content result = HtmlTree.P(body); Content result = HtmlTree.P(body);
return result; return result;
} }
@ -222,9 +220,9 @@ public class TagletWriterImpl extends TagletWriter {
public Content returnTagOutput(Element element, DocTree returnTag) { public Content returnTagOutput(Element element, DocTree returnTag) {
ContentBuilder result = new ContentBuilder(); ContentBuilder result = new ContentBuilder();
CommentHelper ch = utils.getCommentHelper(element); CommentHelper ch = utils.getCommentHelper(element);
result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.returnLabel, result.add(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.returnLabel,
new StringContent(resources.getText("doclet.Returns"))))); new StringContent(resources.getText("doclet.Returns")))));
result.addContent(HtmlTree.DD(htmlWriter.commentTagsToContent( result.add(HtmlTree.DD(htmlWriter.commentTagsToContent(
returnTag, element, ch.getDescription(configuration, returnTag), false, inSummary))); returnTag, element, ch.getDescription(configuration, returnTag), false, inSummary)));
return result; return result;
} }
@ -236,7 +234,7 @@ public class TagletWriterImpl extends TagletWriter {
ContentBuilder body = new ContentBuilder(); ContentBuilder body = new ContentBuilder();
for (DocTree dt : seeTags) { for (DocTree dt : seeTags) {
appendSeparatorIfNotEmpty(body); appendSeparatorIfNotEmpty(body);
body.addContent(htmlWriter.seeTagToContent(holder, dt)); body.add(htmlWriter.seeTagToContent(holder, dt));
} }
if (utils.isVariableElement(holder) && ((VariableElement)holder).getConstantValue() != null && if (utils.isVariableElement(holder) && ((VariableElement)holder).getConstantValue() != null &&
htmlWriter instanceof ClassWriterImpl) { htmlWriter instanceof ClassWriterImpl) {
@ -248,7 +246,7 @@ public class TagletWriterImpl extends TagletWriter {
((ClassWriterImpl) htmlWriter).getTypeElement().getQualifiedName() + "." + ((ClassWriterImpl) htmlWriter).getTypeElement().getQualifiedName() + "." +
utils.getSimpleName(holder); utils.getSimpleName(holder);
DocLink link = constantsPath.fragment(whichConstant); DocLink link = constantsPath.fragment(whichConstant);
body.addContent(htmlWriter.links.createLink(link, body.add(htmlWriter.links.createLink(link,
new StringContent(resources.getText("doclet.Constants_Summary")))); new StringContent(resources.getText("doclet.Constants_Summary"))));
} }
if (utils.isClass(holder) && utils.isSerializable((TypeElement)holder)) { if (utils.isClass(holder) && utils.isSerializable((TypeElement)holder)) {
@ -258,7 +256,7 @@ public class TagletWriterImpl extends TagletWriter {
appendSeparatorIfNotEmpty(body); appendSeparatorIfNotEmpty(body);
DocPath serialPath = htmlWriter.pathToRoot.resolve(DocPaths.SERIALIZED_FORM); DocPath serialPath = htmlWriter.pathToRoot.resolve(DocPaths.SERIALIZED_FORM);
DocLink link = serialPath.fragment(utils.getFullyQualifiedName(holder)); DocLink link = serialPath.fragment(utils.getFullyQualifiedName(holder));
body.addContent(htmlWriter.links.createLink(link, body.add(htmlWriter.links.createLink(link,
new StringContent(resources.getText("doclet.Serialized_Form")))); new StringContent(resources.getText("doclet.Serialized_Form"))));
} }
} }
@ -266,17 +264,17 @@ public class TagletWriterImpl extends TagletWriter {
return body; return body;
ContentBuilder result = new ContentBuilder(); ContentBuilder result = new ContentBuilder();
result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.seeLabel, result.add(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.seeLabel,
new StringContent(resources.getText("doclet.See_Also"))))); new StringContent(resources.getText("doclet.See_Also")))));
result.addContent(HtmlTree.DD(body)); result.add(HtmlTree.DD(body));
return result; return result;
} }
private void appendSeparatorIfNotEmpty(ContentBuilder body) { private void appendSeparatorIfNotEmpty(ContentBuilder body) {
if (!body.isEmpty()) { if (!body.isEmpty()) {
body.addContent(", "); body.add(", ");
body.addContent(DocletConstants.NL); body.add(DocletConstants.NL);
} }
} }
@ -286,18 +284,18 @@ public class TagletWriterImpl extends TagletWriter {
public Content simpleTagOutput(Element element, List<? extends DocTree> simpleTags, String header) { public Content simpleTagOutput(Element element, List<? extends DocTree> simpleTags, String header) {
CommentHelper ch = utils.getCommentHelper(element); CommentHelper ch = utils.getCommentHelper(element);
ContentBuilder result = new ContentBuilder(); ContentBuilder result = new ContentBuilder();
result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.simpleTagLabel, new RawHtml(header)))); result.add(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.simpleTagLabel, new RawHtml(header))));
ContentBuilder body = new ContentBuilder(); ContentBuilder body = new ContentBuilder();
boolean many = false; boolean many = false;
for (DocTree simpleTag : simpleTags) { for (DocTree simpleTag : simpleTags) {
if (many) { if (many) {
body.addContent(", "); body.add(", ");
} }
List<? extends DocTree> bodyTags = ch.getBody(configuration, simpleTag); List<? extends DocTree> bodyTags = ch.getBody(configuration, simpleTag);
body.addContent(htmlWriter.commentTagsToContent(simpleTag, element, bodyTags, false, inSummary)); body.add(htmlWriter.commentTagsToContent(simpleTag, element, bodyTags, false, inSummary));
many = true; many = true;
} }
result.addContent(HtmlTree.DD(body)); result.add(HtmlTree.DD(body));
return result; return result;
} }
@ -306,11 +304,11 @@ public class TagletWriterImpl extends TagletWriter {
*/ */
public Content simpleTagOutput(Element element, DocTree simpleTag, String header) { public Content simpleTagOutput(Element element, DocTree simpleTag, String header) {
ContentBuilder result = new ContentBuilder(); ContentBuilder result = new ContentBuilder();
result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.simpleTagLabel, new RawHtml(header)))); result.add(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.simpleTagLabel, new RawHtml(header))));
CommentHelper ch = utils.getCommentHelper(element); CommentHelper ch = utils.getCommentHelper(element);
List<? extends DocTree> description = ch.getDescription(configuration, simpleTag); List<? extends DocTree> description = ch.getDescription(configuration, simpleTag);
Content body = htmlWriter.commentTagsToContent(simpleTag, element, description, false, inSummary); Content body = htmlWriter.commentTagsToContent(simpleTag, element, description, false, inSummary);
result.addContent(HtmlTree.DD(body)); result.add(HtmlTree.DD(body));
return result; return result;
} }
@ -351,12 +349,12 @@ public class TagletWriterImpl extends TagletWriter {
link.excludeTypeBounds = true; link.excludeTypeBounds = true;
excName = htmlWriter.getLink(link); excName = htmlWriter.getLink(link);
} }
body.addContent(HtmlTree.CODE(excName)); body.add(HtmlTree.CODE(excName));
List<? extends DocTree> description = ch.getDescription(configuration, throwsTag); List<? extends DocTree> description = ch.getDescription(configuration, throwsTag);
Content desc = htmlWriter.commentTagsToContent(throwsTag, element, description, false, inSummary); Content desc = htmlWriter.commentTagsToContent(throwsTag, element, description, false, inSummary);
if (desc != null && !desc.isEmpty()) { if (desc != null && !desc.isEmpty()) {
body.addContent(" - "); body.add(" - ");
body.addContent(desc); body.add(desc);
} }
HtmlTree result = HtmlTree.DD(body); HtmlTree result = HtmlTree.DD(body);
return result; return result;

View File

@ -112,20 +112,20 @@ public class TreeWriter extends AbstractTreeWriter {
Content div = HtmlTree.DIV(HtmlStyle.header, heading); Content div = HtmlTree.DIV(HtmlStyle.header, heading);
addPackageTreeLinks(div); addPackageTreeLinks(div);
HtmlTree htmlTree = HtmlTree.MAIN(); HtmlTree htmlTree = HtmlTree.MAIN();
htmlTree.addContent(div); htmlTree.add(div);
HtmlTree divTree = new HtmlTree(HtmlTag.DIV); HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
divTree.setStyle(HtmlStyle.contentContainer); divTree.setStyle(HtmlStyle.contentContainer);
addTree(classtree.baseClasses(), "doclet.Class_Hierarchy", divTree); addTree(classtree.baseClasses(), "doclet.Class_Hierarchy", divTree);
addTree(classtree.baseInterfaces(), "doclet.Interface_Hierarchy", divTree); addTree(classtree.baseInterfaces(), "doclet.Interface_Hierarchy", divTree);
addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree); addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree);
addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree, true); addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree, true);
htmlTree.addContent(divTree); htmlTree.add(divTree);
body.addContent(htmlTree); body.add(htmlTree);
htmlTree = HtmlTree.FOOTER(); htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.addContent(navBar.getContent(false)); htmlTree.add(navBar.getContent(false));
addBottom(htmlTree); addBottom(htmlTree);
body.addContent(htmlTree); body.add(htmlTree);
printHtmlDocument(null, "class tree", body); printHtmlDocument(null, "class tree", body);
} }
@ -142,7 +142,7 @@ public class TreeWriter extends AbstractTreeWriter {
if (!classesOnly) { if (!classesOnly) {
Content span = HtmlTree.SPAN(HtmlStyle.packageHierarchyLabel, Content span = HtmlTree.SPAN(HtmlStyle.packageHierarchyLabel,
contents.packageHierarchies); contents.packageHierarchies);
contentTree.addContent(span); contentTree.add(span);
HtmlTree ul = new HtmlTree(HtmlTag.UL); HtmlTree ul = new HtmlTree(HtmlTag.UL);
ul.setStyle(HtmlStyle.horizontal); ul.setStyle(HtmlStyle.horizontal);
int i = 0; int i = 0;
@ -159,12 +159,12 @@ public class TreeWriter extends AbstractTreeWriter {
Content li = HtmlTree.LI(links.createLink(link, Content li = HtmlTree.LI(links.createLink(link,
new StringContent(utils.getPackageName(pkg)))); new StringContent(utils.getPackageName(pkg))));
if (i < packages.size() - 1) { if (i < packages.size() - 1) {
li.addContent(", "); li.add(", ");
} }
ul.addContent(li); ul.add(li);
i++; i++;
} }
contentTree.addContent(ul); contentTree.add(ul);
} }
} }
@ -179,8 +179,8 @@ public class TreeWriter extends AbstractTreeWriter {
HtmlTree htmlTree = HtmlTree.HEADER(); HtmlTree htmlTree = HtmlTree.HEADER();
addTop(htmlTree); addTop(htmlTree);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.addContent(navBar.getContent(true)); htmlTree.add(navBar.getContent(true));
bodyTree.addContent(htmlTree); bodyTree.add(htmlTree);
return bodyTree; return bodyTree;
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -60,7 +60,7 @@ public class Comment extends Content {
* @param content content that needs to be added * @param content content that needs to be added
* @throws UnsupportedOperationException always * @throws UnsupportedOperationException always
*/ */
public void addContent(Content content) { public void add(Content content) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@ -71,7 +71,7 @@ public class Comment extends Content {
* @throws UnsupportedOperationException always * @throws UnsupportedOperationException always
*/ */
@Override @Override
public void addContent(CharSequence stringContent) { public void add(CharSequence stringContent) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -43,12 +43,12 @@ public class ContentBuilder extends Content {
public ContentBuilder(Content... contents) { public ContentBuilder(Content... contents) {
for (Content c : contents) { for (Content c : contents) {
addContent(c); add(c);
} }
} }
@Override @Override
public void addContent(Content content) { public void add(Content content) {
nullCheck(content); nullCheck(content);
ensureMutableContents(); ensureMutableContents();
if (content instanceof ContentBuilder) { if (content instanceof ContentBuilder) {
@ -58,7 +58,7 @@ public class ContentBuilder extends Content {
} }
@Override @Override
public void addContent(CharSequence text) { public void add(CharSequence text) {
if (text.length() == 0) if (text.length() == 0)
return; return;
ensureMutableContents(); ensureMutableContents();
@ -69,7 +69,7 @@ public class ContentBuilder extends Content {
} else { } else {
contents.add(sc = new StringContent()); contents.add(sc = new StringContent());
} }
sc.addContent(text); sc.add(text);
} }
@Override @Override

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -59,7 +59,7 @@ public class FixedStringContent extends Content {
* @throws UnsupportedOperationException always * @throws UnsupportedOperationException always
*/ */
@Override @Override
public void addContent(Content content) { public void add(Content content) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@ -71,7 +71,7 @@ public class FixedStringContent extends Content {
* @throws UnsupportedOperationException always * @throws UnsupportedOperationException always
*/ */
@Override @Override
public void addContent(CharSequence strContent) { public void add(CharSequence strContent) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -251,40 +251,40 @@ public class Head {
Date now = showTimestamp ? calendar.getTime() : null; Date now = showTimestamp ? calendar.getTime() : null;
HtmlTree tree = new HtmlTree(HtmlTag.HEAD); HtmlTree tree = new HtmlTree(HtmlTag.HEAD);
tree.addContent(getGeneratedBy(showTimestamp, now)); tree.add(getGeneratedBy(showTimestamp, now));
tree.addContent(HtmlTree.TITLE(title)); tree.add(HtmlTree.TITLE(title));
if (charset != null) { // compatibility; should this be allowed? if (charset != null) { // compatibility; should this be allowed?
tree.addContent(HtmlTree.META("Content-Type", "text/html", charset)); tree.add(HtmlTree.META("Content-Type", "text/html", charset));
} }
if (showTimestamp) { if (showTimestamp) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
tree.addContent(HtmlTree.META("dc.created", dateFormat.format(now))); tree.add(HtmlTree.META("dc.created", dateFormat.format(now)));
} }
if (description != null) { if (description != null) {
tree.addContent(HtmlTree.META("description", description)); tree.add(HtmlTree.META("description", description));
} }
if (generator != null) { if (generator != null) {
tree.addContent(HtmlTree.META("generator", generator)); tree.add(HtmlTree.META("generator", generator));
} }
for (String k : keywords) { for (String k : keywords) {
tree.addContent(HtmlTree.META("keywords", k)); tree.add(HtmlTree.META("keywords", k));
} }
if (canonicalLink != null) { if (canonicalLink != null) {
HtmlTree link = new HtmlTree(HtmlTag.LINK); HtmlTree link = new HtmlTree(HtmlTag.LINK);
link.addAttr(HtmlAttr.REL, "canonical"); link.put(HtmlAttr.REL, "canonical");
link.addAttr(HtmlAttr.HREF, canonicalLink.getPath()); link.put(HtmlAttr.HREF, canonicalLink.getPath());
tree.addContent(link); tree.add(link);
} }
addStylesheets(tree); addStylesheets(tree);
addScripts(tree); addScripts(tree);
extraContent.forEach(tree::addContent); extraContent.forEach(tree::add);
return tree; return tree;
} }
@ -316,13 +316,13 @@ public class Head {
} }
private void addStylesheet(HtmlTree tree, DocPath stylesheet) { private void addStylesheet(HtmlTree tree, DocPath stylesheet) {
tree.addContent(HtmlTree.LINK("stylesheet", "text/css", tree.add(HtmlTree.LINK("stylesheet", "text/css",
pathToRoot.resolve(stylesheet).getPath(), "Style")); pathToRoot.resolve(stylesheet).getPath(), "Style"));
} }
private void addScripts(HtmlTree tree) { private void addScripts(HtmlTree tree) {
if (addDefaultScript) { if (addDefaultScript) {
tree.addContent(HtmlTree.SCRIPT(pathToRoot.resolve(DocPaths.JAVASCRIPT).getPath())); tree.add(HtmlTree.SCRIPT(pathToRoot.resolve(DocPaths.JAVASCRIPT).getPath()));
} }
if (index) { if (index) {
if (pathToRoot != null && mainBodyScript != null) { if (pathToRoot != null && mainBodyScript != null) {
@ -335,20 +335,20 @@ public class Head {
} }
addJQueryFile(tree, DocPaths.JSZIP_MIN); addJQueryFile(tree, DocPaths.JSZIP_MIN);
addJQueryFile(tree, DocPaths.JSZIPUTILS_MIN); addJQueryFile(tree, DocPaths.JSZIPUTILS_MIN);
tree.addContent(new RawHtml("<!--[if IE]>")); tree.add(new RawHtml("<!--[if IE]>"));
addJQueryFile(tree, DocPaths.JSZIPUTILS_IE_MIN); addJQueryFile(tree, DocPaths.JSZIPUTILS_IE_MIN);
tree.addContent(new RawHtml("<![endif]-->")); tree.add(new RawHtml("<![endif]-->"));
addJQueryFile(tree, DocPaths.JQUERY_JS_3_3); addJQueryFile(tree, DocPaths.JQUERY_JS_3_3);
addJQueryFile(tree, DocPaths.JQUERY_MIGRATE); addJQueryFile(tree, DocPaths.JQUERY_MIGRATE);
addJQueryFile(tree, DocPaths.JQUERY_JS); addJQueryFile(tree, DocPaths.JQUERY_JS);
} }
for (Script script : scripts) { for (Script script : scripts) {
tree.addContent(script.asContent()); tree.add(script.asContent());
} }
} }
private void addJQueryFile(HtmlTree tree, DocPath filePath) { private void addJQueryFile(HtmlTree tree, DocPath filePath) {
DocPath jqueryFile = pathToRoot.resolve(DocPaths.JQUERY_FILES.resolve(filePath)); DocPath jqueryFile = pathToRoot.resolve(DocPaths.JQUERY_FILES.resolve(filePath));
tree.addContent(HtmlTree.SCRIPT(jqueryFile.getPath())); tree.add(HtmlTree.SCRIPT(jqueryFile.getPath()));
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -75,7 +75,7 @@ public class HtmlTree extends Content {
public HtmlTree(HtmlTag tag, Content... contents) { public HtmlTree(HtmlTag tag, Content... contents) {
this(tag); this(tag);
for (Content c: contents) for (Content c: contents)
addContent(c); add(c);
} }
/** /**
@ -87,7 +87,7 @@ public class HtmlTree extends Content {
public HtmlTree(HtmlTag tag, List<Content> contents) { public HtmlTree(HtmlTag tag, List<Content> contents) {
this(tag); this(tag);
for (Content c: contents) for (Content c: contents)
addContent(c); add(c);
} }
/** /**
@ -97,7 +97,7 @@ public class HtmlTree extends Content {
* @param attrValue value of the attribute * @param attrValue value of the attribute
* @return this object * @return this object
*/ */
public HtmlTree addAttr(HtmlAttr attrName, String attrValue) { public HtmlTree put(HtmlAttr attrName, String attrValue) {
if (attrs.isEmpty()) if (attrs.isEmpty())
attrs = new LinkedHashMap<>(3); attrs = new LinkedHashMap<>(3);
attrs.put(nullCheck(attrName), escapeHtmlChars(attrValue)); attrs.put(nullCheck(attrName), escapeHtmlChars(attrValue));
@ -112,7 +112,7 @@ public class HtmlTree extends Content {
* @return this object * @return this object
*/ */
public HtmlTree setTitle(Content body) { public HtmlTree setTitle(Content body) {
addAttr(HtmlAttr.TITLE, stripHtml(body)); put(HtmlAttr.TITLE, stripHtml(body));
return this; return this;
} }
@ -123,7 +123,7 @@ public class HtmlTree extends Content {
* @return this object * @return this object
*/ */
public HtmlTree setRole(Role role) { public HtmlTree setRole(Role role) {
addAttr(HtmlAttr.ROLE, role.toString()); put(HtmlAttr.ROLE, role.toString());
return this; return this;
} }
@ -134,7 +134,7 @@ public class HtmlTree extends Content {
* @return this object * @return this object
*/ */
public HtmlTree setStyle(HtmlStyle style) { public HtmlTree setStyle(HtmlStyle style) {
addAttr(HtmlAttr.CLASS, style.toString()); put(HtmlAttr.CLASS, style.toString());
return this; return this;
} }
@ -144,10 +144,10 @@ public class HtmlTree extends Content {
* @param tagContent tag content to be added * @param tagContent tag content to be added
*/ */
@Override @Override
public void addContent(Content tagContent) { public void add(Content tagContent) {
if (tagContent instanceof ContentBuilder) { if (tagContent instanceof ContentBuilder) {
for (Content c: ((ContentBuilder)tagContent).contents) { for (Content c: ((ContentBuilder)tagContent).contents) {
addContent(c); add(c);
} }
} }
else if (tagContent == HtmlTree.EMPTY || tagContent.isValid()) { else if (tagContent == HtmlTree.EMPTY || tagContent.isValid()) {
@ -165,16 +165,16 @@ public class HtmlTree extends Content {
* @param stringContent string content that needs to be added * @param stringContent string content that needs to be added
*/ */
@Override @Override
public void addContent(CharSequence stringContent) { public void add(CharSequence stringContent) {
if (!content.isEmpty()) { if (!content.isEmpty()) {
Content lastContent = content.get(content.size() - 1); Content lastContent = content.get(content.size() - 1);
if (lastContent instanceof StringContent) if (lastContent instanceof StringContent)
lastContent.addContent(stringContent); lastContent.add(stringContent);
else else
addContent(new StringContent(stringContent)); add(new StringContent(stringContent));
} }
else else
addContent(new StringContent(stringContent)); add(new StringContent(stringContent));
} }
/** /**
@ -294,7 +294,7 @@ public class HtmlTree extends Content {
*/ */
public static HtmlTree A(String ref, Content body) { public static HtmlTree A(String ref, Content body) {
HtmlTree htmltree = new HtmlTree(HtmlTag.A, nullCheck(body)); HtmlTree htmltree = new HtmlTree(HtmlTag.A, nullCheck(body));
htmltree.addAttr(HtmlAttr.HREF, encodeURL(ref)); htmltree.put(HtmlAttr.HREF, encodeURL(ref));
return htmltree; return htmltree;
} }
@ -307,8 +307,8 @@ public class HtmlTree extends Content {
*/ */
public static HtmlTree A_ID(String id, Content body) { public static HtmlTree A_ID(String id, Content body) {
HtmlTree htmltree = new HtmlTree(HtmlTag.A); HtmlTree htmltree = new HtmlTree(HtmlTag.A);
htmltree.addAttr(HtmlAttr.ID, nullCheck(id)); htmltree.put(HtmlAttr.ID, nullCheck(id));
htmltree.addContent(nullCheck(body)); htmltree.add(nullCheck(body));
return htmltree; return htmltree;
} }
@ -497,7 +497,7 @@ public class HtmlTree extends Content {
*/ */
public static HtmlTree HTML(String lang, Content head, Content body) { public static HtmlTree HTML(String lang, Content head, Content body) {
HtmlTree htmltree = new HtmlTree(HtmlTag.HTML, nullCheck(head), nullCheck(body)); HtmlTree htmltree = new HtmlTree(HtmlTag.HTML, nullCheck(head), nullCheck(body));
htmltree.addAttr(HtmlAttr.LANG, nullCheck(lang)); htmltree.put(HtmlAttr.LANG, nullCheck(lang));
return htmltree; return htmltree;
} }
@ -511,9 +511,9 @@ public class HtmlTree extends Content {
*/ */
public static HtmlTree IFRAME(String src, String name, String title) { public static HtmlTree IFRAME(String src, String name, String title) {
HtmlTree htmltree = new HtmlTree(HtmlTag.IFRAME); HtmlTree htmltree = new HtmlTree(HtmlTag.IFRAME);
htmltree.addAttr(HtmlAttr.SRC, nullCheck(src)); htmltree.put(HtmlAttr.SRC, nullCheck(src));
htmltree.addAttr(HtmlAttr.NAME, nullCheck(name)); htmltree.put(HtmlAttr.NAME, nullCheck(name));
htmltree.addAttr(HtmlAttr.TITLE, nullCheck(title)); htmltree.put(HtmlAttr.TITLE, nullCheck(title));
return htmltree; return htmltree;
} }
@ -527,10 +527,10 @@ public class HtmlTree extends Content {
*/ */
public static HtmlTree INPUT(String type, String id, String value) { public static HtmlTree INPUT(String type, String id, String value) {
HtmlTree htmltree = new HtmlTree(HtmlTag.INPUT); HtmlTree htmltree = new HtmlTree(HtmlTag.INPUT);
htmltree.addAttr(HtmlAttr.TYPE, nullCheck(type)); htmltree.put(HtmlAttr.TYPE, nullCheck(type));
htmltree.addAttr(HtmlAttr.ID, nullCheck(id)); htmltree.put(HtmlAttr.ID, nullCheck(id));
htmltree.addAttr(HtmlAttr.VALUE, nullCheck(value)); htmltree.put(HtmlAttr.VALUE, nullCheck(value));
htmltree.addAttr(HtmlAttr.DISABLED, "disabled"); htmltree.put(HtmlAttr.DISABLED, "disabled");
return htmltree; return htmltree;
} }
@ -543,7 +543,7 @@ public class HtmlTree extends Content {
*/ */
public static HtmlTree LABEL(String forLabel, Content body) { public static HtmlTree LABEL(String forLabel, Content body) {
HtmlTree htmltree = new HtmlTree(HtmlTag.LABEL, nullCheck(body)); HtmlTree htmltree = new HtmlTree(HtmlTag.LABEL, nullCheck(body));
htmltree.addAttr(HtmlAttr.FOR, nullCheck(forLabel)); htmltree.put(HtmlAttr.FOR, nullCheck(forLabel));
return htmltree; return htmltree;
} }
@ -582,10 +582,10 @@ public class HtmlTree extends Content {
*/ */
public static HtmlTree LINK(String rel, String type, String href, String title) { public static HtmlTree LINK(String rel, String type, String href, String title) {
HtmlTree htmltree = new HtmlTree(HtmlTag.LINK); HtmlTree htmltree = new HtmlTree(HtmlTag.LINK);
htmltree.addAttr(HtmlAttr.REL, nullCheck(rel)); htmltree.put(HtmlAttr.REL, nullCheck(rel));
htmltree.addAttr(HtmlAttr.TYPE, nullCheck(type)); htmltree.put(HtmlAttr.TYPE, nullCheck(type));
htmltree.addAttr(HtmlAttr.HREF, nullCheck(href)); htmltree.put(HtmlAttr.HREF, nullCheck(href));
htmltree.addAttr(HtmlAttr.TITLE, nullCheck(title)); htmltree.put(HtmlAttr.TITLE, nullCheck(title));
return htmltree; return htmltree;
} }
@ -638,8 +638,8 @@ public class HtmlTree extends Content {
public static HtmlTree META(String httpEquiv, String content, String charSet) { public static HtmlTree META(String httpEquiv, String content, String charSet) {
HtmlTree htmltree = new HtmlTree(HtmlTag.META); HtmlTree htmltree = new HtmlTree(HtmlTag.META);
String contentCharset = content + "; charset=" + charSet; String contentCharset = content + "; charset=" + charSet;
htmltree.addAttr(HtmlAttr.HTTP_EQUIV, nullCheck(httpEquiv)); htmltree.put(HtmlAttr.HTTP_EQUIV, nullCheck(httpEquiv));
htmltree.addAttr(HtmlAttr.CONTENT, contentCharset); htmltree.put(HtmlAttr.CONTENT, contentCharset);
return htmltree; return htmltree;
} }
@ -652,8 +652,8 @@ public class HtmlTree extends Content {
*/ */
public static HtmlTree META(String name, String content) { public static HtmlTree META(String name, String content) {
HtmlTree htmltree = new HtmlTree(HtmlTag.META); HtmlTree htmltree = new HtmlTree(HtmlTag.META);
htmltree.addAttr(HtmlAttr.NAME, nullCheck(name)); htmltree.put(HtmlAttr.NAME, nullCheck(name));
htmltree.addAttr(HtmlAttr.CONTENT, nullCheck(content)); htmltree.put(HtmlAttr.CONTENT, nullCheck(content));
return htmltree; return htmltree;
} }
@ -711,8 +711,8 @@ public class HtmlTree extends Content {
*/ */
public static HtmlTree SCRIPT(String src) { public static HtmlTree SCRIPT(String src) {
HtmlTree htmltree = new HtmlTree(HtmlTag.SCRIPT); HtmlTree htmltree = new HtmlTree(HtmlTag.SCRIPT);
htmltree.addAttr(HtmlAttr.TYPE, "text/javascript"); htmltree.put(HtmlAttr.TYPE, "text/javascript");
htmltree.addAttr(HtmlAttr.SRC, nullCheck(src)); htmltree.put(HtmlAttr.SRC, nullCheck(src));
return htmltree; return htmltree;
} }
@ -785,7 +785,7 @@ public class HtmlTree extends Content {
*/ */
public static HtmlTree SPAN(String id, HtmlStyle styleClass, Content body) { public static HtmlTree SPAN(String id, HtmlStyle styleClass, Content body) {
HtmlTree htmltree = new HtmlTree(HtmlTag.SPAN, nullCheck(body)); HtmlTree htmltree = new HtmlTree(HtmlTag.SPAN, nullCheck(body));
htmltree.addAttr(HtmlAttr.ID, nullCheck(id)); htmltree.put(HtmlAttr.ID, nullCheck(id));
if (styleClass != null) if (styleClass != null)
htmltree.setStyle(styleClass); htmltree.setStyle(styleClass);
return htmltree; return htmltree;
@ -803,7 +803,7 @@ public class HtmlTree extends Content {
HtmlTree htmltree = new HtmlTree(HtmlTag.TABLE, nullCheck(body)); HtmlTree htmltree = new HtmlTree(HtmlTag.TABLE, nullCheck(body));
if (styleClass != null) if (styleClass != null)
htmltree.setStyle(styleClass); htmltree.setStyle(styleClass);
htmltree.addAttr(HtmlAttr.SUMMARY, nullCheck(summary)); htmltree.put(HtmlAttr.SUMMARY, nullCheck(summary));
return htmltree; return htmltree;
} }
@ -858,7 +858,7 @@ public class HtmlTree extends Content {
HtmlTree htmltree = new HtmlTree(HtmlTag.TH, nullCheck(body)); HtmlTree htmltree = new HtmlTree(HtmlTag.TH, nullCheck(body));
if (styleClass != null) if (styleClass != null)
htmltree.setStyle(styleClass); htmltree.setStyle(styleClass);
htmltree.addAttr(HtmlAttr.SCOPE, nullCheck(scope)); htmltree.put(HtmlAttr.SCOPE, nullCheck(scope));
return htmltree; return htmltree;
} }
@ -916,9 +916,9 @@ public class HtmlTree extends Content {
*/ */
public static HtmlTree UL(HtmlStyle styleClass, Content first, Content... more) { public static HtmlTree UL(HtmlStyle styleClass, Content first, Content... more) {
HtmlTree htmlTree = new HtmlTree(HtmlTag.UL); HtmlTree htmlTree = new HtmlTree(HtmlTag.UL);
htmlTree.addContent(nullCheck(first)); htmlTree.add(nullCheck(first));
for (Content c : more) { for (Content c : more) {
htmlTree.addContent(nullCheck(c)); htmlTree.add(nullCheck(c));
} }
htmlTree.setStyle(nullCheck(styleClass)); htmlTree.setStyle(nullCheck(styleClass));
return htmlTree; return htmlTree;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -233,10 +233,10 @@ public class Links {
public Content createLink(DocLink link, Content label, String title, String target) { public Content createLink(DocLink link, Content label, String title, String target) {
HtmlTree anchor = HtmlTree.A(link.relativizeAgainst(file).toString(), label); HtmlTree anchor = HtmlTree.A(link.relativizeAgainst(file).toString(), label);
if (title != null && title.length() != 0) { if (title != null && title.length() != 0) {
anchor.addAttr(HtmlAttr.TITLE, title); anchor.put(HtmlAttr.TITLE, title);
} }
if (target != null && target.length() != 0) { if (target != null && target.length() != 0) {
anchor.addAttr(HtmlAttr.TARGET, target); anchor.put(HtmlAttr.TARGET, target);
} }
return anchor; return anchor;
} }
@ -279,10 +279,10 @@ public class Links {
} }
HtmlTree l = HtmlTree.A(link.relativizeAgainst(file).toString(), body); HtmlTree l = HtmlTree.A(link.relativizeAgainst(file).toString(), body);
if (title != null && title.length() != 0) { if (title != null && title.length() != 0) {
l.addAttr(HtmlAttr.TITLE, title); l.put(HtmlAttr.TITLE, title);
} }
if (target != null && target.length() != 0) { if (target != null && target.length() != 0) {
l.addAttr(HtmlAttr.TARGET, target); l.put(HtmlAttr.TARGET, target);
} }
if (isExternal) { if (isExternal) {
l.setStyle(HtmlStyle.externalLink); l.setStyle(HtmlStyle.externalLink);

View File

@ -429,8 +429,8 @@ public class Navigation {
} }
if (!listContents.isEmpty()) { if (!listContents.isEmpty()) {
Content li = HtmlTree.LI(contents.summaryLabel); Content li = HtmlTree.LI(contents.summaryLabel);
li.addContent(Contents.SPACE); li.add(Contents.SPACE);
tree.addContent(li); tree.add(li);
addListToNav(listContents, tree); addListToNav(listContents, tree);
} }
break; break;
@ -461,8 +461,8 @@ public class Navigation {
} }
if (!listContents.isEmpty()) { if (!listContents.isEmpty()) {
Content li = HtmlTree.LI(contents.moduleSubNavLabel); Content li = HtmlTree.LI(contents.moduleSubNavLabel);
li.addContent(Contents.SPACE); li.add(Contents.SPACE);
tree.addContent(li); tree.add(li);
addListToNav(listContents, tree); addListToNav(listContents, tree);
} }
break; break;
@ -665,8 +665,8 @@ public class Navigation {
} }
if (!listContents.isEmpty()) { if (!listContents.isEmpty()) {
Content li = HtmlTree.LI(contents.detailLabel); Content li = HtmlTree.LI(contents.detailLabel);
li.addContent(Contents.SPACE); li.add(Contents.SPACE);
tree.addContent(li); tree.add(li);
addListToNav(listContents, tree); addListToNav(listContents, tree);
} }
break; break;
@ -794,37 +794,37 @@ public class Navigation {
} }
private void addContentToTree(Content tree, Content content) { private void addContentToTree(Content tree, Content content) {
tree.addContent(HtmlTree.LI(content)); tree.add(HtmlTree.LI(content));
} }
private void addListToNav(List<Content> listContents, Content tree) { private void addListToNav(List<Content> listContents, Content tree) {
int count = 0; int count = 0;
for (Content liContent : listContents) { for (Content liContent : listContents) {
if (count < listContents.size() - 1) { if (count < listContents.size() - 1) {
liContent.addContent(Contents.SPACE); liContent.add(Contents.SPACE);
liContent.addContent("|"); liContent.add("|");
liContent.addContent(Contents.SPACE); liContent.add(Contents.SPACE);
} }
tree.addContent(liContent); tree.add(liContent);
count++; count++;
} }
} }
private void addActivePageLink(Content tree, Content label, boolean display) { private void addActivePageLink(Content tree, Content label, boolean display) {
if (display) { if (display) {
tree.addContent(HtmlTree.LI(HtmlStyle.navBarCell1Rev, label)); tree.add(HtmlTree.LI(HtmlStyle.navBarCell1Rev, label));
} }
} }
private void addPageLabel(Content tree, Content label, boolean display) { private void addPageLabel(Content tree, Content label, boolean display) {
if (display) { if (display) {
tree.addContent(HtmlTree.LI(label)); tree.add(HtmlTree.LI(label));
} }
} }
private void addOverviewLink(Content tree) { private void addOverviewLink(Content tree) {
if (configuration.createoverview) { if (configuration.createoverview) {
tree.addContent(HtmlTree.LI(links.createLink(pathToRoot.resolve(DocPaths.overviewSummary(configuration.frames)), tree.add(HtmlTree.LI(links.createLink(pathToRoot.resolve(DocPaths.overviewSummary(configuration.frames)),
contents.overviewLabel, "", ""))); contents.overviewLabel, "", "")));
} }
} }
@ -834,7 +834,7 @@ public class Navigation {
if (configuration.modules.size() == 1) { if (configuration.modules.size() == 1) {
ModuleElement mdle = configuration.modules.first(); ModuleElement mdle = configuration.modules.first();
boolean included = configuration.utils.isIncluded(mdle); boolean included = configuration.utils.isIncluded(mdle);
tree.addContent(HtmlTree.LI((included) tree.add(HtmlTree.LI((included)
? links.createLink(pathToRoot.resolve(configuration.docPaths.moduleSummary(mdle)), contents.moduleLabel, "", "") ? links.createLink(pathToRoot.resolve(configuration.docPaths.moduleSummary(mdle)), contents.moduleLabel, "", "")
: contents.moduleLabel)); : contents.moduleLabel));
} else if (!configuration.modules.isEmpty()) { } else if (!configuration.modules.isEmpty()) {
@ -845,7 +845,7 @@ public class Navigation {
private void addModuleOfElementLink(Content tree) { private void addModuleOfElementLink(Content tree) {
if (configuration.showModules) { if (configuration.showModules) {
tree.addContent(HtmlTree.LI(navLinkModule)); tree.add(HtmlTree.LI(navLinkModule));
} }
} }
@ -862,16 +862,16 @@ public class Navigation {
} }
} }
if (included || packageElement == null) { if (included || packageElement == null) {
tree.addContent(HtmlTree.LI(links.createLink( tree.add(HtmlTree.LI(links.createLink(
pathToRoot.resolve(configuration.docPaths.forPackage(packageElement).resolve(DocPaths.PACKAGE_SUMMARY)), pathToRoot.resolve(configuration.docPaths.forPackage(packageElement).resolve(DocPaths.PACKAGE_SUMMARY)),
contents.packageLabel))); contents.packageLabel)));
} else { } else {
DocLink crossPkgLink = configuration.extern.getExternalLink( DocLink crossPkgLink = configuration.extern.getExternalLink(
packageElement, pathToRoot, DocPaths.PACKAGE_SUMMARY.getPath()); packageElement, pathToRoot, DocPaths.PACKAGE_SUMMARY.getPath());
if (crossPkgLink != null) { if (crossPkgLink != null) {
tree.addContent(HtmlTree.LI(links.createLink(crossPkgLink, contents.packageLabel))); tree.add(HtmlTree.LI(links.createLink(crossPkgLink, contents.packageLabel)));
} else { } else {
tree.addContent(HtmlTree.LI(contents.packageLabel)); tree.add(HtmlTree.LI(contents.packageLabel));
} }
} }
} else if (!configuration.packages.isEmpty()) { } else if (!configuration.packages.isEmpty()) {
@ -880,12 +880,12 @@ public class Navigation {
} }
private void addPackageOfElementLink(Content tree) { private void addPackageOfElementLink(Content tree) {
tree.addContent(HtmlTree.LI(links.createLink(DocPath.parent.resolve(DocPaths.PACKAGE_SUMMARY), tree.add(HtmlTree.LI(links.createLink(DocPath.parent.resolve(DocPaths.PACKAGE_SUMMARY),
contents.packageLabel))); contents.packageLabel)));
} }
private void addPackageSummaryLink(Content tree) { private void addPackageSummaryLink(Content tree) {
tree.addContent(HtmlTree.LI(links.createLink(DocPaths.PACKAGE_SUMMARY, contents.packageLabel))); tree.add(HtmlTree.LI(links.createLink(DocPaths.PACKAGE_SUMMARY, contents.packageLabel)));
} }
private void addTreeLink(Content tree) { private void addTreeLink(Content tree) {
@ -894,20 +894,20 @@ public class Navigation {
DocPath docPath = packages.size() == 1 && configuration.getSpecifiedTypeElements().isEmpty() DocPath docPath = packages.size() == 1 && configuration.getSpecifiedTypeElements().isEmpty()
? pathToRoot.resolve(configuration.docPaths.forPackage(packages.get(0)).resolve(DocPaths.PACKAGE_TREE)) ? pathToRoot.resolve(configuration.docPaths.forPackage(packages.get(0)).resolve(DocPaths.PACKAGE_TREE))
: pathToRoot.resolve(DocPaths.OVERVIEW_TREE); : pathToRoot.resolve(DocPaths.OVERVIEW_TREE);
tree.addContent(HtmlTree.LI(links.createLink(docPath, contents.treeLabel, "", ""))); tree.add(HtmlTree.LI(links.createLink(docPath, contents.treeLabel, "", "")));
} }
} }
private void addDeprecatedLink(Content tree) { private void addDeprecatedLink(Content tree) {
if (!(configuration.nodeprecated || configuration.nodeprecatedlist)) { if (!(configuration.nodeprecated || configuration.nodeprecatedlist)) {
tree.addContent(HtmlTree.LI(links.createLink(pathToRoot.resolve(DocPaths.DEPRECATED_LIST), tree.add(HtmlTree.LI(links.createLink(pathToRoot.resolve(DocPaths.DEPRECATED_LIST),
contents.deprecatedLabel, "", ""))); contents.deprecatedLabel, "", "")));
} }
} }
private void addIndexLink(Content tree) { private void addIndexLink(Content tree) {
if (configuration.createindex) { if (configuration.createindex) {
tree.addContent(HtmlTree.LI(links.createLink(pathToRoot.resolve( tree.add(HtmlTree.LI(links.createLink(pathToRoot.resolve(
(configuration.splitindex (configuration.splitindex
? DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1)) ? DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1))
: DocPaths.INDEX_ALL)), : DocPaths.INDEX_ALL)),
@ -925,7 +925,7 @@ public class Navigation {
DocFile file = DocFile.createFileForInput(configuration, helpfile); DocFile file = DocFile.createFileForInput(configuration, helpfile);
helpfilenm = DocPath.create(file.getName()); helpfilenm = DocPath.create(file.getName());
} }
tree.addContent(HtmlTree.LI(links.createLink(pathToRoot.resolve(helpfilenm), tree.add(HtmlTree.LI(links.createLink(pathToRoot.resolve(helpfilenm),
contents.helpLabel, "", ""))); contents.helpLabel, "", "")));
} }
} }
@ -938,7 +938,7 @@ public class Navigation {
private void addNavShowLists(Content tree) { private void addNavShowLists(Content tree) {
DocLink dl = new DocLink(pathToRoot.resolve(DocPaths.INDEX), path.getPath(), null); DocLink dl = new DocLink(pathToRoot.resolve(DocPaths.INDEX), path.getPath(), null);
Content framesContent = links.createLink(dl, contents.framesLabel, "", "_top"); Content framesContent = links.createLink(dl, contents.framesLabel, "", "_top");
tree.addContent(HtmlTree.LI(framesContent)); tree.add(HtmlTree.LI(framesContent));
} }
/** /**
@ -948,7 +948,7 @@ public class Navigation {
*/ */
private void addNavHideLists(Content tree) { private void addNavHideLists(Content tree) {
Content noFramesContent = links.createLink(path.basename(), contents.noFramesLabel, "", "_top"); Content noFramesContent = links.createLink(path.basename(), contents.noFramesLabel, "", "_top");
tree.addContent(HtmlTree.LI(noFramesContent)); tree.add(HtmlTree.LI(noFramesContent));
} }
private void addSearch(Content tree) { private void addSearch(Content tree) {
@ -957,14 +957,14 @@ public class Navigation {
HtmlTree inputText = HtmlTree.INPUT("text", searchValueId, searchValueId); HtmlTree inputText = HtmlTree.INPUT("text", searchValueId, searchValueId);
HtmlTree inputReset = HtmlTree.INPUT(reset, reset, reset); HtmlTree inputReset = HtmlTree.INPUT(reset, reset, reset);
HtmlTree liInput = HtmlTree.LI(HtmlTree.LABEL(searchValueId, searchLabel)); HtmlTree liInput = HtmlTree.LI(HtmlTree.LABEL(searchValueId, searchLabel));
liInput.addContent(inputText); liInput.add(inputText);
liInput.addContent(inputReset); liInput.add(inputReset);
HtmlTree ulSearch = HtmlTree.UL(HtmlStyle.navListSearch, liInput); HtmlTree ulSearch = HtmlTree.UL(HtmlStyle.navListSearch, liInput);
tree.addContent(ulSearch); tree.add(ulSearch);
} }
private void addFixedNavScript(Content tree) { private void addFixedNavScript(Content tree) {
tree.addContent(FIXED_NAV_SCRIPT.asContent()); tree.add(FIXED_NAV_SCRIPT.asContent());
} }
/** /**
@ -981,29 +981,29 @@ public class Navigation {
HtmlTree navDiv = new HtmlTree(HtmlTag.DIV); HtmlTree navDiv = new HtmlTree(HtmlTag.DIV);
if (top) { if (top) {
queue = topBottomNavContents.get(Position.TOP); queue = topBottomNavContents.get(Position.TOP);
fixedNavDiv.addContent(Position.TOP.startOfNav()); fixedNavDiv.add(Position.TOP.startOfNav());
navDiv.setStyle(HtmlStyle.topNav); navDiv.setStyle(HtmlStyle.topNav);
} else { } else {
queue = topBottomNavContents.get(Position.BOTTOM); queue = topBottomNavContents.get(Position.BOTTOM);
tree.addContent(Position.BOTTOM.startOfNav()); tree.add(Position.BOTTOM.startOfNav());
navDiv.setStyle(HtmlStyle.bottomNav); navDiv.setStyle(HtmlStyle.bottomNav);
} }
navDiv.addContent(queue.poll()); navDiv.add(queue.poll());
HtmlTree skipLinkDiv = HtmlTree.DIV(HtmlStyle.skipNav, queue.poll()); HtmlTree skipLinkDiv = HtmlTree.DIV(HtmlStyle.skipNav, queue.poll());
navDiv.addContent(skipLinkDiv); navDiv.add(skipLinkDiv);
navDiv.addContent(queue.poll()); navDiv.add(queue.poll());
HtmlTree navList = new HtmlTree(HtmlTag.UL); HtmlTree navList = new HtmlTree(HtmlTag.UL);
navList.setStyle(HtmlStyle.navList); navList.setStyle(HtmlStyle.navList);
navList.addAttr(HtmlAttr.TITLE, rowListTitle); navList.put(HtmlAttr.TITLE, rowListTitle);
fixedNavDiv.setStyle(HtmlStyle.fixedNav); fixedNavDiv.setStyle(HtmlStyle.fixedNav);
addMainNavLinks(navList); addMainNavLinks(navList);
navDiv.addContent(navList); navDiv.add(navList);
Content aboutDiv = HtmlTree.DIV(HtmlStyle.aboutLanguage, top ? userHeader : userFooter); Content aboutDiv = HtmlTree.DIV(HtmlStyle.aboutLanguage, top ? userHeader : userFooter);
navDiv.addContent(aboutDiv); navDiv.add(aboutDiv);
if (top) { if (top) {
fixedNavDiv.addContent(navDiv); fixedNavDiv.add(navDiv);
} else { } else {
tree.addContent(navDiv); tree.add(navDiv);
} }
HtmlTree subDiv = new HtmlTree(HtmlTag.DIV); HtmlTree subDiv = new HtmlTree(HtmlTag.DIV);
subDiv.setStyle(HtmlStyle.subNav); subDiv.setStyle(HtmlStyle.subNav);
@ -1012,12 +1012,12 @@ public class Navigation {
HtmlTree ulNavSummary = new HtmlTree(HtmlTag.UL); HtmlTree ulNavSummary = new HtmlTree(HtmlTag.UL);
ulNavSummary.setStyle(HtmlStyle.subNavList); ulNavSummary.setStyle(HtmlStyle.subNavList);
addSummaryLinks(ulNavSummary); addSummaryLinks(ulNavSummary);
div.addContent(ulNavSummary); div.add(ulNavSummary);
// Add the detail links if present. // Add the detail links if present.
HtmlTree ulNavDetail = new HtmlTree(HtmlTag.UL); HtmlTree ulNavDetail = new HtmlTree(HtmlTag.UL);
ulNavDetail.setStyle(HtmlStyle.subNavList); ulNavDetail.setStyle(HtmlStyle.subNavList);
addDetailLinks(ulNavDetail); addDetailLinks(ulNavDetail);
div.addContent(ulNavDetail); div.add(ulNavDetail);
HtmlTree ulFrames = new HtmlTree(HtmlTag.UL); HtmlTree ulFrames = new HtmlTree(HtmlTag.UL);
ulFrames.setStyle(HtmlStyle.navList); ulFrames.setStyle(HtmlStyle.navList);
if (!configuration.nonavbar) { if (!configuration.nonavbar) {
@ -1026,23 +1026,23 @@ public class Navigation {
addNavHideLists(ulFrames); addNavHideLists(ulFrames);
} }
} }
div.addContent(ulFrames); div.add(ulFrames);
subDiv.addContent(div); subDiv.add(div);
if (top && configuration.createindex) { if (top && configuration.createindex) {
addSearch(subDiv); addSearch(subDiv);
} }
if (top) { if (top) {
fixedNavDiv.addContent(subDiv); fixedNavDiv.add(subDiv);
fixedNavDiv.addContent(queue.poll()); fixedNavDiv.add(queue.poll());
fixedNavDiv.addContent(Position.TOP.endOfNav()); fixedNavDiv.add(Position.TOP.endOfNav());
tree.addContent(fixedNavDiv); tree.add(fixedNavDiv);
HtmlTree paddingDiv = HtmlTree.DIV(HtmlStyle.navPadding, Contents.SPACE); HtmlTree paddingDiv = HtmlTree.DIV(HtmlStyle.navPadding, Contents.SPACE);
tree.addContent(paddingDiv); tree.add(paddingDiv);
addFixedNavScript(tree); addFixedNavScript(tree);
} else { } else {
tree.addContent(subDiv); tree.add(subDiv);
tree.addContent(queue.poll()); tree.add(queue.poll());
tree.addContent(Position.BOTTOM.endOfNav()); tree.add(Position.BOTTOM.endOfNav());
} }
return tree; return tree;
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -64,7 +64,7 @@ public class RawHtml extends Content {
* @param content content that needs to be added * @param content content that needs to be added
* @throws UnsupportedOperationException always * @throws UnsupportedOperationException always
*/ */
public void addContent(Content content) { public void add(Content content) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@ -75,7 +75,7 @@ public class RawHtml extends Content {
* @throws UnsupportedOperationException always * @throws UnsupportedOperationException always
*/ */
@Override @Override
public void addContent(CharSequence stringContent) { public void add(CharSequence stringContent) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -108,19 +108,19 @@ public class Script {
ScriptContent scriptContent = new ScriptContent(sb); ScriptContent scriptContent = new ScriptContent(sb);
HtmlTree tree = new HtmlTree(HtmlTag.SCRIPT) { HtmlTree tree = new HtmlTree(HtmlTag.SCRIPT) {
@Override @Override
public void addContent(CharSequence s) { public void add(CharSequence s) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@Override @Override
public void addContent(Content c) { public void add(Content c) {
if (c != scriptContent) { if (c != scriptContent) {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
super.addContent(scriptContent); super.add(scriptContent);
} }
}; };
tree.addAttr(HtmlAttr.TYPE, "text/javascript"); tree.put(HtmlAttr.TYPE, "text/javascript");
tree.addContent(scriptContent); tree.add(scriptContent);
return tree; return tree;
} }
@ -200,12 +200,12 @@ public class Script {
} }
@Override @Override
public void addContent(Content content) { public void add(Content content) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@Override @Override
public void addContent(CharSequence code) { public void add(CharSequence code) {
sb.append(code); sb.append(code);
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -69,7 +69,7 @@ public class StringContent extends Content {
* @throws UnsupportedOperationException always * @throws UnsupportedOperationException always
*/ */
@Override @Override
public void addContent(Content content) { public void add(Content content) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@ -80,7 +80,7 @@ public class StringContent extends Content {
* @param strContent string content to be added * @param strContent string content to be added
*/ */
@Override @Override
public void addContent(CharSequence strContent) { public void add(CharSequence strContent) {
appendChars(strContent); appendChars(strContent);
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -40,7 +40,6 @@ import javax.lang.model.element.Element;
import jdk.javadoc.internal.doclets.formats.html.Contents; import jdk.javadoc.internal.doclets.formats.html.Contents;
import jdk.javadoc.internal.doclets.toolkit.Content; import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants;
/** /**
* A builder for HTML tables, such as the summary tables for various * A builder for HTML tables, such as the summary tables for various
@ -347,7 +346,7 @@ public class Table {
if (stripedStyles != null) { if (stripedStyles != null) {
int rowIndex = bodyRows.size(); int rowIndex = bodyRows.size();
row.addAttr(HtmlAttr.CLASS, stripedStyles.get(rowIndex % 2).name()); row.put(HtmlAttr.CLASS, stripedStyles.get(rowIndex % 2).name());
} }
int colIndex = 0; int colIndex = 0;
for (Content c : contents) { for (Content c : contents) {
@ -357,14 +356,14 @@ public class Table {
HtmlTree cell = (colIndex == rowScopeColumnIndex) HtmlTree cell = (colIndex == rowScopeColumnIndex)
? HtmlTree.TH(cellStyle, "row", c) ? HtmlTree.TH(cellStyle, "row", c)
: HtmlTree.TD(cellStyle, c); : HtmlTree.TD(cellStyle, c);
row.addContent(cell); row.add(cell);
colIndex++; colIndex++;
} }
bodyRows.add(row); bodyRows.add(row);
if (tabMap != null) { if (tabMap != null) {
int index = bodyRows.size() - 1; int index = bodyRows.size() - 1;
row.addAttr(HtmlAttr.ID, (rowIdPrefix + index)); row.put(HtmlAttr.ID, (rowIdPrefix + index));
int mask = 0; int mask = 0;
int maskBit = 1; int maskBit = 1;
for (Map.Entry<String, Predicate<Element>> e : tabMap.entrySet()) { for (Map.Entry<String, Predicate<Element>> e : tabMap.entrySet()) {
@ -401,60 +400,60 @@ public class Table {
HtmlTree table = new HtmlTree(HtmlTag.TABLE); HtmlTree table = new HtmlTree(HtmlTag.TABLE);
if (tabMap == null || tabs.size() == 1) { if (tabMap == null || tabs.size() == 1) {
if (tabMap == null) { if (tabMap == null) {
table.addContent(caption); table.add(caption);
} else if (tabs.size() == 1) { } else if (tabs.size() == 1) {
String tabName = tabs.iterator().next(); String tabName = tabs.iterator().next();
table.addContent(getCaption(new StringContent(tabName))); table.add(getCaption(new StringContent(tabName)));
} }
table.addContent(getTableBody()); table.add(getTableBody());
mainDiv.addContent(table); mainDiv.add(table);
} else { } else {
HtmlTree tablist = new HtmlTree(HtmlTag.DIV) HtmlTree tablist = new HtmlTree(HtmlTag.DIV)
.addAttr(HtmlAttr.ROLE, "tablist") .put(HtmlAttr.ROLE, "tablist")
.addAttr(HtmlAttr.ARIA_ORIENTATION, "horizontal"); .put(HtmlAttr.ARIA_ORIENTATION, "horizontal");
int tabIndex = 0; int tabIndex = 0;
tablist.addContent(createTab(tabId.apply(tabIndex), activeTabStyle, true, defaultTab)); tablist.add(createTab(tabId.apply(tabIndex), activeTabStyle, true, defaultTab));
table.addAttr(HtmlAttr.ARIA_LABELLEDBY, tabId.apply(tabIndex)); table.put(HtmlAttr.ARIA_LABELLEDBY, tabId.apply(tabIndex));
for (String tabName : tabMap.keySet()) { for (String tabName : tabMap.keySet()) {
tabIndex++; tabIndex++;
if (tabs.contains(tabName)) { if (tabs.contains(tabName)) {
String script = tabScript.apply(1 << (tabIndex - 1)); String script = tabScript.apply(1 << (tabIndex - 1));
HtmlTree tab = createTab(tabId.apply(tabIndex), tabStyle, false, tabName); HtmlTree tab = createTab(tabId.apply(tabIndex), tabStyle, false, tabName);
tab.addAttr(HtmlAttr.ONCLICK, script); tab.put(HtmlAttr.ONCLICK, script);
tablist.addContent(tab); tablist.add(tab);
} }
} }
HtmlTree tabpanel = new HtmlTree(HtmlTag.DIV) HtmlTree tabpanel = new HtmlTree(HtmlTag.DIV)
.addAttr(HtmlAttr.ID, tableStyle + "_tabpanel") .put(HtmlAttr.ID, tableStyle + "_tabpanel")
.addAttr(HtmlAttr.ROLE, "tabpanel"); .put(HtmlAttr.ROLE, "tabpanel");
table.addContent(getTableBody()); table.add(getTableBody());
tabpanel.addContent(table); tabpanel.add(table);
mainDiv.addContent(tablist); mainDiv.add(tablist);
mainDiv.addContent(tabpanel); mainDiv.add(tabpanel);
} }
return mainDiv; return mainDiv;
} }
private HtmlTree createTab(String tabId, HtmlStyle style, boolean defaultTab, String tabName) { private HtmlTree createTab(String tabId, HtmlStyle style, boolean defaultTab, String tabName) {
HtmlTree tab = new HtmlTree(HtmlTag.BUTTON) HtmlTree tab = new HtmlTree(HtmlTag.BUTTON)
.addAttr(HtmlAttr.ROLE, "tab") .put(HtmlAttr.ROLE, "tab")
.addAttr(HtmlAttr.ARIA_SELECTED, defaultTab ? "true" : "false") .put(HtmlAttr.ARIA_SELECTED, defaultTab ? "true" : "false")
.addAttr(HtmlAttr.ARIA_CONTROLS, tableStyle + "_tabpanel") .put(HtmlAttr.ARIA_CONTROLS, tableStyle + "_tabpanel")
.addAttr(HtmlAttr.TABINDEX, defaultTab ? "0" : "-1") .put(HtmlAttr.TABINDEX, defaultTab ? "0" : "-1")
.addAttr(HtmlAttr.ONKEYDOWN, "switchTab(event)") .put(HtmlAttr.ONKEYDOWN, "switchTab(event)")
.addAttr(HtmlAttr.ID, tabId) .put(HtmlAttr.ID, tabId)
.setStyle(style); .setStyle(style);
tab.addContent(tabName); tab.add(tabName);
return tab; return tab;
} }
private Content getTableBody() { private Content getTableBody() {
ContentBuilder tableContent = new ContentBuilder(); ContentBuilder tableContent = new ContentBuilder();
tableContent.addContent(header.toContent()); tableContent.add(header.toContent());
Content tbody = new HtmlTree(HtmlTag.TBODY); Content tbody = new HtmlTree(HtmlTag.TBODY);
bodyRows.forEach(row -> tbody.addContent(row)); bodyRows.forEach(row -> tbody.add(row));
tableContent.addContent(tbody); tableContent.add(tbody);
return tableContent; return tableContent;
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -127,7 +127,7 @@ public class TableHeader {
: (i == 1) ? HtmlStyle.colSecond : null; : (i == 1) ? HtmlStyle.colSecond : null;
Content cell = (style == null) ? HtmlTree.TH(scope, cellContent) Content cell = (style == null) ? HtmlTree.TH(scope, cellContent)
: HtmlTree.TH(style, scope, cellContent); : HtmlTree.TH(style, scope, cellContent);
tr.addContent(cell); tr.add(cell);
i++; i++;
} }
return tr; return tr;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -64,14 +64,14 @@ public abstract class Content {
* *
* @param content content that needs to be added * @param content content that needs to be added
*/ */
public abstract void addContent(Content content); public abstract void add(Content content);
/** /**
* Adds a string content to the existing content. * Adds a string content to the existing content.
* *
* @param stringContent the string content to be added * @param stringContent the string content to be added
*/ */
public abstract void addContent(CharSequence stringContent); public abstract void add(CharSequence stringContent);
/** /**
* Writes content to a writer. * Writes content to a writer.

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -156,7 +156,7 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
buildAnnotationTypeDescription(annotationInfoTree); buildAnnotationTypeDescription(annotationInfoTree);
buildAnnotationTypeTagInfo(annotationInfoTree); buildAnnotationTypeTagInfo(annotationInfoTree);
annotationContentTree.addContent(writer.getAnnotationInfo(annotationInfoTree)); annotationContentTree.add(writer.getAnnotationInfo(annotationInfoTree));
} }
/** /**
@ -205,7 +205,7 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
protected void buildMemberSummary(Content annotationContentTree) throws DocletException { protected void buildMemberSummary(Content annotationContentTree) throws DocletException {
Content memberSummaryTree = writer.getMemberTreeHeader(); Content memberSummaryTree = writer.getMemberTreeHeader();
builderFactory.getMemberSummaryBuilder(writer).build(memberSummaryTree); builderFactory.getMemberSummaryBuilder(writer).build(memberSummaryTree);
annotationContentTree.addContent(writer.getMemberSummaryTree(memberSummaryTree)); annotationContentTree.add(writer.getMemberSummaryTree(memberSummaryTree));
} }
/** /**
@ -223,7 +223,7 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
buildAnnotationTypeOptionalMemberDetails(memberDetailsTree); buildAnnotationTypeOptionalMemberDetails(memberDetailsTree);
if (memberDetailsTree.isValid()) { if (memberDetailsTree.isValid()) {
annotationContentTree.addContent(writer.getMemberDetailsTree(memberDetailsTree)); annotationContentTree.add(writer.getMemberDetailsTree(memberDetailsTree));
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -153,9 +153,9 @@ public class AnnotationTypeFieldBuilder extends AbstractMemberBuilder {
buildMemberComments(annotationDocTree); buildMemberComments(annotationDocTree);
buildTagInfo(annotationDocTree); buildTagInfo(annotationDocTree);
detailsTree.addContent(writer.getAnnotationDoc( detailsTree.add(writer.getAnnotationDoc(
annotationDocTree, currentMember == lastElement)); annotationDocTree, currentMember == lastElement));
memberDetailsTree.addContent(writer.getAnnotationDetails(detailsTree)); memberDetailsTree.add(writer.getAnnotationDetails(detailsTree));
} }
} }
} }
@ -166,7 +166,7 @@ public class AnnotationTypeFieldBuilder extends AbstractMemberBuilder {
* @param annotationDocTree the content tree to which the documentation will be added * @param annotationDocTree the content tree to which the documentation will be added
*/ */
protected void buildSignature(Content annotationDocTree) { protected void buildSignature(Content annotationDocTree) {
annotationDocTree.addContent( annotationDocTree.add(
writer.getSignature(currentMember)); writer.getSignature(currentMember));
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -152,9 +152,9 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder {
buildAnnotationTypeMemberChildren(annotationDocTree); buildAnnotationTypeMemberChildren(annotationDocTree);
detailsTree.addContent(writer.getAnnotationDoc( detailsTree.add(writer.getAnnotationDoc(
annotationDocTree, currentMember == lastMember)); annotationDocTree, currentMember == lastMember));
memberDetailsTree.addContent(writer.getAnnotationDetails(detailsTree)); memberDetailsTree.add(writer.getAnnotationDetails(detailsTree));
} }
} }
} }
@ -172,7 +172,7 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder {
* @param annotationDocTree the content tree to which the documentation will be added * @param annotationDocTree the content tree to which the documentation will be added
*/ */
protected void buildSignature(Content annotationDocTree) { protected void buildSignature(Content annotationDocTree) {
annotationDocTree.addContent(writer.getSignature(currentMember)); annotationDocTree.add(writer.getSignature(currentMember));
} }
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -181,7 +181,7 @@ public class ClassBuilder extends AbstractBuilder {
buildClassDescription(classInfoTree); buildClassDescription(classInfoTree);
buildClassTagInfo(classInfoTree); buildClassTagInfo(classInfoTree);
classContentTree.addContent(writer.getClassInfo(classInfoTree)); classContentTree.add(writer.getClassInfo(classInfoTree));
} }
/** /**
@ -322,7 +322,7 @@ public class ClassBuilder extends AbstractBuilder {
protected void buildMemberSummary(Content classContentTree) throws DocletException { protected void buildMemberSummary(Content classContentTree) throws DocletException {
Content memberSummaryTree = writer.getMemberTreeHeader(); Content memberSummaryTree = writer.getMemberTreeHeader();
builderFactory.getMemberSummaryBuilder(writer).build(memberSummaryTree); builderFactory.getMemberSummaryBuilder(writer).build(memberSummaryTree);
classContentTree.addContent(writer.getMemberSummaryTree(memberSummaryTree)); classContentTree.add(writer.getMemberSummaryTree(memberSummaryTree));
} }
/** /**
@ -340,7 +340,7 @@ public class ClassBuilder extends AbstractBuilder {
buildConstructorDetails(memberDetailsTree); buildConstructorDetails(memberDetailsTree);
buildMethodDetails(memberDetailsTree); buildMethodDetails(memberDetailsTree);
classContentTree.addContent(writer.getMemberDetailsTree(memberDetailsTree)); classContentTree.add(writer.getMemberDetailsTree(memberDetailsTree));
} }
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -148,10 +148,10 @@ public class ConstructorBuilder extends AbstractMemberBuilder {
buildConstructorComments(constructorDocTree); buildConstructorComments(constructorDocTree);
buildTagInfo(constructorDocTree); buildTagInfo(constructorDocTree);
constructorDetailsTree.addContent(writer.getConstructorDoc(constructorDocTree, constructorDetailsTree.add(writer.getConstructorDoc(constructorDocTree,
currentConstructor == lastElement)); currentConstructor == lastElement));
} }
memberDetailsTree.addContent( memberDetailsTree.add(
writer.getConstructorDetails(constructorDetailsTree)); writer.getConstructorDetails(constructorDetailsTree));
} }
} }
@ -162,7 +162,7 @@ public class ConstructorBuilder extends AbstractMemberBuilder {
* @param constructorDocTree the content tree to which the documentation will be added * @param constructorDocTree the content tree to which the documentation will be added
*/ */
protected void buildSignature(Content constructorDocTree) { protected void buildSignature(Content constructorDocTree) {
constructorDocTree.addContent(writer.getSignature(currentConstructor)); constructorDocTree.add(writer.getSignature(currentConstructor));
} }
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -136,10 +136,10 @@ public class EnumConstantBuilder extends AbstractMemberBuilder {
buildEnumConstantComments(enumConstantsTree); buildEnumConstantComments(enumConstantsTree);
buildTagInfo(enumConstantsTree); buildTagInfo(enumConstantsTree);
enumConstantsDetailsTree.addContent(writer.getEnumConstants( enumConstantsDetailsTree.add(writer.getEnumConstants(
enumConstantsTree, currentElement == lastElement)); enumConstantsTree, currentElement == lastElement));
} }
memberDetailsTree.addContent( memberDetailsTree.add(
writer.getEnumConstantsDetails(enumConstantsDetailsTree)); writer.getEnumConstantsDetails(enumConstantsDetailsTree));
} }
} }
@ -150,7 +150,7 @@ public class EnumConstantBuilder extends AbstractMemberBuilder {
* @param enumConstantsTree the content tree to which the documentation will be added * @param enumConstantsTree the content tree to which the documentation will be added
*/ */
protected void buildSignature(Content enumConstantsTree) { protected void buildSignature(Content enumConstantsTree) {
enumConstantsTree.addContent(writer.getSignature(currentElement)); enumConstantsTree.add(writer.getSignature(currentElement));
} }
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -137,10 +137,10 @@ public class FieldBuilder extends AbstractMemberBuilder {
buildFieldComments(fieldDocTree); buildFieldComments(fieldDocTree);
buildTagInfo(fieldDocTree); buildTagInfo(fieldDocTree);
fieldDetailsTree.addContent(writer.getFieldDoc( fieldDetailsTree.add(writer.getFieldDoc(
fieldDocTree, currentElement == lastElement)); fieldDocTree, currentElement == lastElement));
} }
memberDetailsTree.addContent( memberDetailsTree.add(
writer.getFieldDetails(fieldDetailsTree)); writer.getFieldDetails(fieldDetailsTree));
} }
} }
@ -151,7 +151,7 @@ public class FieldBuilder extends AbstractMemberBuilder {
* @param fieldDocTree the content tree to which the documentation will be added * @param fieldDocTree the content tree to which the documentation will be added
*/ */
protected void buildSignature(Content fieldDocTree) { protected void buildSignature(Content fieldDocTree) {
fieldDocTree.addContent(writer.getSignature(currentElement)); fieldDocTree.add(writer.getSignature(currentElement));
} }
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -464,7 +464,7 @@ public abstract class MemberSummaryBuilder extends AbstractMemberBuilder {
Content inheritedTree = writer.getInheritedSummaryHeader(inheritedClass); Content inheritedTree = writer.getInheritedSummaryHeader(inheritedClass);
Content linksTree = writer.getInheritedSummaryLinksTree(); Content linksTree = writer.getInheritedSummaryLinksTree();
addSummaryFootNote(inheritedClass, inheritedMembers, linksTree, writer); addSummaryFootNote(inheritedClass, inheritedMembers, linksTree, writer);
inheritedTree.addContent(linksTree); inheritedTree.add(linksTree);
summaryTreeList.add(writer.getMemberTree(inheritedTree)); summaryTreeList.add(writer.getMemberTree(inheritedTree));
} }
} }
@ -497,7 +497,7 @@ public abstract class MemberSummaryBuilder extends AbstractMemberBuilder {
buildInheritedSummary(writer, kind, summaryTreeList); buildInheritedSummary(writer, kind, summaryTreeList);
if (!summaryTreeList.isEmpty()) { if (!summaryTreeList.isEmpty()) {
Content memberTree = writer.getMemberSummaryHeader(typeElement, memberSummaryTree); Content memberTree = writer.getMemberSummaryHeader(typeElement, memberSummaryTree);
summaryTreeList.stream().forEach(memberTree::addContent); summaryTreeList.stream().forEach(memberTree::add);
writer.addMemberTree(memberSummaryTree, memberTree); writer.addMemberTree(memberSummaryTree, memberTree);
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -139,10 +139,10 @@ public class MethodBuilder extends AbstractMemberBuilder {
buildMethodComments(methodDocTree); buildMethodComments(methodDocTree);
buildTagInfo(methodDocTree); buildTagInfo(methodDocTree);
methodDetailsTree.addContent(writer.getMethodDoc( methodDetailsTree.add(writer.getMethodDoc(
methodDocTree, currentMethod == lastElement)); methodDocTree, currentMethod == lastElement));
} }
memberDetailsTree.addContent(writer.getMethodDetails(methodDetailsTree)); memberDetailsTree.add(writer.getMethodDetails(methodDetailsTree));
} }
} }
@ -152,7 +152,7 @@ public class MethodBuilder extends AbstractMemberBuilder {
* @param methodDocTree the content tree to which the documentation will be added * @param methodDocTree the content tree to which the documentation will be added
*/ */
protected void buildSignature(Content methodDocTree) { protected void buildSignature(Content methodDocTree) {
methodDocTree.addContent(writer.getSignature(currentMethod)); methodDocTree.add(writer.getSignature(currentMethod));
} }
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -152,7 +152,7 @@ public class ModuleSummaryBuilder extends AbstractBuilder {
buildModulesSummary(summaryContentTree); buildModulesSummary(summaryContentTree);
buildServicesSummary(summaryContentTree); buildServicesSummary(summaryContentTree);
moduleContentTree.addContent(moduleWriter.getSummaryTree(summaryContentTree)); moduleContentTree.add(moduleWriter.getSummaryTree(summaryContentTree));
} }
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -163,7 +163,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
buildErrorSummary(summaryContentTree); buildErrorSummary(summaryContentTree);
buildAnnotationTypeSummary(summaryContentTree); buildAnnotationTypeSummary(summaryContentTree);
packageContentTree.addContent(summaryContentTree); packageContentTree.add(summaryContentTree);
} }
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -35,7 +35,6 @@ import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content; import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.DocletException; import jdk.javadoc.internal.doclets.toolkit.DocletException;
import jdk.javadoc.internal.doclets.toolkit.PropertyWriter; import jdk.javadoc.internal.doclets.toolkit.PropertyWriter;
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable;
import static jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable.Kind.*; import static jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable.Kind.*;
@ -138,10 +137,10 @@ public class PropertyBuilder extends AbstractMemberBuilder {
buildPropertyComments(propertyDocTree); buildPropertyComments(propertyDocTree);
buildTagInfo(propertyDocTree); buildTagInfo(propertyDocTree);
propertyDetailsTree.addContent(writer.getPropertyDoc( propertyDetailsTree.add(writer.getPropertyDoc(
propertyDocTree, currentProperty == lastElement)); propertyDocTree, currentProperty == lastElement));
} }
memberDetailsTree.addContent( memberDetailsTree.add(
writer.getPropertyDetails(propertyDetailsTree)); writer.getPropertyDetails(propertyDetailsTree));
} }
} }
@ -152,7 +151,7 @@ public class PropertyBuilder extends AbstractMemberBuilder {
* @param propertyDocTree the content tree to which the documentation will be added * @param propertyDocTree the content tree to which the documentation will be added
*/ */
protected void buildSignature(Content propertyDocTree) { protected void buildSignature(Content propertyDocTree) {
propertyDocTree.addContent(writer.getSignature(currentProperty)); propertyDocTree.add(writer.getSignature(currentProperty));
} }
/** /**

View File

@ -170,7 +170,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
buildPackageSerializedForm(serializedSummariesTree); buildPackageSerializedForm(serializedSummariesTree);
} }
serializedTree.addContent(writer.getSerializedContent( serializedTree.add(writer.getSerializedContent(
serializedSummariesTree)); serializedSummariesTree));
} }
@ -205,7 +205,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
* @param packageSerializedTree content tree to which the documentation will be added * @param packageSerializedTree content tree to which the documentation will be added
*/ */
protected void buildPackageHeader(Content packageSerializedTree) { protected void buildPackageHeader(Content packageSerializedTree) {
packageSerializedTree.addContent(writer.getPackageHeader( packageSerializedTree.add(writer.getPackageHeader(
utils.getPackageName(currentPackage))); utils.getPackageName(currentPackage)));
} }
@ -232,10 +232,10 @@ public class SerializedFormBuilder extends AbstractBuilder {
buildSerialUIDInfo(classTree); buildSerialUIDInfo(classTree);
buildClassContent(classTree); buildClassContent(classTree);
classSerializedTree.addContent(classTree); classSerializedTree.add(classTree);
} }
} }
packageSerializedTree.addContent(classSerializedTree); packageSerializedTree.add(classSerializedTree);
} }
/** /**
@ -254,7 +254,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
break; break;
} }
} }
classTree.addContent(serialUidTree); classTree.add(serialUidTree);
} }
/** /**
@ -270,7 +270,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
buildFieldHeader(classContentTree); buildFieldHeader(classContentTree);
buildSerializableFields(classContentTree); buildSerializableFields(classContentTree);
classTree.addContent(classContentTree); classTree.add(classContentTree);
} }
/** /**
@ -292,18 +292,18 @@ public class SerializedFormBuilder extends AbstractBuilder {
buildDeprecatedMethodInfo(methodsContentTree); buildDeprecatedMethodInfo(methodsContentTree);
buildMethodInfo(methodsContentTree); buildMethodInfo(methodsContentTree);
serializableMethodTree.addContent(methodsContentTree); serializableMethodTree.add(methodsContentTree);
} }
} }
if (!utils.serializationMethods(currentTypeElement).isEmpty()) { if (!utils.serializationMethods(currentTypeElement).isEmpty()) {
classContentTree.addContent(methodWriter.getSerializableMethods( classContentTree.add(methodWriter.getSerializableMethods(
resources.getText("doclet.Serialized_Form_methods"), resources.getText("doclet.Serialized_Form_methods"),
serializableMethodTree)); serializableMethodTree));
if (utils.isSerializable(currentTypeElement) && !utils.isExternalizable(currentTypeElement)) { if (utils.isSerializable(currentTypeElement) && !utils.isExternalizable(currentTypeElement)) {
if (utils.serializationMethods(currentTypeElement).isEmpty()) { if (utils.serializationMethods(currentTypeElement).isEmpty()) {
Content noCustomizationMsg = methodWriter.getNoCustomizationMsg( Content noCustomizationMsg = methodWriter.getNoCustomizationMsg(
resources.getText("doclet.Serializable_no_customization")); resources.getText("doclet.Serializable_no_customization"));
classContentTree.addContent(methodWriter.getSerializableMethods( classContentTree.add(methodWriter.getSerializableMethods(
resources.getText("doclet.Serialized_Form_methods"), resources.getText("doclet.Serialized_Form_methods"),
noCustomizationMsg)); noCustomizationMsg));
} }
@ -402,8 +402,8 @@ public class SerializedFormBuilder extends AbstractBuilder {
fieldWriter.addMemberDescription(ve, fieldsOverviewContentTree); fieldWriter.addMemberDescription(ve, fieldsOverviewContentTree);
fieldWriter.addMemberTags(ve, fieldsOverviewContentTree); fieldWriter.addMemberTags(ve, fieldsOverviewContentTree);
} }
serializableFieldsTree.addContent(fieldsOverviewContentTree); serializableFieldsTree.add(fieldsOverviewContentTree);
classContentTree.addContent(fieldWriter.getSerializableFields( classContentTree.add(fieldWriter.getSerializableFields(
resources.getText("doclet.Serialized_Form_class"), resources.getText("doclet.Serialized_Form_class"),
serializableFieldsTree)); serializableFieldsTree));
} }
@ -431,12 +431,12 @@ public class SerializedFormBuilder extends AbstractBuilder {
buildFieldDeprecationInfo(fieldsContentTree); buildFieldDeprecationInfo(fieldsContentTree);
buildFieldInfo(fieldsContentTree); buildFieldInfo(fieldsContentTree);
serializableFieldsTree.addContent(fieldsContentTree); serializableFieldsTree.add(fieldsContentTree);
} else { } else {
buildSerialFieldTagsInfo(serializableFieldsTree); buildSerialFieldTagsInfo(serializableFieldsTree);
} }
} }
classContentTree.addContent(fieldWriter.getSerializableFields( classContentTree.add(fieldWriter.getSerializableFields(
resources.getText("doclet.Serialized_Form_fields"), resources.getText("doclet.Serialized_Form_fields"),
serializableFieldsTree)); serializableFieldsTree));
} }
@ -511,7 +511,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
fieldWriter.addMemberHeader(te, fieldType, "", fieldWriter.addMemberHeader(te, fieldType, "",
tag.getName().getName().toString(), fieldsContentTree); tag.getName().getName().toString(), fieldsContentTree);
fieldWriter.addMemberDescription(field, tag, fieldsContentTree); fieldWriter.addMemberDescription(field, tag, fieldsContentTree);
serializableFieldsTree.addContent(fieldsContentTree); serializableFieldsTree.add(fieldsContentTree);
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -134,7 +134,7 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet {
ExecutableElement member = (ExecutableElement) holder; ExecutableElement member = (ExecutableElement) holder;
Content output = getTagletOutput(false, member, writer, Content output = getTagletOutput(false, member, writer,
member.getTypeParameters(), utils.getTypeParamTrees(member)); member.getTypeParameters(), utils.getTypeParamTrees(member));
output.addContent(getTagletOutput(true, member, writer, output.add(getTagletOutput(true, member, writer,
member.getParameters(), utils.getParamTrees(member))); member.getParameters(), utils.getParamTrees(member)));
return output; return output;
} else { } else {
@ -160,7 +160,7 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet {
Content result = writer.getOutputInstance(); Content result = writer.getOutputInstance();
Set<String> alreadyDocumented = new HashSet<>(); Set<String> alreadyDocumented = new HashSet<>();
if (!paramTags.isEmpty()) { if (!paramTags.isEmpty()) {
result.addContent( result.add(
processParamTags(holder, isParameters, paramTags, processParamTags(holder, isParameters, paramTags,
getRankMap(writer.configuration().utils, formalParameters), writer, alreadyDocumented) getRankMap(writer.configuration().utils, formalParameters), writer, alreadyDocumented)
); );
@ -168,7 +168,7 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet {
if (alreadyDocumented.size() != formalParameters.size()) { if (alreadyDocumented.size() != formalParameters.size()) {
//Some parameters are missing corresponding @param tags. //Some parameters are missing corresponding @param tags.
//Try to inherit them. //Try to inherit them.
result.addContent(getInheritedTagletOutput(isParameters, holder, result.add(getInheritedTagletOutput(isParameters, holder,
writer, formalParameters, alreadyDocumented)); writer, formalParameters, alreadyDocumented));
} }
return result; return result;
@ -204,7 +204,7 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet {
inheritedDoc.holderTag, inheritedDoc.holderTag,
lname, lname,
alreadyDocumented.isEmpty()); alreadyDocumented.isEmpty());
result.addContent(content); result.add(content);
} }
alreadyDocumented.add(String.valueOf(i)); alreadyDocumented.add(String.valueOf(i));
} }
@ -256,7 +256,7 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet {
: "doclet.Type_Parameters_dup_warn", : "doclet.Type_Parameters_dup_warn",
paramName); paramName);
} }
result.addContent(processParamTag(e, isParams, writer, dt, result.add(processParamTag(e, isParams, writer, dt,
ch.getParameterName(dt), alreadyDocumented.isEmpty())); ch.getParameterName(dt), alreadyDocumented.isEmpty()));
alreadyDocumented.add(rank); alreadyDocumented.add(rank);
} }
@ -285,9 +285,9 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet {
String header = writer.configuration().getResources().getText( String header = writer.configuration().getResources().getText(
isParams ? "doclet.Parameters" : "doclet.TypeParameters"); isParams ? "doclet.Parameters" : "doclet.TypeParameters");
if (isFirstParam) { if (isFirstParam) {
result.addContent(writer.getParamHeader(header)); result.add(writer.getParamHeader(header));
} }
result.addContent(writer.paramTagOutput(e, paramTag, name)); result.add(writer.paramTagOutput(e, paramTag, name));
return result; return result;
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -259,7 +259,7 @@ public abstract class TagletWriter {
} }
if (currentOutput != null) { if (currentOutput != null) {
tagletManager.seenCustomTag(taglet.getName()); tagletManager.seenCustomTag(taglet.getName());
output.addContent(currentOutput); output.add(currentOutput);
} }
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -104,9 +104,9 @@ public class ThrowsTaglet extends BaseTaglet
!alreadyDocumented.contains(utils.getSimpleName(klass)) && !alreadyDocumented.contains(utils.getSimpleName(klass)) &&
!alreadyDocumented.contains(utils.getFullyQualifiedName(klass))) { !alreadyDocumented.contains(utils.getFullyQualifiedName(klass))) {
if (alreadyDocumented.isEmpty()) { if (alreadyDocumented.isEmpty()) {
result.addContent(writer.getThrowsHeader()); result.add(writer.getThrowsHeader());
} }
result.addContent(writer.throwsTagOutput(declaredExceptionType)); result.add(writer.throwsTagOutput(declaredExceptionType));
alreadyDocumented.add(utils.getSimpleName(klass)); alreadyDocumented.add(utils.getSimpleName(klass));
} }
} }
@ -140,7 +140,7 @@ public class ThrowsTaglet extends BaseTaglet
declaredExceptionTags.put(inheritedDoc.tagList, (ExecutableElement)inheritedDoc.holder); declaredExceptionTags.put(inheritedDoc.tagList, (ExecutableElement)inheritedDoc.holder);
} }
} }
result.addContent(throwsTagsOutput(declaredExceptionTags, writer, alreadyDocumented, false)); result.add(throwsTagsOutput(declaredExceptionTags, writer, alreadyDocumented, false));
} }
return result; return result;
} }
@ -156,11 +156,11 @@ public class ThrowsTaglet extends BaseTaglet
Content result = writer.getOutputInstance(); Content result = writer.getOutputInstance();
HashSet<String> alreadyDocumented = new HashSet<>(); HashSet<String> alreadyDocumented = new HashSet<>();
if (!tagsMap.isEmpty()) { if (!tagsMap.isEmpty()) {
result.addContent(throwsTagsOutput(tagsMap, writer, alreadyDocumented, true)); result.add(throwsTagsOutput(tagsMap, writer, alreadyDocumented, true));
} }
result.addContent(inheritThrowsDocumentation(holder, result.add(inheritThrowsDocumentation(holder,
execHolder.getThrownTypes(), alreadyDocumented, writer)); execHolder.getThrownTypes(), alreadyDocumented, writer));
result.addContent(linkToUndocumentedDeclaredExceptions( result.add(linkToUndocumentedDeclaredExceptions(
execHolder.getThrownTypes(), alreadyDocumented, writer)); execHolder.getThrownTypes(), alreadyDocumented, writer));
return result; return result;
} }
@ -192,9 +192,9 @@ public class ThrowsTaglet extends BaseTaglet
continue; continue;
} }
if (alreadyDocumented.isEmpty()) { if (alreadyDocumented.isEmpty()) {
result.addContent(writer.getThrowsHeader()); result.add(writer.getThrowsHeader());
} }
result.addContent(writer.throwsTagOutput(e, dt)); result.add(writer.throwsTagOutput(e, dt));
alreadyDocumented.add(te != null alreadyDocumented.add(te != null
? utils.getFullyQualifiedName(te) ? utils.getFullyQualifiedName(te)
: excName); : excName);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -132,7 +132,7 @@ public class UserTaglet implements Taglet {
*/ */
public Content getTagletOutput(Element element, DocTree tag, TagletWriter writer){ public Content getTagletOutput(Element element, DocTree tag, TagletWriter writer){
Content output = writer.getOutputInstance(); Content output = writer.getOutputInstance();
output.addContent(new RawHtml(userTaglet.toString(Collections.singletonList(tag), element))); output.add(new RawHtml(userTaglet.toString(Collections.singletonList(tag), element)));
return output; return output;
} }
@ -146,7 +146,7 @@ public class UserTaglet implements Taglet {
if (!tags.isEmpty()) { if (!tags.isEmpty()) {
String tagString = userTaglet.toString(tags, holder); String tagString = userTaglet.toString(tags, holder);
if (tagString != null) { if (tagString != null) {
output.addContent(new RawHtml(tagString)); output.add(new RawHtml(tagString));
} }
} }
return output; return output;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -81,7 +81,7 @@ public abstract class LinkFactory {
// handles primitives, no types and error types // handles primitives, no types and error types
@Override @Override
protected Content defaultAction(TypeMirror type, LinkInfo linkInfo) { protected Content defaultAction(TypeMirror type, LinkInfo linkInfo) {
link.addContent(utils.getTypeName(type, false)); link.add(utils.getTypeName(type, false));
return link; return link;
} }
@ -96,14 +96,14 @@ public abstract class LinkFactory {
currentDepth--; currentDepth--;
if (utils.isAnnotated(type)) { if (utils.isAnnotated(type)) {
linkInfo.type = type; linkInfo.type = type;
link.addContent(" "); link.add(" ");
link.addContent(getTypeAnnotationLinks(linkInfo)); link.add(getTypeAnnotationLinks(linkInfo));
} }
// use vararg if required // use vararg if required
if (linkInfo.isVarArg && currentDepth == 0) { if (linkInfo.isVarArg && currentDepth == 0) {
link.addContent("..."); link.add("...");
} else { } else {
link.addContent("[]"); link.add("[]");
} }
return link; return link;
} }
@ -111,25 +111,25 @@ public abstract class LinkFactory {
@Override @Override
public Content visitWildcard(WildcardType type, LinkInfo linkInfo) { public Content visitWildcard(WildcardType type, LinkInfo linkInfo) {
linkInfo.isTypeBound = true; linkInfo.isTypeBound = true;
link.addContent("?"); link.add("?");
TypeMirror extendsBound = type.getExtendsBound(); TypeMirror extendsBound = type.getExtendsBound();
if (extendsBound != null) { if (extendsBound != null) {
link.addContent(" extends "); link.add(" extends ");
setBoundsLinkInfo(linkInfo, extendsBound); setBoundsLinkInfo(linkInfo, extendsBound);
link.addContent(getLink(linkInfo)); link.add(getLink(linkInfo));
} }
TypeMirror superBound = type.getSuperBound(); TypeMirror superBound = type.getSuperBound();
if (superBound != null) { if (superBound != null) {
link.addContent(" super "); link.add(" super ");
setBoundsLinkInfo(linkInfo, superBound); setBoundsLinkInfo(linkInfo, superBound);
link.addContent(getLink(linkInfo)); link.add(getLink(linkInfo));
} }
return link; return link;
} }
@Override @Override
public Content visitTypeVariable(TypeVariable type, LinkInfo linkInfo) { public Content visitTypeVariable(TypeVariable type, LinkInfo linkInfo) {
link.addContent(getTypeAnnotationLinks(linkInfo)); link.add(getTypeAnnotationLinks(linkInfo));
linkInfo.isTypeBound = true; linkInfo.isTypeBound = true;
TypeVariable typevariable = (utils.isArrayType(type)) TypeVariable typevariable = (utils.isArrayType(type))
? (TypeVariable) componentType ? (TypeVariable) componentType
@ -138,12 +138,12 @@ public abstract class LinkFactory {
if ((!linkInfo.excludeTypeParameterLinks) && utils.isTypeElement(owner)) { if ((!linkInfo.excludeTypeParameterLinks) && utils.isTypeElement(owner)) {
linkInfo.typeElement = (TypeElement) owner; linkInfo.typeElement = (TypeElement) owner;
Content label = newContent(); Content label = newContent();
label.addContent(utils.getTypeName(type, false)); label.add(utils.getTypeName(type, false));
linkInfo.label = label; linkInfo.label = label;
link.addContent(getClassLink(linkInfo)); link.add(getClassLink(linkInfo));
} else { } else {
// No need to link method type parameters. // No need to link method type parameters.
link.addContent(utils.getTypeName(typevariable, false)); link.add(utils.getTypeName(typevariable, false));
} }
if (!linkInfo.excludeTypeBounds) { if (!linkInfo.excludeTypeBounds) {
@ -159,9 +159,9 @@ public abstract class LinkFactory {
!utils.isAnnotated(bound)) { !utils.isAnnotated(bound)) {
continue; continue;
} }
link.addContent(more ? " & " : " extends "); link.add(more ? " & " : " extends ");
setBoundsLinkInfo(linkInfo, bound); setBoundsLinkInfo(linkInfo, bound);
link.addContent(getLink(linkInfo)); link.add(getLink(linkInfo));
more = true; more = true;
} }
} }
@ -173,16 +173,16 @@ public abstract class LinkFactory {
if (linkInfo.isTypeBound && linkInfo.excludeTypeBoundsLinks) { if (linkInfo.isTypeBound && linkInfo.excludeTypeBoundsLinks) {
// Since we are excluding type parameter links, we should not // Since we are excluding type parameter links, we should not
// be linking to the type bound. // be linking to the type bound.
link.addContent(utils.getTypeName(type, false)); link.add(utils.getTypeName(type, false));
link.addContent(getTypeParameterLinks(linkInfo)); link.add(getTypeParameterLinks(linkInfo));
return link; return link;
} else { } else {
link = newContent(); link = newContent();
link.addContent(getTypeAnnotationLinks(linkInfo)); link.add(getTypeAnnotationLinks(linkInfo));
linkInfo.typeElement = utils.asTypeElement(type); linkInfo.typeElement = utils.asTypeElement(type);
link.addContent(getClassLink(linkInfo)); link.add(getClassLink(linkInfo));
if (linkInfo.includeTypeAsSepLink) { if (linkInfo.includeTypeAsSepLink) {
link.addContent(getTypeParameterLinks(linkInfo, false)); link.add(getTypeParameterLinks(linkInfo, false));
} }
} }
return link; return link;
@ -191,9 +191,9 @@ public abstract class LinkFactory {
return linkVisitor.visit(linkInfo.type, linkInfo); return linkVisitor.visit(linkInfo.type, linkInfo);
} else if (linkInfo.typeElement != null) { } else if (linkInfo.typeElement != null) {
Content link = newContent(); Content link = newContent();
link.addContent(getClassLink(linkInfo)); link.add(getClassLink(linkInfo));
if (linkInfo.includeTypeAsSepLink) { if (linkInfo.includeTypeAsSepLink) {
link.addContent(getTypeParameterLinks(linkInfo, false)); link.add(getTypeParameterLinks(linkInfo, false));
} }
return link; return link;
} else { } else {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -145,11 +145,11 @@ public abstract class LinkInfo {
return label; return label;
} else if (isLinkable()) { } else if (isLinkable()) {
Content tlabel = newContent(); Content tlabel = newContent();
tlabel.addContent(configuration.utils.getSimpleName(typeElement)); tlabel.add(configuration.utils.getSimpleName(typeElement));
return tlabel; return tlabel;
} else { } else {
Content tlabel = newContent(); Content tlabel = newContent();
tlabel.addContent(configuration.getClassName(typeElement)); tlabel.add(configuration.getClassName(typeElement));
return tlabel; return tlabel;
} }
} }

View File

@ -76,31 +76,31 @@ public class TestHtmlDocument extends JavadocTester {
HtmlTree title = new HtmlTree(HtmlTag.TITLE); HtmlTree title = new HtmlTree(HtmlTag.TITLE);
// String content within the document // String content within the document
StringContent titleContent = new StringContent("Markup test"); StringContent titleContent = new StringContent("Markup test");
title.addContent(titleContent); title.add(titleContent);
head.addContent(title); head.add(title);
// Test META tag // Test META tag
HtmlTree meta = new HtmlTree(HtmlTag.META); HtmlTree meta = new HtmlTree(HtmlTag.META);
meta.addAttr(HtmlAttr.NAME, "keywords"); meta.put(HtmlAttr.NAME, "keywords");
meta.addAttr(HtmlAttr.CONTENT, "testContent"); meta.put(HtmlAttr.CONTENT, "testContent");
head.addContent(meta); head.add(meta);
// Test invalid META tag // Test invalid META tag
HtmlTree invmeta = new HtmlTree(HtmlTag.META); HtmlTree invmeta = new HtmlTree(HtmlTag.META);
head.addContent(invmeta); head.add(invmeta);
// Test LINK tag // Test LINK tag
HtmlTree link = new HtmlTree(HtmlTag.LINK); HtmlTree link = new HtmlTree(HtmlTag.LINK);
link.addAttr(HtmlAttr.REL, "testRel"); link.put(HtmlAttr.REL, "testRel");
link.addAttr(HtmlAttr.HREF, "testLink.html"); link.put(HtmlAttr.HREF, "testLink.html");
head.addContent(link); head.add(link);
// Test invalid LINK tag // Test invalid LINK tag
HtmlTree invlink = new HtmlTree(HtmlTag.LINK); HtmlTree invlink = new HtmlTree(HtmlTag.LINK);
head.addContent(invlink); head.add(invlink);
html.addContent(head); html.add(head);
// Comment within the document // Comment within the document
Comment bodyMarker = new Comment("======== START OF BODY ========"); Comment bodyMarker = new Comment("======== START OF BODY ========");
html.addContent(bodyMarker); html.add(bodyMarker);
HtmlTree body = new HtmlTree(HtmlTag.BODY); HtmlTree body = new HtmlTree(HtmlTag.BODY);
Comment pMarker = new Comment("======== START OF PARAGRAPH ========"); Comment pMarker = new Comment("======== START OF PARAGRAPH ========");
body.addContent(pMarker); body.add(pMarker);
HtmlTree p = new HtmlTree(HtmlTag.P); HtmlTree p = new HtmlTree(HtmlTag.P);
StringContent bodyContent = new StringContent( StringContent bodyContent = new StringContent(
"This document is generated from sample source code and HTML " + "This document is generated from sample source code and HTML " +
@ -108,41 +108,41 @@ public class TestHtmlDocument extends JavadocTester {
"subclasses, subinterfaces, nested classes, nested interfaces," + "subclasses, subinterfaces, nested classes, nested interfaces," +
"inheriting from other packages, constructors, fields," + "inheriting from other packages, constructors, fields," +
"methods, and so forth. "); "methods, and so forth. ");
p.addContent(bodyContent); p.add(bodyContent);
StringContent anchorContent = new StringContent("Click Here"); StringContent anchorContent = new StringContent("Click Here");
p.addContent(HtmlTree.A("testLink.html", anchorContent)); p.add(HtmlTree.A("testLink.html", anchorContent));
StringContent pContent = new StringContent(" to <test> out a link."); StringContent pContent = new StringContent(" to <test> out a link.");
p.addContent(pContent); p.add(pContent);
body.addContent(p); body.add(p);
HtmlTree p1 = new HtmlTree(HtmlTag.P); HtmlTree p1 = new HtmlTree(HtmlTag.P);
// Test another version of A tag. // Test another version of A tag.
HtmlTree anchor = new HtmlTree(HtmlTag.A); HtmlTree anchor = new HtmlTree(HtmlTag.A);
anchor.addAttr(HtmlAttr.HREF, "testLink.html"); anchor.put(HtmlAttr.HREF, "testLink.html");
anchor.addAttr(HtmlAttr.ID, "Another version of a tag"); anchor.put(HtmlAttr.ID, "Another version of a tag");
p1.addContent(anchor); p1.add(anchor);
body.addContent(p1); body.add(p1);
// Test for empty tags. // Test for empty tags.
HtmlTree dl = new HtmlTree(HtmlTag.DL); HtmlTree dl = new HtmlTree(HtmlTag.DL);
html.addContent(dl); html.add(dl);
// Test for empty nested tags. // Test for empty nested tags.
HtmlTree dlTree = new HtmlTree(HtmlTag.DL); HtmlTree dlTree = new HtmlTree(HtmlTag.DL);
dlTree.addContent(new HtmlTree(HtmlTag.DT)); dlTree.add(new HtmlTree(HtmlTag.DT));
dlTree.addContent(new HtmlTree (HtmlTag.DD)); dlTree.add(new HtmlTree (HtmlTag.DD));
html.addContent(dlTree); html.add(dlTree);
HtmlTree dlDisplay = new HtmlTree(HtmlTag.DL); HtmlTree dlDisplay = new HtmlTree(HtmlTag.DL);
dlDisplay.addContent(new HtmlTree(HtmlTag.DT)); dlDisplay.add(new HtmlTree(HtmlTag.DT));
HtmlTree dd = new HtmlTree (HtmlTag.DD); HtmlTree dd = new HtmlTree (HtmlTag.DD);
StringContent ddContent = new StringContent("Test DD"); StringContent ddContent = new StringContent("Test DD");
dd.addContent(ddContent); dd.add(ddContent);
dlDisplay.addContent(dd); dlDisplay.add(dd);
body.addContent(dlDisplay); body.add(dlDisplay);
StringContent emptyString = new StringContent(""); StringContent emptyString = new StringContent("");
body.addContent(emptyString); body.add(emptyString);
Comment emptyComment = new Comment(""); Comment emptyComment = new Comment("");
body.addContent(emptyComment); body.add(emptyComment);
HtmlTree hr = new HtmlTree(HtmlTag.HR); HtmlTree hr = new HtmlTree(HtmlTag.HR);
body.addContent(hr); body.add(hr);
html.addContent(body); html.add(body);
HtmlDocument htmlDoc = new HtmlDocument(html); HtmlDocument htmlDoc = new HtmlDocument(html);
return htmlDoc.toString(); return htmlDoc.toString();
} }