/** * Renders a package documentation to an AsciiDoc file. * * @param doc the package documentation object */ private void renderPackage(PackageDoc doc){ try { PrintWriter writer = getWriter(doc, "package-info"); writer.println(doc.name()); if (doc.position() != null) { outputText(doc.name(), doc.getRawCommentText(), writer); } if (doc instanceof AnnotationTypeDoc) { for (MemberDoc member : ((AnnotationTypeDoc) doc).elements()) { outputText(member.name(), member.getRawCommentText(), writer); } } writer.flush(); } catch (FileNotFoundException e) { e.printStackTrace(); } }
/** * Render the tag. * * @todo TODOs can also be used in member docs ... * * @param tag The tag to render. * @param target The target {@link StringBuilder}. * @todo ... or even parameter docs -- which is a little strange, actually. ;) * @param doclet The doclet. */ @Override public void render(Tag tag, StringBuilder target, MarkdownDoclet doclet) { Counter counter; if ( tag.holder() instanceof MemberDoc ) { counter = getCounter(((MemberDoc)tag.holder()).containingClass()); } else { counter = getCounter(tag.holder()); } target.append("<div class=\"todo\">"); target.append("<div class=\"todoTitle\"><span class=\"todoTitle\">") .append(doclet.getOptions().getTodoTitle()) .append("</span><span class=\"todoCounter\">#") .append(counter.next()) .append("</span></div>"); target.append("<div class=\"todoText\">"); target.append(doclet.toHtml(tag.text().trim())); target.append("</div></div>"); }
public HtmlRepairer(DocErrorReporter warningReporter, boolean noWarn, boolean noEmailWarn, ClassDoc contextClass, MemberDoc contextMember, boolean throwAwayLeadingPara) { this.warningReporter = warningReporter; this.noWarn = noWarn; this.noEmailWarn = noEmailWarn; this.contextClass = contextClass; this.contextMember = contextMember; this.throwAwayLeadingPara = throwAwayLeadingPara; }
/** * Returns true if the given element is hidden. */ private static boolean isHidden(Doc doc) { // Methods, fields, constructors. if (doc instanceof MemberDoc) { return hasHideAnnotation(doc); } // Classes, interfaces, enums, annotation types. if (doc instanceof ClassDoc) { ClassDoc classDoc = (ClassDoc) doc; // Check the containing package. if (hasHideAnnotation(classDoc.containingPackage())) { return true; } // Check the class doc and containing class docs if this is a // nested class. ClassDoc current = classDoc; do { if (hasHideAnnotation(current)) { return true; } current = current.containingClass(); } while (current != null); } return false; }
/** * @return a JSON stub for the given MemberDoc */ protected JSONObject processMemberDocStub(MemberDoc memberDoc) { return processProgramElementDocStub(memberDoc); }
/** * @return the full JSON for the given MemberDoc */ protected JSONObject processMemberDoc(MemberDoc memberDoc) { if (memberDoc == null) { return null; } JSONObject retMe = processProgramElementDoc(memberDoc); retMe.put("isSynthetic", memberDoc.isSynthetic()); return retMe; }
/** * Process the member documentation. * * @param doc The member documentation. */ protected void processMember(MemberDoc doc) { defaultProcess(doc, true); }