/** {@inheritDoc} */ public Content deprecatedTagOutput(Doc doc) { ContentBuilder result = new ContentBuilder(); Tag[] deprs = doc.tags("deprecated"); if (doc instanceof ClassDoc) { if (Util.isDeprecated((ProgramElementDoc) doc)) { result.addContent( HtmlTree.SPAN( HtmlStyle.deprecatedLabel, new StringContent(configuration.getText("doclet.Deprecated")))); result.addContent(RawHtml.nbsp); if (deprs.length > 0) { Tag[] commentTags = deprs[0].inlineTags(); if (commentTags.length > 0) { result.addContent(commentTagsToOutput(null, doc, deprs[0].inlineTags(), false)); } } } } else { MemberDoc member = (MemberDoc) doc; if (Util.isDeprecated((ProgramElementDoc) doc)) { result.addContent( HtmlTree.SPAN( HtmlStyle.deprecatedLabel, new StringContent(configuration.getText("doclet.Deprecated")))); result.addContent(RawHtml.nbsp); if (deprs.length > 0) { Content body = commentTagsToOutput(null, doc, deprs[0].inlineTags(), false); if (!body.isEmpty()) result.addContent(HtmlTree.SPAN(HtmlStyle.deprecationComment, body)); } } else { if (Util.isDeprecated(member.containingClass())) { result.addContent( HtmlTree.SPAN( HtmlStyle.deprecatedLabel, new StringContent(configuration.getText("doclet.Deprecated")))); result.addContent(RawHtml.nbsp); } } } return result; }
/** * 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()); } }
/** * Build the method tags. * * @param node the XML element that specifies which components to document * @param methodsContentTree content tree to which the documentation will be added */ public void buildMethodTags(XMLNode node, Content methodsContentTree) { methodWriter.addMemberTags((MethodDoc) currentMember, methodsContentTree); MethodDoc method = (MethodDoc) currentMember; if (method.name().compareTo("writeExternal") == 0 && method.tags("serialData").length == 0) { if (configuration.serialwarn) { configuration .getDocletSpecificMsg() .warning( currentMember.position(), "doclet.MissingSerialDataTag", method.containingClass().qualifiedName(), method.name()); } } }
/** * Get the header for the section. * * @param member the member being documented. * @return a header content for the section. */ protected Content getHead(MemberDoc member) { Content memberContent = new StringContent(member.name()); Content heading = HtmlTree.HEADING(HtmlConstants.MEMBER_HEADING, memberContent); return heading; }
/** * Return a string describing the access modifier flags. Don't include native or synchronized. * * <p>The modifier names are returned in canonical order, as specified by <em>The Java Language * Specification</em>. */ protected String modifierString(MemberDoc member) { int ms = member.modifierSpecifier(); int no = Modifier.NATIVE | Modifier.SYNCHRONIZED; return Modifier.toString(ms & ~no); }
protected String llniFieldName(MemberDoc field) { return maskName(field.name()); }
protected final String cRcvrDecl(MemberDoc field, String cname) { return (field.isStatic() ? "jclass" : "jobject"); }