// should do this, but it does not.
StringBuffer documentation = new StringBuffer();
Tag tag[] = programElementDoc.inlineTags();
for (int i = 0; i < tag.length; i++) {
if (tag[i] instanceof SeeTag) {
SeeTag seeTag = (SeeTag) tag[i];
documentation.append("<a href=\"");
// The dot separated class or package name, if any.
String classOrPackageName = null;
boolean isIncluded = false;
if (seeTag.referencedPackage() != null) {
classOrPackageName = seeTag.referencedPackage().toString();
isIncluded = seeTag.referencedPackage().isIncluded();
}
if (seeTag.referencedClass() != null) {
classOrPackageName = seeTag.referencedClass()
.qualifiedName();
isIncluded = seeTag.referencedClass().isIncluded();
}
// {@link ...} tags usually have a null label.
String target = seeTag.label();
if (target == null || target.length() == 0) {
target = seeTag.referencedMemberName();
if (target == null || target.length() == 0) {
target = seeTag.referencedClassName();
}
}
if (classOrPackageName != null) {
if (target != null && target.indexOf("(") != -1) {
// The target has a paren, so can't be a port or
// parameter, so link to the html instead of the .xml.
isIncluded = false;
}
// If the .xml file is not included in the output,
// then link to the .html file
documentation.append(_relativizePath(_outputDirectory,
classOrPackageName, programElementDoc, isIncluded));
}
if (seeTag.referencedMember() != null) {
documentation
.append("#" + seeTag.referencedMember().name());
}
documentation.append("\">" + target + "</a>");
} else {
documentation.append(tag[i].text());
}