mOut.println(" <P>");
mOut.println("<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" CELLSPACING=\"0\" SUMMARY=\"\">");
mOut.println("<TR BGCOLOR=\"#CCCCFF\"><TH ALIGN=\"left\" COLSPAN=\"2\"><FONT SIZE=\"+2\"><B>Methods Detail</B></FONT></TH></TR>");
mOut.println("</TABLE>");
for (int m = 0; m < methodDocs.length; m++) {
MethodDoc methodDoc = methodDocs[m];
String methodName = methodDoc.name();
// get return type
String returnTypeString = getTypeString(methodDoc.returnType());
int returnTypeLength = returnTypeString.replaceAll("<.*?>", "").replace("<", "<").replace(">", ">").length(); // length without HTML tags and >/< entities
Parameter[] parameters = methodDoc.parameters();
String[] parameterSignatures = new String[parameters.length];
for (int i = 0; i < parameterSignatures.length; i++) {
Parameter parameter = parameters[i];
parameterSignatures[i] = getTypeString(parameter.type()) + " " + parameter.name();
}
String parameterSeparator = ",\n";
for (int i = 0; i < returnTypeLength + methodName.length() + 2; i++) {
parameterSeparator += " ";
}
// begin output
mOut.println("<A NAME=\"" + methodName + "\"><A NAME=\"" + methodName + methodDoc.flatSignature() + "\"> <H3>" + methodName + "</H3></A></A>");
mOut.print("<PRE>" + returnTypeString + " <B>" + methodName + "</B>(" + Strings.join(parameterSignatures, parameterSeparator) + ")");
Type[] exceptions = methodDoc.thrownExceptionTypes();
if (exceptions.length > 0) {
String[] exceptionNames = new String[exceptions.length];
for (int i = 0; i < exceptions.length; i++) {
exceptionNames[i] = getTypeString(exceptions[i]);
}
mOut.print(parameterSeparator.substring(1, parameterSeparator.length() - 7) + "throws " + Strings.join(exceptionNames, parameterSeparator));
}
mOut.println("</PRE>");
mOut.print("<DL><DD>");
printInlineTags(methodDoc.inlineTags(), classDoc);
mOut.println("<P><DD><DL>");
// param tags
ParamTag[] paramTags = methodDoc.paramTags();
if (parameters.length > 0) {
mOut.println("<DT><B>Parameters:</B></DT>");
for (Parameter parameter : parameters) {
ParamTag paramTag = null;
for (ParamTag tag : paramTags) {
if (tag.parameterName().equals(parameter.name())) {
paramTag = tag;
}
}
mOut.println("<DD><CODE>" + parameter.name() + "</CODE> - ");
if (paramTag != null) {
if (!paramTag.parameterComment().isEmpty()) {
printInlineTags(paramTag.inlineTags(), classDoc);
} else {
System.out.println("No description in @param tag for " + parameter.name() + " in " + classDoc.name() + "." + methodDoc.name());
}
} else {
System.out.println("No @param tag for " + parameter.name() + " in " + classDoc.name() + "." + methodDoc.name());
}
mOut.println("</DD>");
}
}
// return tag
Tag[] returnTags = methodDoc.tags("@return");
if (returnTags.length > 0) {
mOut.println("<DT><B>Returns:</B></DT>");
mOut.println("<DD>" + returnTags[0].text() + "</DD>");
}
// throws tag
ThrowsTag[] throwsTags = methodDoc.throwsTags();
if (throwsTags.length > 0) {
mOut.println("<DT><B>Throws:</B></DT>");
for (ThrowsTag throwsTag: throwsTags) {
String exceptionName = throwsTag.exceptionName();
// remove "com.qspin.qtaste.testsuite." prefix if any