/** * Appends a specific comment to the StringBuilder. * * @param comment */ private void emitDocComment(DocComment comment) { if (!comment.isExcluded()) { int type = comment.getType(); if (type == DocComment.PACKAGE) emitPackage(comment); else if (type == DocComment.CLASS || type == DocComment.INTERFACE) emitClass(comment); else if (type >= DocComment.FUNCTION && type <= DocComment.FUNCTION_SET) emitFunction(comment); else if (type == DocComment.FIELD) emitField(comment); } }
/** * Appends a class or interface * * @param comment */ private void emitClass(DocComment comment) { String tagName = (comment.getType() == DocComment.CLASS) ? "classRec" : "interfaceRec"; xml.append("\n<"); xml.append(tagName); xml.append(" name='"); xml.append(comment.getName()); xml.append("' fullname='"); xml.append(comment.getFullname()); String sourcefile = comment.getSourceFile(); if (sourcefile != null) { xml.append("' sourcefile='"); xml.append(sourcefile); } xml.append("' namespace='"); xml.append(comment.getNamespace()); xml.append("' access='"); xml.append(comment.getAccess()); xml.append("' "); if (comment.getType() == DocComment.INTERFACE) { String[] baseClasses = comment.getBaseclasses(); if (baseClasses != null) { xml.append("baseClasses='"); for (int i = 0; i < baseClasses.length; i++) { String baseclass = baseClasses[i]; if (baseclass != null) { if (i != 0) xml.append(";"); xml.append(baseclass); } } xml.append("' "); } } else { xml.append("baseclass='"); xml.append(comment.getBaseClass()); xml.append("' "); String[] interfaces = comment.getInterfaces(); if (interfaces != null) { xml.append("interfaces='"); for (int i = 0; i < interfaces.length; i++) { String inter = interfaces[i]; if (inter != null) { if (i != 0) xml.append(";"); xml.append(inter); } } xml.append("' "); } } xml.append("isFinal='"); xml.append(comment.isFinal()); xml.append("' "); xml.append("isDynamic='"); xml.append(comment.isDynamic()); xml.append("' "); xml.append(">"); String desc = comment.getDescription(); if (desc != null) appendTag("description", comment.getDescription()); emitTags(comment.getAllTags()); if (comment.getMetadata() != null) emitMetadata(comment.getMetadata()); xml.append("\n</"); xml.append(tagName); xml.append(">"); }