String typeInfo = "";
if (isRelevantType(type)) {
ClassDoc typeDoc = type.asClassDoc();
typeInfo = processedTypes.get(type.toString());
if (typeInfo != null) {
LOG.debug("Found cached typedoc for " + type.typeName() + " - "
+ typeInfo);
}
if (typeInfo == null && typeDoc != null) {
typeInfo = "";
// if this is a generic type then recurse with the first type argument
if (isParameterisedType(type)) {
LOG.debug("Parameterised type");
if (type.asClassDoc() != null) {
typeInfo =
getTypeDoc(
type.asParameterizedType().typeArguments()[type
.asParameterizedType().typeArguments().length - 1],
processedTypes, true);
}
} else {
logType(type);
// put placeholder to stop recursion for self-referential types
LOG.debug("Starting to cache: " + type.typeName());
processedTypes.put(type.toString(), "");
LOG.debug(typeDoc.commentText() + " " + leafType);
if (leafType && !typeDoc.commentText().isEmpty()) {
typeInfo +=
"<tr><span class=\"javadoc-header\">"
+ typeDoc.commentText() + "</span></tr>";
LOG.debug(typeInfo);
}
if (typeDoc.isEnum()) {
LOG.debug("Enum type");
typeInfo += getEnumDoc(type);
} else { // class
LOG.debug("Class");
// first do base class
if (typeDoc.superclass() != null) {
LOG.debug("base type = "
+ typeDoc.superclass().qualifiedName());
String baseTypeDoc =
getTypeDoc(type.asClassDoc().superclassType(),
processedTypes, false);
if (!baseTypeDoc.isEmpty()) {
LOG.debug("base type DOC = " + baseTypeDoc);
typeInfo += baseTypeDoc;
}
}
typeInfo += getPublicConstantDoc(type);
Collection<String> getterNames = getGetterNames(type);
for (MethodDoc method : typeDoc.methods()) {
if (method.isPublic()
&& getterNames.contains(method.name())
&& !ignore(method)) {