/** * Add the modifier for the member. * * @param member the member to add the type for * @param code the content tree to which the modified will be added */ private void addModifier(ProgramElementDoc member, Content code) { if (member.isProtected()) { code.addContent("protected "); } else if (member.isPrivate()) { code.addContent("private "); } else if (!member.isPublic()) { // Package private code.addContent(configuration.getText("doclet.Package_private")); code.addContent(" "); } if (member.isMethod()) { if (!(member.containingClass().isInterface()) && ((MethodDoc) member).isAbstract()) { code.addContent("abstract "); } // This check for isDefault() and the default modifier needs to be // added for it to appear on the "Modifier and Type" column in the // method summary 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. if (((MethodDoc) member).isDefault()) { code.addContent("default "); } } if (member.isStatic()) { code.addContent("static "); } }
/** * 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); }