void generate() {
   if (rootDoc == null || outputdir == null) {
     return;
   }
   for (PackageDoc pd : rootDoc.specifiedPackages()) {
     // If -nodeprecated option is set and the package is marked as deprecated,
     // do not convert the package files to HTML.
     if (!(configuration.nodeprecated && utils.isDeprecated(pd))) convertPackage(pd, outputdir);
   }
   for (ClassDoc cd : rootDoc.specifiedClasses()) {
     // If -nodeprecated option is set and the class is marked as deprecated
     // or the containing package is deprecated, do not convert the
     // package files to HTML.
     if (!(configuration.nodeprecated
         && (utils.isDeprecated(cd) || utils.isDeprecated(cd.containingPackage()))))
       convertClass(cd, outputdir);
   }
 }
 /**
  * Add a line from source to the HTML file that is generated.
  *
  * @param pre the content tree to which the line will be added.
  * @param line the string to format.
  * @param currentLineNo the current number.
  */
 private void addLine(Content pre, String line, int currentLineNo) {
   if (line != null) {
     Content anchor =
         HtmlTree.A(
             configuration.htmlVersion,
             "line." + Integer.toString(currentLineNo),
             new StringContent(utils.replaceTabs(configuration, line)));
     pre.addContent(anchor);
     pre.addContent(NEW_LINE);
   }
 }
 /**
  * Add the member summary for the given class.
  *
  * @param classDoc the class that is being documented
  * @param member the member being documented
  * @param firstSentenceTags the first sentence tags to be added to the summary
  * @param tableContents the list of contents to which the documentation will be added
  * @param counter the counter for determining id and style for the table row
  */
 public void addMemberSummary(
     ClassDoc classDoc,
     ProgramElementDoc member,
     Tag[] firstSentenceTags,
     List<Content> tableContents,
     int counter) {
   HtmlTree tdSummaryType = new HtmlTree(HtmlTag.TD);
   tdSummaryType.addStyle(HtmlStyle.colFirst);
   writer.addSummaryType(this, member, tdSummaryType);
   HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
   setSummaryColumnStyle(tdSummary);
   addSummaryLink(classDoc, member, tdSummary);
   writer.addSummaryLinkComment(this, member, firstSentenceTags, tdSummary);
   HtmlTree tr = HtmlTree.TR(tdSummaryType);
   tr.addContent(tdSummary);
   if (member instanceof MethodDoc && !member.isAnnotationTypeElement()) {
     int methodType =
         (member.isStatic()) ? MethodTypes.STATIC.value() : MethodTypes.INSTANCE.value();
     if (member.containingClass().isInterface()) {
       methodType =
           (((MethodDoc) member).isAbstract())
               ? methodType | MethodTypes.ABSTRACT.value()
               : methodType | MethodTypes.DEFAULT.value();
     } else {
       methodType =
           (((MethodDoc) member).isAbstract())
               ? methodType | MethodTypes.ABSTRACT.value()
               : methodType | MethodTypes.CONCRETE.value();
     }
     if (utils.isDeprecated(member) || utils.isDeprecated(classdoc)) {
       methodType = methodType | MethodTypes.DEPRECATED.value();
     }
     methodTypesOr = methodTypesOr | methodType;
     String tableId = "i" + counter;
     typeMap.put(tableId, methodType);
     tr.addAttr(HtmlAttr.ID, tableId);
   }
   if (counter % 2 == 0) tr.addStyle(HtmlStyle.altColor);
   else tr.addStyle(HtmlStyle.rowColor);
   tableContents.add(tr);
 }
 /**
  * Convert the Classes in the given Package to an HTML.
  *
  * @param pd the Package to convert.
  * @param outputdir the name of the directory to output to.
  */
 public void convertPackage(PackageDoc pd, DocPath outputdir) {
   if (pd == null) {
     return;
   }
   for (ClassDoc cd : pd.allClasses()) {
     // If -nodeprecated option is set and the class is marked as deprecated,
     // do not convert the package files to HTML. We do not check for
     // containing package deprecation since it is already check in
     // the calling method above.
     if (!(configuration.nodeprecated && utils.isDeprecated(cd))) convertClass(cd, outputdir);
   }
 }
 /**
  * Add the modifier for the member.
  *
  * @param member the member for which teh modifier will be added.
  * @param htmltree the content tree to which the modifier information will be added.
  */
 protected void addModifiers(MemberDoc member, Content htmltree) {
   String mod = modifierString(member);
   // According to JLS, we should not be showing public modifier for
   // interface methods.
   if ((member.isField() || member.isMethod())
       && writer instanceof ClassWriterImpl
       && ((ClassWriterImpl) writer).getClassDoc().isInterface()) {
     // This check for isDefault() and the default modifier needs to be
     // added for it to appear on the method details section. Once the
     // default modifier is added to the Modifier list on DocEnv and once
     // it is updated to use the javax.lang.model.element.Modifier, we
     // will need to remove this.
     mod =
         (member.isMethod() && ((MethodDoc) member).isDefault())
             ? utils.replaceText(mod, "public", "default").trim()
             : utils.replaceText(mod, "public", "").trim();
   }
   if (mod.length() > 0) {
     htmltree.addContent(mod);
     htmltree.addContent(writer.getSpace());
   }
 }
 public ProgramElementDoc[] eligibleMembers(ProgramElementDoc[] members) {
   return nodepr ? utils.excludeDeprecatedMembers(members) : members;
 }