Skip to content
Permalink
Browse files

Use simple name for exceptions on API page

  • Loading branch information...
PseudoKnight committed Sep 23, 2019
1 parent d46cb4b commit d252b26cd07d41ae212a966fb7e6eac81f532a2f
Showing with 9 additions and 8 deletions.
  1. +9 −8 src/main/java/com/laytonsmith/tools/docgen/sitedeploy/SiteDeploy.java
@@ -1242,8 +1242,9 @@ private void deployAPI() {
List<String> exc = new ArrayList<>();
if(f.thrown() != null) {
for(Class<? extends CREThrowable> e : f.thrown()) {
CREThrowable ct = ReflectionUtils.instantiateUnsafe(e);
exc.add("{{object|" + ct.getName() + "}}");
// for the API reference page we want the simple name
String[] splitType = ReflectionUtils.instantiateUnsafe(e).getName().split("\\.");
exc.add("{{object|" + (splitType[splitType.length - 1]) + "}}");
}
}
c.add(StringUtils.Join(exc, "<br>"));
@@ -1291,12 +1292,12 @@ private void deployAPI() {
String docs = (String) ReflectionUtils.invokeMethod(clazz, null, "docs");
b.append("<div>").append(docs).append("</div>\n\n");
b.append("{|\n|-\n");
b.append("! scope=\"col\" width=\"6%\" | Function Name\n"
+ "! scope=\"col\" width=\"5%\" | Returns\n"
+ "! scope=\"col\" width=\"10%\" | Arguments\n"
+ "! scope=\"col\" width=\"10%\" | Throws\n"
+ "! scope=\"col\" width=\"64%\" | Description\n"
+ "! scope=\"col\" width=\"5%\" |"
b.append("! scope=\"col\" width=\"8%\" | Function Name\n"
+ "! scope=\"col\" width=\"4%\" | Returns\n"
+ "! scope=\"col\" width=\"16%\" | Arguments\n"
+ "! scope=\"col\" width=\"8%\" | Throws\n"
+ "! scope=\"col\" width=\"62%\" | Description\n"
+ "! scope=\"col\" width=\"2%\" |"
+ " <span class=\"abbr\" title=\"Restricted\">Res</span>\n");
for(List<String> row : clazzData) {
b.append("|-");

0 comments on commit d252b26

Please sign in to comment.
You can’t perform that action at this time.