This commit is contained in:
Redkale
2016-09-26 09:41:40 +08:00
parent fa601c69e7
commit 43102b9d35
2 changed files with 2 additions and 2 deletions

View File

@@ -92,7 +92,7 @@ public class ApiDocs extends HttpBaseServlet {
if (Modifier.isStatic(field.getModifiers())) continue;
Map<String, String> fieldmap = new LinkedHashMap<>();
fieldmap.put("type", field.getType().isArray() ? (field.getType().getComponentType().getName() + "[]") : field.getType().getName());
fieldmap.put("type", field.getType().isArray() ? (field.getType().getComponentType().getName() + "[]") : field.getGenericType().getTypeName());
Comment comment = field.getAnnotation(Comment.class);
if (comment != null) fieldmap.put("comment", comment.value());

View File

@@ -66,7 +66,7 @@
html.push(' <tr><td colspan="5"><table class="typetable">');
for (var fieldname in classmap[type]) {
var field = classmap[type][fieldname];
var t = field.type.substring(field.type.lastIndexOf('.') + 1);
var t = field.type.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/([a-zA-Z0-9_\$]+\.)+/g, "");
html.push(' <tr class="l"><td>' + fieldname + '</td><td>' + t + '</td><td colspan="2">' + (field.comment || '') + '</td></tr>');
}
html.push(' </table></td></tr>');