AbstractTreeWriterpublic abstract class AbstractTreeWriter extends HtmlStandardWriter Abstract class to print the class hierarchy page for all the Classes. This
is sub-classed by {@link PackageTreeWriter} and {@link TreeWriter} to
generate the Package Tree and global Tree(for all the classes and packages)
pages. |
Fields Summary |
---|
protected final ClassTree | classtreeThe class and interface tree built by using {@link ClassTree} |
Constructors Summary |
---|
protected AbstractTreeWriter(String filename, ClassTree classtree)Constructor initilises classtree variable. This constructor will be used
while generating global tree file "overview-tree.html".
super(filename);
this.classtree = classtree;
| protected AbstractTreeWriter(String path, String filename, ClassTree classtree, PackageDoc pkg)Create appropriate directory for the package and also initilise the
relative path from this generated file to the current or
the destination directory. This constructor will be used while
generating "package tree" file.
super(path, filename, DirectoryManager.getRelativePath(pkg.name()));
this.classtree = classtree;
|
Methods Summary |
---|
protected void | generateLevelInfo(com.sun.javadoc.ClassDoc parent, java.util.List list)Generate each level of the class tree. For each sub-class or
sub-interface indents the next level information.
Recurses itself to generate subclasses info.
To iterate is human, to recurse is divine - L. Peter Deutsch.
if (list.size() > 0) {
ul();
for (int i = 0; i < list.size(); i++) {
ClassDoc local = (ClassDoc)list.get(i);
printPartialInfo(local);
printExtendsImplements(parent, local);
generateLevelInfo(local, classtree.subs(local)); // Recurse
}
ulEnd();
}
| protected void | generateTree(java.util.List list, java.lang.String heading)Generate the heading for the tree depending upon tree type if it's a
Class Tree or Interface tree and also print the tree.
if (list.size() > 0) {
ClassDoc cd = (ClassDoc)list.get(0);
printTreeHeading(heading);
generateLevelInfo(cd.isClass()? (ClassDoc)list.get(0): null, list);
}
| protected void | navLinkTree()Highlight "Tree" word in the navigation bar, since this is the tree page.
navCellRevStart();
fontStyle("NavBarFont1Rev");
boldText("doclet.Tree");
fontEnd();
navCellEnd();
| protected void | printExtendsImplements(com.sun.javadoc.ClassDoc parent, com.sun.javadoc.ClassDoc cd)Print the information regarding the classes which this class extends or
implements.
ClassDoc[] interfaces = cd.interfaces();
if (interfaces.length > (cd.isInterface()? 1 : 0)) {
Arrays.sort(interfaces);
if (cd.isInterface()) {
print(" (" + getText("doclet.also") + " extends ");
} else {
print(" (implements ");
}
boolean printcomma = false;
for (int i = 0; i < interfaces.length; i++) {
if (parent != interfaces[i]) {
if (printcomma) {
print(", ");
}
printPreQualifiedClassLink(interfaces[i]);
printcomma = true;
}
}
println(")");
}
| protected void | printPartialInfo(com.sun.javadoc.ClassDoc cd)Print information about the class kind, if it's a "class" or "interface".
boolean isInterface = cd.isInterface();
li("circle");
print(isInterface? "interface " : "class ");
printPreQualifiedBoldClassLink(cd);
| protected void | printTreeHeading(java.lang.String heading)Print the heading for the tree.
h2();
println(getText(heading));
h2End();
|
|