mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-07 22:50:49 +00:00
8000673: remove dead code from HtmlWriter and subtypes
Reviewed-by: bpatel
This commit is contained in:
parent
a0b8f099ab
commit
4aedf7469a
@ -187,23 +187,6 @@ public abstract class AbstractMemberWriter {
|
||||
*/
|
||||
protected abstract void addNavDetailLink(boolean link, Content liNav);
|
||||
|
||||
/*** ***/
|
||||
|
||||
protected void print(String str) {
|
||||
writer.print(str);
|
||||
writer.displayLength += str.length();
|
||||
}
|
||||
|
||||
protected void print(char ch) {
|
||||
writer.print(ch);
|
||||
writer.displayLength++;
|
||||
}
|
||||
|
||||
protected void strong(String str) {
|
||||
writer.strong(str);
|
||||
writer.displayLength += str.length();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the member name to the content tree and modifies the display length.
|
||||
*
|
||||
@ -310,23 +293,6 @@ public abstract class AbstractMemberWriter {
|
||||
tdSummaryType.addContent(code);
|
||||
}
|
||||
|
||||
private void printModifier(ProgramElementDoc member) {
|
||||
if (member.isProtected()) {
|
||||
print("protected ");
|
||||
} else if (member.isPrivate()) {
|
||||
print("private ");
|
||||
} else if (!member.isPublic()) { // Package private
|
||||
writer.printText("doclet.Package_private");
|
||||
print(" ");
|
||||
}
|
||||
if (member.isMethod() && ((MethodDoc)member).isAbstract()) {
|
||||
print("abstract ");
|
||||
}
|
||||
if (member.isStatic()) {
|
||||
print("static");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the modifier for the member.
|
||||
*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -60,18 +60,6 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl
|
||||
return Arrays.asList(cd.serializableFields());
|
||||
}
|
||||
|
||||
protected void printTypeLinkNoDimension(Type type) {
|
||||
ClassDoc cd = type.asClassDoc();
|
||||
//Linking to package private classes in serialized for causes
|
||||
//broken links. Don't link to them.
|
||||
if (type.isPrimitive() || cd.isPackagePrivate()) {
|
||||
print(type.typeName());
|
||||
} else {
|
||||
writer.printLink(new LinkInfoImpl(
|
||||
LinkInfoImpl.CONTEXT_SERIAL_MEMBER, type));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the header for serializable fields section.
|
||||
*
|
||||
|
||||
@ -166,14 +166,4 @@ public class HtmlSerialMethodWriter extends MethodWriterImpl implements
|
||||
method.containingClass().qualifiedName(), method.name());
|
||||
}
|
||||
}
|
||||
|
||||
protected void printTypeLinkNoDimension(Type type) {
|
||||
ClassDoc cd = type.asClassDoc();
|
||||
if (type.isPrimitive() || cd.isPackagePrivate()) {
|
||||
print(type.typeName());
|
||||
} else {
|
||||
writer.printLink(new LinkInfoImpl(
|
||||
LinkInfoImpl.CONTEXT_SERIAL_MEMBER,type));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -218,16 +218,6 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
|
||||
printHtmlDocument(null, true, serializedTree);
|
||||
}
|
||||
|
||||
private void tableHeader() {
|
||||
tableIndexSummary();
|
||||
trBgcolorStyle("#CCCCFF", "TableSubHeadingColor");
|
||||
}
|
||||
|
||||
private void tableFooter() {
|
||||
fontEnd();
|
||||
thEnd(); trEnd(); tableEnd();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an instance of a SerialFieldWriter.
|
||||
*
|
||||
|
||||
@ -66,18 +66,6 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
|
||||
super(configuration, path, filename, relpath);
|
||||
}
|
||||
|
||||
public void printTypeSummaryHeader() {
|
||||
tdIndex();
|
||||
font("-1");
|
||||
code();
|
||||
}
|
||||
|
||||
public void printTypeSummaryFooter() {
|
||||
codeEnd();
|
||||
fontEnd();
|
||||
tdEnd();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the summary header.
|
||||
*
|
||||
@ -105,14 +93,6 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
|
||||
return table;
|
||||
}
|
||||
|
||||
public void printTableHeadingBackground(String str) {
|
||||
tableIndexDetail();
|
||||
tableHeaderStart("#CCCCFF", 1);
|
||||
strong(str);
|
||||
tableHeaderEnd();
|
||||
tableEnd();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the inherited summary header.
|
||||
*
|
||||
@ -126,19 +106,6 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
|
||||
mw.addInheritedSummaryLabel(cd, inheritedTree);
|
||||
}
|
||||
|
||||
public void printSummaryFooter(AbstractMemberWriter mw, ClassDoc cd) {
|
||||
tableEnd();
|
||||
space();
|
||||
}
|
||||
|
||||
public void printInheritedSummaryFooter(AbstractMemberWriter mw, ClassDoc cd) {
|
||||
codeEnd();
|
||||
summaryRowEnd();
|
||||
trEnd();
|
||||
tableEnd();
|
||||
space();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the index comment.
|
||||
*
|
||||
@ -149,24 +116,6 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
|
||||
addIndexComment(member, member.firstSentenceTags(), contentTree);
|
||||
}
|
||||
|
||||
protected void printIndexComment(Doc member, Tag[] firstSentenceTags) {
|
||||
Tag[] deprs = member.tags("deprecated");
|
||||
if (Util.isDeprecated((ProgramElementDoc) member)) {
|
||||
strongText("doclet.Deprecated");
|
||||
space();
|
||||
if (deprs.length > 0) {
|
||||
printInlineDeprecatedComment(member, deprs[0]);
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
ClassDoc cd = ((ProgramElementDoc)member).containingClass();
|
||||
if (cd != null && Util.isDeprecated(cd)) {
|
||||
strongText("doclet.Deprecated"); space();
|
||||
}
|
||||
}
|
||||
printSummaryComment(member, firstSentenceTags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the index comment.
|
||||
*
|
||||
@ -223,18 +172,6 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
|
||||
addSummaryLinkComment(mw, member, member.firstSentenceTags(), contentTree);
|
||||
}
|
||||
|
||||
public void printSummaryLinkComment(AbstractMemberWriter mw,
|
||||
ProgramElementDoc member,
|
||||
Tag[] firstSentenceTags) {
|
||||
codeEnd();
|
||||
println();
|
||||
br();
|
||||
printNbsps();
|
||||
printIndexComment(member, firstSentenceTags);
|
||||
summaryRowEnd();
|
||||
trEnd();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the summary link comment.
|
||||
*
|
||||
@ -265,13 +202,6 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
|
||||
mw.addInheritedSummaryLink(cd, member, linksTree);
|
||||
}
|
||||
|
||||
public void printMemberHeader() {
|
||||
hr();
|
||||
}
|
||||
|
||||
public void printMemberFooter() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the document content header tree
|
||||
*
|
||||
|
||||
@ -82,48 +82,6 @@ public abstract class HtmlDocWriter extends HtmlWriter {
|
||||
*/
|
||||
public abstract Configuration configuration();
|
||||
|
||||
/**
|
||||
* Print Html Hyper Link.
|
||||
*
|
||||
* @param link String name of the file.
|
||||
* @param where Position of the link in the file. Character '#' is not
|
||||
* needed.
|
||||
* @param label Tag for the link.
|
||||
* @param strong Boolean that sets label to strong.
|
||||
*/
|
||||
public void printHyperLink(String link, String where,
|
||||
String label, boolean strong) {
|
||||
print(getHyperLinkString(link, where, label, strong, "", "", ""));
|
||||
}
|
||||
|
||||
/**
|
||||
* Print Html Hyper Link.
|
||||
*
|
||||
* @param link String name of the file.
|
||||
* @param where Position of the link in the file. Character '#' is not
|
||||
* needed.
|
||||
* @param label Tag for the link.
|
||||
*/
|
||||
public void printHyperLink(String link, String where, String label) {
|
||||
printHyperLink(link, where, label, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Print Html Hyper Link.
|
||||
*
|
||||
* @param link String name of the file.
|
||||
* @param where Position of the link in the file. Character '#' is not
|
||||
* needed.
|
||||
* @param label Tag for the link.
|
||||
* @param strong Boolean that sets label to strong.
|
||||
* @param stylename String style of text defined in style sheet.
|
||||
*/
|
||||
public void printHyperLink(String link, String where,
|
||||
String label, boolean strong,
|
||||
String stylename) {
|
||||
print(getHyperLinkString(link, where, label, strong, stylename, "", ""));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return Html Hyper Link string.
|
||||
*
|
||||
@ -268,15 +226,6 @@ public abstract class HtmlDocWriter extends HtmlWriter {
|
||||
return getHyperLinkString(link, "", label, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Print the name of the package, this class is in.
|
||||
*
|
||||
* @param cd ClassDoc.
|
||||
*/
|
||||
public void printPkgName(ClassDoc cd) {
|
||||
print(getPkgName(cd));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name of the package, this class is in.
|
||||
*
|
||||
@ -291,27 +240,6 @@ public abstract class HtmlDocWriter extends HtmlWriter {
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Keep track of member details list. Print the definition list start tag
|
||||
* if it is not printed yet.
|
||||
*/
|
||||
public void printMemberDetailsListStartTag () {
|
||||
if (!getMemberDetailsListPrinted()) {
|
||||
dl();
|
||||
memberDetailsListPrinted = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Print the definition list end tag if the list start tag was printed.
|
||||
*/
|
||||
public void printMemberDetailsListEndTag () {
|
||||
if (getMemberDetailsListPrinted()) {
|
||||
dlEnd();
|
||||
memberDetailsListPrinted = false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getMemberDetailsListPrinted() {
|
||||
return memberDetailsListPrinted;
|
||||
}
|
||||
@ -345,7 +273,7 @@ public abstract class HtmlDocWriter extends HtmlWriter {
|
||||
head, frameset);
|
||||
Content htmlDocument = new HtmlDocument(htmlDocType,
|
||||
htmlComment, htmlTree);
|
||||
htmlDocument.write(this, true);
|
||||
write(htmlDocument);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -362,36 +290,6 @@ public abstract class HtmlDocWriter extends HtmlWriter {
|
||||
return space;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print the closing </body> and </html> tags.
|
||||
*/
|
||||
public void printBodyHtmlEnd() {
|
||||
println();
|
||||
bodyEnd();
|
||||
htmlEnd();
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls {@link #printBodyHtmlEnd()} method.
|
||||
*/
|
||||
public void printFooter() {
|
||||
printBodyHtmlEnd();
|
||||
}
|
||||
|
||||
/**
|
||||
* Print closing </html> tag.
|
||||
*/
|
||||
public void printFrameFooter() {
|
||||
htmlEnd();
|
||||
}
|
||||
|
||||
/**
|
||||
* Print ten non-breaking spaces("&nbsp;").
|
||||
*/
|
||||
public void printNbsps() {
|
||||
print(" ");
|
||||
}
|
||||
|
||||
protected String getGeneratedByString() {
|
||||
Calendar calendar = new GregorianCalendar(TimeZone.getDefault());
|
||||
Date today = calendar.getTime();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -153,7 +153,7 @@ public interface AnnotationTypeWriter {
|
||||
*
|
||||
* @param contentTree content tree that will be printed as a document
|
||||
*/
|
||||
public void printDocument(Content contentTree) throws IOException ;
|
||||
public void printDocument(Content contentTree) throws IOException;
|
||||
|
||||
/**
|
||||
* Close the writer.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user