Fri, 04 Oct 2013 13:32:30 -0700
8008164: Invisible table captions in javadoc-generated html
Reviewed-by: jjg
1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
26 package com.sun.tools.doclets.formats.html;
28 import java.util.*;
30 import com.sun.javadoc.*;
31 import com.sun.tools.javac.jvm.Profile;
32 import com.sun.tools.doclets.formats.html.markup.*;
33 import com.sun.tools.doclets.internal.toolkit.*;
34 import com.sun.tools.doclets.internal.toolkit.builders.*;
35 import com.sun.tools.doclets.internal.toolkit.taglets.*;
36 import com.sun.tools.doclets.internal.toolkit.util.*;
37 import java.io.IOException;
39 /**
40 * Generate the Class Information Page.
41 *
42 * <p><b>This is NOT part of any supported API.
43 * If you write code that depends on this, you do so at your own risk.
44 * This code and its internal interfaces are subject to change or
45 * deletion without notice.</b>
46 *
47 * @see com.sun.javadoc.ClassDoc
48 * @see java.util.Collections
49 * @see java.util.List
50 * @see java.util.ArrayList
51 * @see java.util.HashMap
52 *
53 * @author Atul M Dambalkar
54 * @author Robert Field
55 * @author Bhavesh Patel (Modified)
56 */
57 public class ClassWriterImpl extends SubWriterHolderWriter
58 implements ClassWriter {
60 protected final ClassDoc classDoc;
62 protected final ClassTree classtree;
64 protected final ClassDoc prev;
66 protected final ClassDoc next;
68 /**
69 * @param configuration the configuration data for the doclet
70 * @param classDoc the class being documented.
71 * @param prevClass the previous class that was documented.
72 * @param nextClass the next class being documented.
73 * @param classTree the class tree for the given class.
74 */
75 public ClassWriterImpl (ConfigurationImpl configuration, ClassDoc classDoc,
76 ClassDoc prevClass, ClassDoc nextClass, ClassTree classTree)
77 throws IOException {
78 super(configuration, DocPath.forClass(classDoc));
79 this.classDoc = classDoc;
80 configuration.currentcd = classDoc;
81 this.classtree = classTree;
82 this.prev = prevClass;
83 this.next = nextClass;
84 }
86 /**
87 * Get this package link.
88 *
89 * @return a content tree for the package link
90 */
91 protected Content getNavLinkPackage() {
92 Content linkContent = getHyperLink(DocPaths.PACKAGE_SUMMARY,
93 packageLabel);
94 Content li = HtmlTree.LI(linkContent);
95 return li;
96 }
98 /**
99 * Get the class link.
100 *
101 * @return a content tree for the class link
102 */
103 protected Content getNavLinkClass() {
104 Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, classLabel);
105 return li;
106 }
108 /**
109 * Get the class use link.
110 *
111 * @return a content tree for the class use link
112 */
113 protected Content getNavLinkClassUse() {
114 Content linkContent = getHyperLink(DocPaths.CLASS_USE.resolve(filename), useLabel);
115 Content li = HtmlTree.LI(linkContent);
116 return li;
117 }
119 /**
120 * Get link to previous class.
121 *
122 * @return a content tree for the previous class link
123 */
124 public Content getNavLinkPrevious() {
125 Content li;
126 if (prev != null) {
127 Content prevLink = getLink(new LinkInfoImpl(configuration,
128 LinkInfoImpl.Kind.CLASS, prev)
129 .label(prevclassLabel).strong(true));
130 li = HtmlTree.LI(prevLink);
131 }
132 else
133 li = HtmlTree.LI(prevclassLabel);
134 return li;
135 }
137 /**
138 * Get link to next class.
139 *
140 * @return a content tree for the next class link
141 */
142 public Content getNavLinkNext() {
143 Content li;
144 if (next != null) {
145 Content nextLink = getLink(new LinkInfoImpl(configuration,
146 LinkInfoImpl.Kind.CLASS, next)
147 .label(nextclassLabel).strong(true));
148 li = HtmlTree.LI(nextLink);
149 }
150 else
151 li = HtmlTree.LI(nextclassLabel);
152 return li;
153 }
155 /**
156 * {@inheritDoc}
157 */
158 public Content getHeader(String header) {
159 String pkgname = (classDoc.containingPackage() != null)?
160 classDoc.containingPackage().name(): "";
161 String clname = classDoc.name();
162 Content bodyTree = getBody(true, getWindowTitle(clname));
163 addTop(bodyTree);
164 addNavLinks(true, bodyTree);
165 bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA);
166 HtmlTree div = new HtmlTree(HtmlTag.DIV);
167 div.addStyle(HtmlStyle.header);
168 if (configuration.showProfiles) {
169 String sep = "";
170 int profile = configuration.profiles.getProfile(getTypeNameForProfile(classDoc));
171 if (profile > 0) {
172 Content profNameContent = new StringContent();
173 for (int i = profile; i < configuration.profiles.getProfileCount(); i++) {
174 profNameContent.addContent(sep);
175 profNameContent.addContent(Profile.lookup(i).name);
176 sep = ", ";
177 }
178 Content profileNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, profNameContent);
179 div.addContent(profileNameDiv);
180 }
181 }
182 if (pkgname.length() > 0) {
183 Content pkgNameContent = new StringContent(pkgname);
184 Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent);
185 div.addContent(pkgNameDiv);
186 }
187 LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
188 LinkInfoImpl.Kind.CLASS_HEADER, classDoc);
189 //Let's not link to ourselves in the header.
190 linkInfo.linkToSelf = false;
191 Content headerContent = new StringContent(header);
192 Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true,
193 HtmlStyle.title, headerContent);
194 heading.addContent(getTypeParameterLinks(linkInfo));
195 div.addContent(heading);
196 bodyTree.addContent(div);
197 return bodyTree;
198 }
200 /**
201 * {@inheritDoc}
202 */
203 public Content getClassContentHeader() {
204 return getContentHeader();
205 }
207 /**
208 * {@inheritDoc}
209 */
210 public void addFooter(Content contentTree) {
211 contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA);
212 addNavLinks(false, contentTree);
213 addBottom(contentTree);
214 }
216 /**
217 * {@inheritDoc}
218 */
219 public void printDocument(Content contentTree) throws IOException {
220 printHtmlDocument(configuration.metakeywords.getMetaKeywords(classDoc),
221 true, contentTree);
222 }
224 /**
225 * {@inheritDoc}
226 */
227 public Content getClassInfoTreeHeader() {
228 return getMemberTreeHeader();
229 }
231 /**
232 * {@inheritDoc}
233 */
234 public Content getClassInfo(Content classInfoTree) {
235 return getMemberTree(HtmlStyle.description, classInfoTree);
236 }
238 /**
239 * {@inheritDoc}
240 */
241 public void addClassSignature(String modifiers, Content classInfoTree) {
242 boolean isInterface = classDoc.isInterface();
243 classInfoTree.addContent(new HtmlTree(HtmlTag.BR));
244 Content pre = new HtmlTree(HtmlTag.PRE);
245 addAnnotationInfo(classDoc, pre);
246 pre.addContent(modifiers);
247 LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
248 LinkInfoImpl.Kind.CLASS_SIGNATURE, classDoc);
249 //Let's not link to ourselves in the signature.
250 linkInfo.linkToSelf = false;
251 Content className = new StringContent(classDoc.name());
252 Content parameterLinks = getTypeParameterLinks(linkInfo);
253 if (configuration.linksource) {
254 addSrcLink(classDoc, className, pre);
255 pre.addContent(parameterLinks);
256 } else {
257 Content span = HtmlTree.SPAN(HtmlStyle.strong, className);
258 span.addContent(parameterLinks);
259 pre.addContent(span);
260 }
261 if (!isInterface) {
262 Type superclass = Util.getFirstVisibleSuperClass(classDoc,
263 configuration);
264 if (superclass != null) {
265 pre.addContent(DocletConstants.NL);
266 pre.addContent("extends ");
267 Content link = getLink(new LinkInfoImpl(configuration,
268 LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME,
269 superclass));
270 pre.addContent(link);
271 }
272 }
273 Type[] implIntfacs = classDoc.interfaceTypes();
274 if (implIntfacs != null && implIntfacs.length > 0) {
275 int counter = 0;
276 for (int i = 0; i < implIntfacs.length; i++) {
277 ClassDoc classDoc = implIntfacs[i].asClassDoc();
278 if (! (classDoc.isPublic() ||
279 Util.isLinkable(classDoc, configuration))) {
280 continue;
281 }
282 if (counter == 0) {
283 pre.addContent(DocletConstants.NL);
284 pre.addContent(isInterface? "extends " : "implements ");
285 } else {
286 pre.addContent(", ");
287 }
288 Content link = getLink(new LinkInfoImpl(configuration,
289 LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME,
290 implIntfacs[i]));
291 pre.addContent(link);
292 counter++;
293 }
294 }
295 classInfoTree.addContent(pre);
296 }
298 /**
299 * {@inheritDoc}
300 */
301 public void addClassDescription(Content classInfoTree) {
302 if(!configuration.nocomment) {
303 // generate documentation for the class.
304 if (classDoc.inlineTags().length > 0) {
305 addInlineComment(classDoc, classInfoTree);
306 }
307 }
308 }
310 /**
311 * {@inheritDoc}
312 */
313 public void addClassTagInfo(Content classInfoTree) {
314 if(!configuration.nocomment) {
315 // Print Information about all the tags here
316 addTagsInfo(classDoc, classInfoTree);
317 }
318 }
320 /**
321 * Get the class hierarchy tree for the given class.
322 *
323 * @param type the class to print the hierarchy for
324 * @return a content tree for class inheritence
325 */
326 private Content getClassInheritenceTree(Type type) {
327 Type sup;
328 HtmlTree classTreeUl = new HtmlTree(HtmlTag.UL);
329 classTreeUl.addStyle(HtmlStyle.inheritance);
330 Content liTree = null;
331 do {
332 sup = Util.getFirstVisibleSuperClass(
333 type instanceof ClassDoc ? (ClassDoc) type : type.asClassDoc(),
334 configuration);
335 if (sup != null) {
336 HtmlTree ul = new HtmlTree(HtmlTag.UL);
337 ul.addStyle(HtmlStyle.inheritance);
338 ul.addContent(getTreeForClassHelper(type));
339 if (liTree != null)
340 ul.addContent(liTree);
341 Content li = HtmlTree.LI(ul);
342 liTree = li;
343 type = sup;
344 }
345 else
346 classTreeUl.addContent(getTreeForClassHelper(type));
347 }
348 while (sup != null);
349 if (liTree != null)
350 classTreeUl.addContent(liTree);
351 return classTreeUl;
352 }
354 /**
355 * Get the class helper tree for the given class.
356 *
357 * @param type the class to print the helper for
358 * @return a content tree for class helper
359 */
360 private Content getTreeForClassHelper(Type type) {
361 Content li = new HtmlTree(HtmlTag.LI);
362 if (type.equals(classDoc)) {
363 Content typeParameters = getTypeParameterLinks(
364 new LinkInfoImpl(configuration, LinkInfoImpl.Kind.TREE,
365 classDoc));
366 if (configuration.shouldExcludeQualifier(
367 classDoc.containingPackage().name())) {
368 li.addContent(type.asClassDoc().name());
369 li.addContent(typeParameters);
370 } else {
371 li.addContent(type.asClassDoc().qualifiedName());
372 li.addContent(typeParameters);
373 }
374 } else {
375 Content link = getLink(new LinkInfoImpl(configuration,
376 LinkInfoImpl.Kind.CLASS_TREE_PARENT, type)
377 .label(configuration.getClassName(type.asClassDoc())));
378 li.addContent(link);
379 }
380 return li;
381 }
383 /**
384 * {@inheritDoc}
385 */
386 public void addClassTree(Content classContentTree) {
387 if (!classDoc.isClass()) {
388 return;
389 }
390 classContentTree.addContent(getClassInheritenceTree(classDoc));
391 }
393 /**
394 * {@inheritDoc}
395 */
396 public void addTypeParamInfo(Content classInfoTree) {
397 if (classDoc.typeParamTags().length > 0) {
398 Content typeParam = (new ParamTaglet()).getTagletOutput(classDoc,
399 getTagletWriterInstance(false));
400 Content dl = HtmlTree.DL(typeParam);
401 classInfoTree.addContent(dl);
402 }
403 }
405 /**
406 * {@inheritDoc}
407 */
408 public void addSubClassInfo(Content classInfoTree) {
409 if (classDoc.isClass()) {
410 if (classDoc.qualifiedName().equals("java.lang.Object") ||
411 classDoc.qualifiedName().equals("org.omg.CORBA.Object")) {
412 return; // Don't generate the list, too huge
413 }
414 List<ClassDoc> subclasses = classtree.subs(classDoc, false);
415 if (subclasses.size() > 0) {
416 Content label = getResource(
417 "doclet.Subclasses");
418 Content dt = HtmlTree.DT(label);
419 Content dl = HtmlTree.DL(dt);
420 dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUBCLASSES,
421 subclasses));
422 classInfoTree.addContent(dl);
423 }
424 }
425 }
427 /**
428 * {@inheritDoc}
429 */
430 public void addSubInterfacesInfo(Content classInfoTree) {
431 if (classDoc.isInterface()) {
432 List<ClassDoc> subInterfaces = classtree.allSubs(classDoc, false);
433 if (subInterfaces.size() > 0) {
434 Content label = getResource(
435 "doclet.Subinterfaces");
436 Content dt = HtmlTree.DT(label);
437 Content dl = HtmlTree.DL(dt);
438 dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUBINTERFACES,
439 subInterfaces));
440 classInfoTree.addContent(dl);
441 }
442 }
443 }
445 /**
446 * {@inheritDoc}
447 */
448 public void addInterfaceUsageInfo (Content classInfoTree) {
449 if (! classDoc.isInterface()) {
450 return;
451 }
452 if (classDoc.qualifiedName().equals("java.lang.Cloneable") ||
453 classDoc.qualifiedName().equals("java.io.Serializable")) {
454 return; // Don't generate the list, too big
455 }
456 List<ClassDoc> implcl = classtree.implementingclasses(classDoc);
457 if (implcl.size() > 0) {
458 Content label = getResource(
459 "doclet.Implementing_Classes");
460 Content dt = HtmlTree.DT(label);
461 Content dl = HtmlTree.DL(dt);
462 dl.addContent(getClassLinks(LinkInfoImpl.Kind.IMPLEMENTED_CLASSES,
463 implcl));
464 classInfoTree.addContent(dl);
465 }
466 }
468 /**
469 * {@inheritDoc}
470 */
471 public void addImplementedInterfacesInfo(Content classInfoTree) {
472 //NOTE: we really should be using ClassDoc.interfaceTypes() here, but
473 // it doesn't walk up the tree like we want it to.
474 List<Type> interfaceArray = Util.getAllInterfaces(classDoc, configuration);
475 if (classDoc.isClass() && interfaceArray.size() > 0) {
476 Content label = getResource(
477 "doclet.All_Implemented_Interfaces");
478 Content dt = HtmlTree.DT(label);
479 Content dl = HtmlTree.DL(dt);
480 dl.addContent(getClassLinks(LinkInfoImpl.Kind.IMPLEMENTED_INTERFACES,
481 interfaceArray));
482 classInfoTree.addContent(dl);
483 }
484 }
486 /**
487 * {@inheritDoc}
488 */
489 public void addSuperInterfacesInfo(Content classInfoTree) {
490 //NOTE: we really should be using ClassDoc.interfaceTypes() here, but
491 // it doesn't walk up the tree like we want it to.
492 List<Type> interfaceArray = Util.getAllInterfaces(classDoc, configuration);
493 if (classDoc.isInterface() && interfaceArray.size() > 0) {
494 Content label = getResource(
495 "doclet.All_Superinterfaces");
496 Content dt = HtmlTree.DT(label);
497 Content dl = HtmlTree.DL(dt);
498 dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUPER_INTERFACES,
499 interfaceArray));
500 classInfoTree.addContent(dl);
501 }
502 }
504 /**
505 * {@inheritDoc}
506 */
507 public void addNestedClassInfo(Content classInfoTree) {
508 ClassDoc outerClass = classDoc.containingClass();
509 if (outerClass != null) {
510 Content label;
511 if (outerClass.isInterface()) {
512 label = getResource(
513 "doclet.Enclosing_Interface");
514 } else {
515 label = getResource(
516 "doclet.Enclosing_Class");
517 }
518 Content dt = HtmlTree.DT(label);
519 Content dl = HtmlTree.DL(dt);
520 Content dd = new HtmlTree(HtmlTag.DD);
521 dd.addContent(getLink(new LinkInfoImpl(configuration,
522 LinkInfoImpl.Kind.CLASS, outerClass)));
523 dl.addContent(dd);
524 classInfoTree.addContent(dl);
525 }
526 }
528 /**
529 * {@inheritDoc}
530 */
531 public void addFunctionalInterfaceInfo (Content classInfoTree) {
532 if (classDoc.isFunctionalInterface()) {
533 Content dt = HtmlTree.DT(getResource("doclet.Functional_Interface"));
534 Content dl = HtmlTree.DL(dt);
535 Content dd = new HtmlTree(HtmlTag.DD);
536 dd.addContent(getResource("doclet.Functional_Interface_Message"));
537 dl.addContent(dd);
538 classInfoTree.addContent(dl);
539 }
540 }
542 /**
543 * {@inheritDoc}
544 */
545 public void addClassDeprecationInfo(Content classInfoTree) {
546 Content hr = new HtmlTree(HtmlTag.HR);
547 classInfoTree.addContent(hr);
548 Tag[] deprs = classDoc.tags("deprecated");
549 if (Util.isDeprecated(classDoc)) {
550 Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
551 Content div = HtmlTree.DIV(HtmlStyle.block, strong);
552 if (deprs.length > 0) {
553 Tag[] commentTags = deprs[0].inlineTags();
554 if (commentTags.length > 0) {
555 div.addContent(getSpace());
556 addInlineDeprecatedComment(classDoc, deprs[0], div);
557 }
558 }
559 classInfoTree.addContent(div);
560 }
561 }
563 /**
564 * Get links to the given classes.
565 *
566 * @param context the id of the context where the link will be printed
567 * @param list the list of classes
568 * @return a content tree for the class list
569 */
570 private Content getClassLinks(LinkInfoImpl.Kind context, List<?> list) {
571 Object[] typeList = list.toArray();
572 Content dd = new HtmlTree(HtmlTag.DD);
573 for (int i = 0; i < list.size(); i++) {
574 if (i > 0) {
575 Content separator = new StringContent(", ");
576 dd.addContent(separator);
577 }
578 if (typeList[i] instanceof ClassDoc) {
579 Content link = getLink(
580 new LinkInfoImpl(configuration, context, (ClassDoc)(typeList[i])));
581 dd.addContent(link);
582 } else {
583 Content link = getLink(
584 new LinkInfoImpl(configuration, context, (Type)(typeList[i])));
585 dd.addContent(link);
586 }
587 }
588 return dd;
589 }
591 /**
592 * {@inheritDoc}
593 */
594 protected Content getNavLinkTree() {
595 Content treeLinkContent = getHyperLink(DocPaths.PACKAGE_TREE,
596 treeLabel, "", "");
597 Content li = HtmlTree.LI(treeLinkContent);
598 return li;
599 }
601 /**
602 * Add summary details to the navigation bar.
603 *
604 * @param subDiv the content tree to which the summary detail links will be added
605 */
606 protected void addSummaryDetailLinks(Content subDiv) {
607 try {
608 Content div = HtmlTree.DIV(getNavSummaryLinks());
609 div.addContent(getNavDetailLinks());
610 subDiv.addContent(div);
611 } catch (Exception e) {
612 e.printStackTrace();
613 throw new DocletAbortException(e);
614 }
615 }
617 /**
618 * Get summary links for navigation bar.
619 *
620 * @return the content tree for the navigation summary links
621 */
622 protected Content getNavSummaryLinks() throws Exception {
623 Content li = HtmlTree.LI(summaryLabel);
624 li.addContent(getSpace());
625 Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
626 MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
627 configuration.getBuilderFactory().getMemberSummaryBuilder(this);
628 String[] navLinkLabels = new String[] {
629 "doclet.navNested", "doclet.navEnum", "doclet.navField", "doclet.navConstructor",
630 "doclet.navMethod"
631 };
632 for (int i = 0; i < navLinkLabels.length; i++ ) {
633 Content liNav = new HtmlTree(HtmlTag.LI);
634 if (i == VisibleMemberMap.ENUM_CONSTANTS && ! classDoc.isEnum()) {
635 continue;
636 }
637 if (i == VisibleMemberMap.CONSTRUCTORS && classDoc.isEnum()) {
638 continue;
639 }
640 AbstractMemberWriter writer =
641 ((AbstractMemberWriter) memberSummaryBuilder.
642 getMemberSummaryWriter(i));
643 if (writer == null) {
644 liNav.addContent(getResource(navLinkLabels[i]));
645 } else {
646 writer.addNavSummaryLink(
647 memberSummaryBuilder.members(i),
648 memberSummaryBuilder.getVisibleMemberMap(i), liNav);
649 }
650 if (i < navLinkLabels.length-1) {
651 addNavGap(liNav);
652 }
653 ulNav.addContent(liNav);
654 }
655 return ulNav;
656 }
658 /**
659 * Get detail links for the navigation bar.
660 *
661 * @return the content tree for the detail links
662 */
663 protected Content getNavDetailLinks() throws Exception {
664 Content li = HtmlTree.LI(detailLabel);
665 li.addContent(getSpace());
666 Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
667 MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
668 configuration.getBuilderFactory().getMemberSummaryBuilder(this);
669 String[] navLinkLabels = new String[] {
670 "doclet.navNested", "doclet.navEnum", "doclet.navField", "doclet.navConstructor",
671 "doclet.navMethod"
672 };
673 for (int i = 1; i < navLinkLabels.length; i++ ) {
674 Content liNav = new HtmlTree(HtmlTag.LI);
675 AbstractMemberWriter writer =
676 ((AbstractMemberWriter) memberSummaryBuilder.
677 getMemberSummaryWriter(i));
678 if (i == VisibleMemberMap.ENUM_CONSTANTS && ! classDoc.isEnum()) {
679 continue;
680 }
681 if (i == VisibleMemberMap.CONSTRUCTORS && classDoc.isEnum()) {
682 continue;
683 }
684 if (writer == null) {
685 liNav.addContent(getResource(navLinkLabels[i]));
686 } else {
687 writer.addNavDetailLink(memberSummaryBuilder.members(i), liNav);
688 }
689 if (i < navLinkLabels.length - 1) {
690 addNavGap(liNav);
691 }
692 ulNav.addContent(liNav);
693 }
694 return ulNav;
695 }
697 /**
698 * Add gap between navigation bar elements.
699 *
700 * @param liNav the content tree to which the gap will be added
701 */
702 protected void addNavGap(Content liNav) {
703 liNav.addContent(getSpace());
704 liNav.addContent("|");
705 liNav.addContent(getSpace());
706 }
708 /**
709 * Return the classDoc being documented.
710 *
711 * @return the classDoc being documented.
712 */
713 public ClassDoc getClassDoc() {
714 return classDoc;
715 }
716 }