/** * {@inheritDoc} */ public Content getTagletOutput(Doc holder, TagletWriter writer) { ExecutableMemberDoc execHolder = (ExecutableMemberDoc) holder; ThrowsTag[] tags = execHolder.throwsTags(); Content result = writer.getOutputInstance(); HashSet<String> alreadyDocumented = new HashSet<String>(); if (tags.length > 0) { result.addContent(throwsTagsOutput( execHolder.throwsTags(), writer, alreadyDocumented, true)); } result.addContent(inheritThrowsDocumentation(holder, execHolder.thrownExceptionTypes(), alreadyDocumented, writer)); result.addContent(linkToUndocumentedDeclaredExceptions( execHolder.thrownExceptionTypes(), alreadyDocumented, writer)); return result; }
/** * {@inheritDoc} */ public TagletOutput getTagletOutput(Doc holder, TagletWriter writer) { ExecutableMemberDoc execHolder = (ExecutableMemberDoc) holder; ThrowsTag[] tags = execHolder.throwsTags(); TagletOutput result = writer.getOutputInstance(); HashSet<String> alreadyDocumented = new HashSet<String>(); if (tags.length > 0) { result.appendOutput(throwsTagsOutput( execHolder.throwsTags(), writer, alreadyDocumented, true)); } result.appendOutput(inheritThrowsDocumentation(holder, execHolder.thrownExceptionTypes(), alreadyDocumented, writer)); result.appendOutput(linkToUndocumentedDeclaredExceptions( execHolder.thrownExceptionTypes(), alreadyDocumented, writer)); return result; }
/** * Prints the exception documentation. * * @param pw the writer to print the exception documentation to * @param memberDoc the member to document the exceptions for */ private static void printThrowsTags(PrintWriter pw, ExecutableMemberDoc memberDoc) { ThrowsTag[] throwsTags = memberDoc.throwsTags(); for (ThrowsTag throwsTag : throwsTags) { ClassDoc exceptionDoc = throwsTag.exception(); if (exceptionDoc == null) { ERROR_REPORTER.printWarning("Unable to locate class '" + throwsTag.exceptionName() + "' for '" + memberDoc.qualifiedName() + "'"); continue; } printIndent(pw, 3); pw.print("<exception cref=\""); printReference(pw, exceptionDoc, true); pw.print("\">"); printComment(pw, memberDoc, throwsTag.inlineTags()); pw.println("</exception>"); } }