1133 |
output.close(); |
output.close(); |
1134 |
} |
} |
1135 |
|
|
1136 |
|
private void printAboutPage() |
1137 |
|
throws IOException |
1138 |
|
{ |
1139 |
|
HtmlPage output = new HtmlPage(new File(getTargetDirectory(), |
1140 |
|
"about" + filenameExtension), |
1141 |
|
".", |
1142 |
|
getOutputDocEncoding()); |
1143 |
|
output.beginPage("About", getOutputCharset()); |
1144 |
|
output.beginBody(); |
1145 |
|
|
1146 |
|
output.beginDiv(CssClass.ABOUT_GENERATOR); |
1147 |
|
output.print("Generated by "); |
1148 |
|
output.print("GNU Gjdoc"); |
1149 |
|
output.print(" Standard Doclet "); |
1150 |
|
output.print(getDocletVersion()); |
1151 |
|
output.endDiv(CssClass.ABOUT_GENERATOR); |
1152 |
|
|
1153 |
|
output.endBody(); |
1154 |
|
output.endPage(); |
1155 |
|
output.close(); |
1156 |
|
} |
1157 |
|
|
1158 |
private void printOverviewPage() |
private void printOverviewPage() |
1159 |
throws IOException |
throws IOException |
1160 |
{ |
{ |
1352 |
if (it.hasPrevious()) { |
if (it.hasPrevious()) { |
1353 |
ClassDoc cd = (ClassDoc)it.previous(); |
ClassDoc cd = (ClassDoc)it.previous(); |
1354 |
output.beginElement("li"); |
output.beginElement("li"); |
1355 |
|
output.beginElement("code"); |
1356 |
if (it.hasPrevious()) { |
if (it.hasPrevious()) { |
1357 |
printType(output, cd, true); |
printType(output, cd, true); |
1358 |
} |
} |
1359 |
else { |
else { |
1360 |
output.print(possiblyQualifiedName(cd)); |
output.print(cd.qualifiedName()); |
1361 |
} |
} |
1362 |
|
output.endElement("code"); |
1363 |
output.endElement("li"); |
output.endElement("li"); |
1364 |
|
|
1365 |
if (it.hasPrevious()) { |
if (it.hasPrevious()) { |
1579 |
printTaglets(output, classDoc.tags(), new HtmlTagletContext(classDoc, output)); |
printTaglets(output, classDoc.tags(), new HtmlTagletContext(classDoc, output)); |
1580 |
} |
} |
1581 |
|
|
1582 |
printProgramElementDocs(output, classDoc.fields(), |
printProgramElementDocs(output, getSortedInnerClasses(classDoc), |
1583 |
|
"Nested Class Summary"); |
1584 |
|
printProgramElementDocs(output, getSortedFields(classDoc), |
1585 |
"Field Summary"); |
"Field Summary"); |
1586 |
printProgramElementDocs(output, classDoc.constructors(), |
printProgramElementDocs(output, getSortedConstructors(classDoc), |
1587 |
"Constructor Summary"); |
"Constructor Summary"); |
1588 |
printProgramElementDocs(output, classDoc.methods(), |
printProgramElementDocs(output, getSortedMethods(classDoc), |
1589 |
"Method Summary"); |
"Method Summary"); |
1590 |
|
|
1591 |
ClassDoc superClassDoc = classDoc.superclass(); |
if (classDoc.isInterface()) { |
1592 |
while (null != superClassDoc) { |
InterfaceRelation relation |
1593 |
printInheritedMembers(output, superClassDoc.methods(), |
= (InterfaceRelation)getInterfaceRelations().get(classDoc); |
1594 |
"Methods inherited from " + superClassDoc.qualifiedName()); |
Iterator it = relation.superInterfaces.iterator(); |
1595 |
superClassDoc = superClassDoc.superclass(); |
while (it.hasNext()) { |
1596 |
|
ClassDoc superClassDoc = (ClassDoc)it.next(); |
1597 |
|
printInheritedMembers(output, getSortedMethods(superClassDoc), |
1598 |
|
"Methods inherited from " + superClassDoc.qualifiedName()); |
1599 |
|
} |
1600 |
|
} |
1601 |
|
else { |
1602 |
|
ClassDoc superClassDoc = classDoc.superclass(); |
1603 |
|
while (null != superClassDoc) { |
1604 |
|
printInheritedMembers(output, getSortedMethods(superClassDoc), |
1605 |
|
"Methods inherited from " + superClassDoc.qualifiedName()); |
1606 |
|
superClassDoc = superClassDoc.superclass(); |
1607 |
|
} |
1608 |
} |
} |
1609 |
|
|
1610 |
printMemberDetails(output, classDoc.fields(), |
printMemberDetails(output, classDoc.fields(), |
1625 |
ProgramElementDoc[] memberDocs, String header) |
ProgramElementDoc[] memberDocs, String header) |
1626 |
{ |
{ |
1627 |
if (memberDocs.length > 0) { |
if (memberDocs.length > 0) { |
1628 |
|
|
1629 |
output.beginDiv(CssClass.TABLE_CONTAINER); |
output.beginDiv(CssClass.TABLE_CONTAINER); |
1630 |
output.beginTable(CssClass.CLASS_SUMMARY, new String[] { "border", "width" }, new String[] { "1", "100%" }); |
output.beginTable(CssClass.CLASS_SUMMARY, new String[] { "border", "width" }, new String[] { "1", "100%" }); |
1631 |
output.rowDiv(CssClass.TABLE_HEADER, header); |
output.rowDiv(CssClass.TABLE_HEADER, header); |
1659 |
if (methods[j].name().equals(methodDoc.name()) |
if (methods[j].name().equals(methodDoc.name()) |
1660 |
&& methods[j].signature().equals(methodDoc.signature())) { |
&& methods[j].signature().equals(methodDoc.signature())) { |
1661 |
specifyingInterfaces.add(methods[j]); |
specifyingInterfaces.add(methods[j]); |
1662 |
|
break; |
1663 |
} |
} |
1664 |
} |
} |
1665 |
collectSpecifiedByRecursive(specifyingInterfaces, |
collectSpecifiedByRecursive(specifyingInterfaces, |
1718 |
output.endDiv(CssClass.MEMBER_DETAIL_SYNOPSIS); |
output.endDiv(CssClass.MEMBER_DETAIL_SYNOPSIS); |
1719 |
|
|
1720 |
output.beginDiv(CssClass.MEMBER_DETAIL_BODY); |
output.beginDiv(CssClass.MEMBER_DETAIL_BODY); |
1721 |
|
|
1722 |
|
Tag[] deprecatedTags = memberDoc.tags("deprecated"); |
1723 |
|
if (deprecatedTags.length > 0) { |
1724 |
|
output.beginDiv(CssClass.DEPRECATED_INLINE); |
1725 |
|
output.beginSpan(CssClass.DEPRECATED_HEADER); |
1726 |
|
output.print("Deprecated. "); |
1727 |
|
output.endSpan(CssClass.DEPRECATED_HEADER); |
1728 |
|
output.beginSpan(CssClass.DEPRECATED_BODY); |
1729 |
|
} |
1730 |
|
for (int j=0; j<deprecatedTags.length; ++j) { |
1731 |
|
printTags(output, memberDoc, deprecatedTags[j].inlineTags(), true); |
1732 |
|
} |
1733 |
|
if (deprecatedTags.length > 0) { |
1734 |
|
output.endSpan(CssClass.DEPRECATED_BODY); |
1735 |
|
output.beginDiv(CssClass.DEPRECATED_INLINE); |
1736 |
|
} |
1737 |
|
|
1738 |
output.beginDiv(CssClass.MEMBER_DETAIL_DESCRIPTION); |
output.beginDiv(CssClass.MEMBER_DETAIL_DESCRIPTION); |
1739 |
printTags(output, memberDoc, memberDoc.inlineTags(), false); |
printTags(output, memberDoc, memberDoc.inlineTags(), false); |
1740 |
output.endDiv(CssClass.MEMBER_DETAIL_DESCRIPTION); |
output.endDiv(CssClass.MEMBER_DETAIL_DESCRIPTION); |
1743 |
|
|
1744 |
if (memberDoc.isMethod()) { |
if (memberDoc.isMethod()) { |
1745 |
Set specifyingInterfaces = new LinkedHashSet(); |
Set specifyingInterfaces = new LinkedHashSet(); |
1746 |
for (ClassDoc cd = memberDoc.containingClass(); |
if (memberDoc.containingClass().isInterface()) { |
|
null != cd; cd = cd.superclass()) { |
|
1747 |
collectSpecifiedByRecursive(specifyingInterfaces, |
collectSpecifiedByRecursive(specifyingInterfaces, |
1748 |
cd, |
memberDoc.containingClass(), |
1749 |
(MethodDoc)memberDoc); |
(MethodDoc)memberDoc); |
1750 |
} |
} |
1751 |
|
else { |
1752 |
|
for (ClassDoc cd = memberDoc.containingClass(); |
1753 |
|
null != cd; cd = cd.superclass()) { |
1754 |
|
collectSpecifiedByRecursive(specifyingInterfaces, |
1755 |
|
cd, |
1756 |
|
(MethodDoc)memberDoc); |
1757 |
|
} |
1758 |
|
} |
1759 |
|
|
1760 |
if (!specifyingInterfaces.isEmpty()) { |
if (!specifyingInterfaces.isEmpty()) { |
1761 |
output.beginDiv(CssClass.MEMBER_DETAIL_SPECIFIED_BY_LIST); |
output.beginDiv(CssClass.MEMBER_DETAIL_SPECIFIED_BY_LIST); |
1967 |
printParameters(output, (ExecutableMemberDoc)memberDoc); |
printParameters(output, (ExecutableMemberDoc)memberDoc); |
1968 |
} |
} |
1969 |
output.endDiv(CssClass.CLASS_SUMMARY_RIGHT_SYNOPSIS); |
output.endDiv(CssClass.CLASS_SUMMARY_RIGHT_SYNOPSIS); |
1970 |
Tag[] firstSentenceTags = memberDoc.firstSentenceTags(); |
Tag[] firstSentenceTags; |
1971 |
|
Tag[] deprecatedTags = memberDoc.tags("deprecated"); |
1972 |
|
if (deprecatedTags.length > 0) { |
1973 |
|
firstSentenceTags = deprecatedTags[0].firstSentenceTags(); |
1974 |
|
} |
1975 |
|
else { |
1976 |
|
firstSentenceTags = memberDoc.firstSentenceTags(); |
1977 |
|
} |
1978 |
|
|
1979 |
if (null != firstSentenceTags && firstSentenceTags.length > 0) { |
if (null != firstSentenceTags && firstSentenceTags.length > 0) { |
1980 |
output.beginDiv(CssClass.CLASS_SUMMARY_RIGHT_DESCRIPTION); |
output.beginDiv(CssClass.CLASS_SUMMARY_RIGHT_DESCRIPTION); |
1981 |
|
if (deprecatedTags.length > 0) { |
1982 |
|
output.beginDiv(CssClass.DEPRECATED); |
1983 |
|
output.beginSpan(CssClass.DEPRECATED_HEADER); |
1984 |
|
output.print("Deprecated. "); |
1985 |
|
output.endSpan(CssClass.DEPRECATED_HEADER); |
1986 |
|
output.beginSpan(CssClass.DEPRECATED_BODY); |
1987 |
|
} |
1988 |
printTags(output, memberDoc, firstSentenceTags, true); |
printTags(output, memberDoc, firstSentenceTags, true); |
1989 |
|
if (deprecatedTags.length > 0) { |
1990 |
|
output.endSpan(CssClass.DEPRECATED_BODY); |
1991 |
|
output.beginDiv(CssClass.DEPRECATED); |
1992 |
|
} |
1993 |
output.endDiv(CssClass.CLASS_SUMMARY_RIGHT_DESCRIPTION); |
output.endDiv(CssClass.CLASS_SUMMARY_RIGHT_DESCRIPTION); |
1994 |
} |
} |
1995 |
output.endDiv(CssClass.CLASS_SUMMARY_RIGHT_LIST); |
output.endDiv(CssClass.CLASS_SUMMARY_RIGHT_LIST); |
2182 |
printAllClassesMenuPage(); |
printAllClassesMenuPage(); |
2183 |
printOverviewPage(); |
printOverviewPage(); |
2184 |
printPackagesListFile(); |
printPackagesListFile(); |
2185 |
|
printAboutPage(); |
2186 |
if (!optionNoTree.getValue()) { |
if (!optionNoTree.getValue()) { |
2187 |
printNotice("Writing full tree..."); |
printNotice("Writing full tree..."); |
2188 |
printFullTreePage(); |
printFullTreePage(); |
2548 |
result.append(repairer.getWellformedHTML(tag.text())); |
result.append(repairer.getWellformedHTML(tag.text())); |
2549 |
} |
} |
2550 |
else if ("@link".equals(tag.name())) { |
else if ("@link".equals(tag.name())) { |
2551 |
SeeTag seeTag = (SeeTag)tag; |
result.append(renderSeeTag((SeeTag)tag, context)); |
|
String href = null; |
|
|
MemberDoc referencedMember = seeTag.referencedMember(); |
|
|
if (null != seeTag.referencedClass()) { |
|
|
href = getClassDocURL(((HtmlTagletContext)context).getOutput(), seeTag.referencedClass()); |
|
|
if (null != referencedMember) { |
|
|
href += '#' + referencedMember.name(); |
|
|
if (referencedMember.isMethod() || referencedMember.isConstructor()) { |
|
|
href += ((ExecutableMemberDoc)referencedMember).signature(); |
|
|
} |
|
|
} |
|
|
else if (null != seeTag.referencedMemberName()) { |
|
|
href = null; |
|
|
} |
|
|
} |
|
|
else if (null != referencedMember) { |
|
|
href = '#' + referencedMember.name(); |
|
|
if (referencedMember.isMethod() || referencedMember.isConstructor()) { |
|
|
href += ((ExecutableMemberDoc)referencedMember).signature(); |
|
|
} |
|
|
} |
|
|
|
|
|
String label = tag.text(); |
|
|
if (label.startsWith("#")) { |
|
|
label = label.substring(1); |
|
|
} |
|
|
else { |
|
|
label = label.replace('#', '.'); |
|
|
} |
|
|
|
|
|
if (null != href) { |
|
|
result.append("<a href=\""); |
|
|
result.append(href); |
|
|
result.append("\">"); |
|
|
result.append(label); |
|
|
result.append("</a>"); |
|
|
} |
|
|
else { |
|
|
result.append(label); |
|
|
} |
|
2552 |
} |
} |
2553 |
else if ("@docRoot".equals(tag.name())) { |
else if ("@docRoot".equals(tag.name())) { |
2554 |
result.append(((HtmlTagletContext)context).getOutput().getPathToRoot()); |
result.append(((HtmlTagletContext)context).getOutput().getPathToRoot()); |
2569 |
result.append(repairer.terminateText()); |
result.append(repairer.terminateText()); |
2570 |
return result.toString(); |
return result.toString(); |
2571 |
} |
} |
2572 |
|
|
2573 |
|
public String renderSeeTag(SeeTag seeTag, TagletContext context) |
2574 |
|
{ |
2575 |
|
StringBuffer result = new StringBuffer(); |
2576 |
|
|
2577 |
|
String href = null; |
2578 |
|
String label = null; |
2579 |
|
MemberDoc referencedMember = seeTag.referencedMember(); |
2580 |
|
if (null != seeTag.referencedClass()) { |
2581 |
|
href = getClassDocURL(((HtmlTagletContext)context).getOutput(), seeTag.referencedClass()); |
2582 |
|
|
2583 |
|
Doc doc = context.getDoc(); |
2584 |
|
ClassDoc classDoc = null; |
2585 |
|
if (doc.isClass() || doc.isInterface()) { |
2586 |
|
classDoc = (ClassDoc)doc; |
2587 |
|
} |
2588 |
|
else if (doc.isField() || doc.isMethod() || doc.isConstructor()) { |
2589 |
|
classDoc = ((MemberDoc)doc).containingClass(); |
2590 |
|
} |
2591 |
|
|
2592 |
|
if (null == referencedMember || seeTag.referencedClass() != classDoc) { |
2593 |
|
|
2594 |
|
if (seeTag.referencedClass().name().equals("SecurityManager")) { |
2595 |
|
System.err.println("context.getDoc()="+ context.getDoc()); |
2596 |
|
} |
2597 |
|
|
2598 |
|
if (!seeTag.referencedClass().isIncluded()) { |
2599 |
|
label = possiblyQualifiedName(seeTag.referencedClass()); |
2600 |
|
} |
2601 |
|
else { |
2602 |
|
label = seeTag.referencedClass().typeName(); |
2603 |
|
} |
2604 |
|
if (null != referencedMember) { |
2605 |
|
label += '.'; |
2606 |
|
} |
2607 |
|
} |
2608 |
|
else { |
2609 |
|
label = ""; |
2610 |
|
} |
2611 |
|
|
2612 |
|
if (null != referencedMember) { |
2613 |
|
href += '#' + referencedMember.name(); |
2614 |
|
label += referencedMember.name(); |
2615 |
|
if (referencedMember.isMethod() || referencedMember.isConstructor()) { |
2616 |
|
href += ((ExecutableMemberDoc)referencedMember).signature(); |
2617 |
|
label += ((ExecutableMemberDoc)referencedMember).flatSignature(); |
2618 |
|
} |
2619 |
|
} |
2620 |
|
else if (null != seeTag.referencedMemberName()) { |
2621 |
|
href = null; |
2622 |
|
} |
2623 |
|
} |
2624 |
|
|
2625 |
|
if (null != seeTag.label() |
2626 |
|
&& seeTag.label().length() > 0) { |
2627 |
|
label = seeTag.label(); |
2628 |
|
} |
2629 |
|
|
2630 |
|
if (null == label) { |
2631 |
|
label = seeTag.text(); |
2632 |
|
if (label.startsWith("#")) { |
2633 |
|
label = label.substring(1); |
2634 |
|
} |
2635 |
|
else { |
2636 |
|
label = label.replace('#', '.'); |
2637 |
|
} |
2638 |
|
label.trim(); |
2639 |
|
} |
2640 |
|
|
2641 |
|
if (null != href) { |
2642 |
|
result.append("<a href=\""); |
2643 |
|
result.append(href); |
2644 |
|
result.append("\">"); |
2645 |
|
result.append("<code>"); |
2646 |
|
result.append(label); |
2647 |
|
result.append("</code>"); |
2648 |
|
result.append("</a>"); |
2649 |
|
} |
2650 |
|
else { |
2651 |
|
result.append("<code>"); |
2652 |
|
result.append(label); |
2653 |
|
result.append("</code>"); |
2654 |
|
} |
2655 |
|
|
2656 |
|
return result.toString(); |
2657 |
|
} |
2658 |
|
|
2659 |
|
protected String renderTag(String tagName, Tag[] tags, TagletContext context) |
2660 |
|
{ |
2661 |
|
if (tags.length > 0 && "see".equals(tagName)) { |
2662 |
|
|
2663 |
|
StringBuffer result = new StringBuffer(); |
2664 |
|
result.append("<dl class=\"tag list\">"); |
2665 |
|
result.append("<dt class=\"tag section header\"><b>"); |
2666 |
|
result.append("See Also:"); |
2667 |
|
result.append("</b></dt>"); |
2668 |
|
|
2669 |
|
Doc doc = context.getDoc(); |
2670 |
|
boolean oneLine = true; |
2671 |
|
|
2672 |
|
if (oneLine) { |
2673 |
|
result.append("<dd>"); |
2674 |
|
} |
2675 |
|
|
2676 |
|
for (int i = 0; i < tags.length; ++i) { |
2677 |
|
if (oneLine) { |
2678 |
|
if (i > 0) { |
2679 |
|
result.append(", "); |
2680 |
|
} |
2681 |
|
} |
2682 |
|
else { |
2683 |
|
result.append("<dd>"); |
2684 |
|
} |
2685 |
|
result.append(renderSeeTag((SeeTag)tags[i], context)); |
2686 |
|
if (!oneLine) { |
2687 |
|
result.append("</dd>"); |
2688 |
|
} |
2689 |
|
} |
2690 |
|
if (oneLine) { |
2691 |
|
result.append("<dd>"); |
2692 |
|
} |
2693 |
|
result.append("</dl>"); |
2694 |
|
return result.toString(); |
2695 |
|
} |
2696 |
|
else { |
2697 |
|
return ""; |
2698 |
|
} |
2699 |
|
} |
2700 |
} |
} |