2014-06-10 21:12:55 +02:00
|
|
|
package stanhebben.zenscript.docs;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
|
|
|
* To change this template file, choose Tools | Templates
|
|
|
|
|
* and open the template in the editor.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-12 21:37:56 +02:00
|
|
|
import com.sun.javadoc.AnnotationDesc;
|
2014-06-10 21:12:55 +02:00
|
|
|
import com.sun.javadoc.ClassDoc;
|
2014-07-09 12:29:46 +02:00
|
|
|
import com.sun.javadoc.DocErrorReporter;
|
2014-06-12 21:37:56 +02:00
|
|
|
import com.sun.javadoc.LanguageVersion;
|
|
|
|
|
import com.sun.javadoc.MethodDoc;
|
|
|
|
|
import com.sun.javadoc.Parameter;
|
2014-06-10 21:12:55 +02:00
|
|
|
import com.sun.javadoc.RootDoc;
|
2014-06-12 21:37:56 +02:00
|
|
|
import com.sun.javadoc.Type;
|
2014-07-09 12:29:46 +02:00
|
|
|
import com.sun.tools.doclets.standard.Standard;
|
2014-06-12 21:37:56 +02:00
|
|
|
import java.io.BufferedWriter;
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.FileWriter;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.io.Writer;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import stanhebben.zenscript.util.StringUtil;
|
2014-06-10 21:12:55 +02:00
|
|
|
|
|
|
|
|
/**
|
2014-06-12 21:37:56 +02:00
|
|
|
*
|
|
|
|
|
* Example usage: (from minetweaker API source dir):
|
|
|
|
|
*
|
|
|
|
|
* javadoc -doclet stanhebben.zenscript.docs.ZenScriptDoclet -docletpath ..\..\..\..\ZenScript\build\classes\main -cp ..\..\..\..\ZenScript\build\libs\ZenScript.jar -sourcepath . -subpackages minetweaker
|
|
|
|
|
*
|
|
|
|
|
* @author Stan Hebben
|
2014-06-10 21:12:55 +02:00
|
|
|
*/
|
2014-07-09 12:29:46 +02:00
|
|
|
public class ZenScriptDoclet extends Standard {
|
|
|
|
|
public static boolean validOptions(String[][] strings, DocErrorReporter der) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static int optionLength(String option) {
|
|
|
|
|
if(option.equals("-baseurl")) {
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Standard.optionLength(option);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-10 21:12:55 +02:00
|
|
|
public static boolean start(RootDoc root) {
|
2014-07-09 12:29:46 +02:00
|
|
|
File output = new File("zendoc");
|
|
|
|
|
String baseUrl = "/doc/";
|
|
|
|
|
for (String[] options : root.options()) {
|
|
|
|
|
//System.out.println(Arrays.toString(options));
|
|
|
|
|
if (options[0].equals("-d")) {
|
|
|
|
|
output = new File(options[1]);
|
|
|
|
|
} else if (options[0].equals("-baseurl")) {
|
|
|
|
|
baseUrl = options[1];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-10 21:12:55 +02:00
|
|
|
ClassDoc[] classes = root.classes();
|
2014-06-12 21:37:56 +02:00
|
|
|
List<ZenClassDoc> documentedClasses = new ArrayList<ZenClassDoc>();
|
|
|
|
|
List<ZenExpansionDoc> expansionClasses = new ArrayList<ZenExpansionDoc>();
|
|
|
|
|
|
2014-06-10 21:12:55 +02:00
|
|
|
for (int i = 0; i < classes.length; ++i) {
|
2014-06-12 21:37:56 +02:00
|
|
|
ClassDoc cls = classes[i];
|
|
|
|
|
|
|
|
|
|
for (AnnotationDesc annotation : cls.annotations()) {
|
|
|
|
|
//String fullName = annotation.annotationType().containingPackage().name() + '.' + annotation.annotationType().name();
|
|
|
|
|
String fullName = annotation.annotationType().qualifiedName();
|
|
|
|
|
if (fullName.equals("stanhebben.zenscript.annotations.ZenClass")) {
|
|
|
|
|
documentedClasses.add(new ZenClassDoc(cls, (String) (annotation.elementValues()[0].value().value())));
|
|
|
|
|
} else if (fullName.equals("stanhebben.zenscript.annotations.ZenExpansion")) {
|
|
|
|
|
expansionClasses.add(new ZenExpansionDoc(cls, (String) (annotation.elementValues()[0].value().value())));
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-06-10 21:12:55 +02:00
|
|
|
}
|
2014-06-12 21:37:56 +02:00
|
|
|
|
|
|
|
|
Map<String, ZenClassDoc> classesByName = new HashMap<String, ZenClassDoc>();
|
|
|
|
|
Map<String, ZenClassDoc> classesByJavaName = new HashMap<String, ZenClassDoc>();
|
|
|
|
|
|
|
|
|
|
for (ZenClassDoc documentedClass : documentedClasses) {
|
|
|
|
|
classesByName.put(documentedClass.getName(), documentedClass);
|
|
|
|
|
classesByJavaName.put(documentedClass.getDoc().qualifiedName(), documentedClass);
|
|
|
|
|
}
|
|
|
|
|
for (ZenExpansionDoc expansion : expansionClasses) {
|
|
|
|
|
if (classesByName.containsKey(expansion.getType())) {
|
|
|
|
|
classesByName.get(expansion.getType()).addExpansion(expansion);
|
|
|
|
|
} else {
|
|
|
|
|
if (expansion.getType().endsWith("]")) {
|
|
|
|
|
String baseName = expansion.getType().substring(0, expansion.getType().lastIndexOf('['));
|
|
|
|
|
if (classesByName.containsKey(baseName)) {
|
|
|
|
|
classesByName.get(baseName).addExpansion(expansion);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.out.println("Number of classes to document: " + classesByName.size());
|
2014-07-09 12:29:46 +02:00
|
|
|
System.out.println("Output directory: " + output);
|
2014-06-12 21:37:56 +02:00
|
|
|
if (!output.exists()) output.mkdirs();
|
|
|
|
|
|
2014-07-09 12:29:46 +02:00
|
|
|
String packageList = buildPackageList(documentedClasses, baseUrl);
|
2014-06-12 21:37:56 +02:00
|
|
|
|
|
|
|
|
for (ZenClassDoc doc : classesByName.values()) {
|
|
|
|
|
try {
|
|
|
|
|
File outputDoc = new File(output, doc.getName().replace('.', '/') + ".html");
|
|
|
|
|
File outputDocParent = outputDoc.getParentFile();
|
|
|
|
|
if (!outputDocParent.exists()) outputDocParent.mkdirs();
|
|
|
|
|
|
|
|
|
|
Writer writer = new BufferedWriter(new FileWriter(outputDoc));
|
|
|
|
|
|
|
|
|
|
String simpleName = doc.getName().substring(doc.getName().lastIndexOf('.') + 1);
|
|
|
|
|
|
|
|
|
|
writer.append("<!DOCTYPE html>");
|
|
|
|
|
writer.append("<html><head>");
|
|
|
|
|
writer.append("<title>ZenDoc : " + simpleName + "</title>");
|
|
|
|
|
writer.append("<link rel=\"stylesheet\" href=\"/css/bootstrap.min.css\" />");
|
|
|
|
|
writer.append("<link rel=\"stylesheet\" href=\"/css/bootstrap-theme.css\" />");
|
|
|
|
|
writer.append("<link rel=\"stylesheet\" href=\"/css/font-awesome.min.css\" />");
|
|
|
|
|
writer.append("</head><body>");
|
|
|
|
|
writer.append("<div class=\"container\"><div class=\"row\">");
|
|
|
|
|
writer.append(packageList);
|
|
|
|
|
writer.append("<div class=\"col-md-9\">");
|
|
|
|
|
|
|
|
|
|
String pkgName = doc.getName().substring(0, doc.getName().lastIndexOf('.'));
|
|
|
|
|
writer.append("<div class=\"class-package-name\">");
|
|
|
|
|
writer.append(pkgName);
|
|
|
|
|
writer.append("</div>");
|
|
|
|
|
|
|
|
|
|
// output class or interface contents
|
|
|
|
|
writer.append("<h1>");
|
|
|
|
|
if (doc.getDoc().isInterface()) {
|
|
|
|
|
writer.append("Interface ");
|
|
|
|
|
} else {
|
|
|
|
|
writer.append("Class ");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
writer.append(doc.getDoc().name()).append("</h1>");
|
|
|
|
|
if (doc.getDoc().interfaces().length > 0) {
|
|
|
|
|
writer.append("<div class=\"implemented-interfaces\">implements ");
|
|
|
|
|
boolean first = true;
|
|
|
|
|
for (Type itype : doc.getDoc().interfaceTypes()) {
|
|
|
|
|
if (first) {
|
|
|
|
|
first = false;
|
|
|
|
|
} else {
|
|
|
|
|
writer.append(", ");
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-09 12:29:46 +02:00
|
|
|
outputType(writer, itype, classesByJavaName, baseUrl);
|
2014-06-12 21:37:56 +02:00
|
|
|
}
|
|
|
|
|
writer.append("</div>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
writer.append("<hr />");
|
|
|
|
|
writer.append("<div class=\"documentation-class\">");
|
|
|
|
|
|
|
|
|
|
for (String p : StringUtil.splitParagraphs(doc.getDoc().commentText())) {
|
|
|
|
|
writer.append("<p>");
|
|
|
|
|
writer.append(p);
|
|
|
|
|
writer.append("</p>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
writer.append("</div>");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (doc.getDoc().isInterface() && doc.getDoc().methods().length == 1) {
|
|
|
|
|
// functional interface
|
|
|
|
|
writer.append("<h2>Functional interface</h2>");
|
|
|
|
|
|
|
|
|
|
MethodDoc method = doc.getDoc().methods()[0];
|
|
|
|
|
writer.append("<div class=\"functional-interface-signature\">");
|
|
|
|
|
writer.append("function (");
|
|
|
|
|
|
|
|
|
|
boolean first = true;
|
|
|
|
|
for (Parameter parameter : method.parameters()) {
|
|
|
|
|
if (first) {
|
|
|
|
|
first = false;
|
|
|
|
|
} else {
|
|
|
|
|
writer.append(", ");
|
|
|
|
|
}
|
|
|
|
|
ZenParameterDoc paramdoc = new ZenParameterDoc(parameter);
|
|
|
|
|
writer.append(paramdoc.getName());
|
|
|
|
|
writer.append(" as ");
|
2014-07-09 12:29:46 +02:00
|
|
|
outputType(writer, paramdoc.getType(), classesByJavaName, baseUrl);
|
2014-06-12 21:37:56 +02:00
|
|
|
}
|
|
|
|
|
writer.append(") as ");
|
2014-07-09 12:29:46 +02:00
|
|
|
outputType(writer, method.returnType(), classesByJavaName, baseUrl);
|
2014-06-12 21:37:56 +02:00
|
|
|
writer.append("</div>");
|
|
|
|
|
|
|
|
|
|
String[] comment = StringUtil.splitParagraphs(method.commentText());
|
|
|
|
|
for (String line : comment) {
|
|
|
|
|
writer.append("<p>");
|
|
|
|
|
writer.append(line);
|
|
|
|
|
writer.append("</p>");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
writer.append("<h2>Member Overview</h2>");
|
|
|
|
|
|
|
|
|
|
// collect members
|
|
|
|
|
|
|
|
|
|
LinkedHashMap<String, ZenPropertyDoc> instanceProperties = new LinkedHashMap<String, ZenPropertyDoc>();
|
|
|
|
|
LinkedHashMap<String, ZenPropertyDoc> staticProperties = new LinkedHashMap<String, ZenPropertyDoc>();
|
|
|
|
|
List<ZenMethodDoc> instanceMethods = new ArrayList<ZenMethodDoc>();
|
|
|
|
|
List<ZenMethodDoc> staticMethods = new ArrayList<ZenMethodDoc>();
|
|
|
|
|
List<ZenOperatorDoc> operators = new ArrayList<ZenOperatorDoc>();
|
|
|
|
|
List<ZenCasterDoc> casters = new ArrayList<ZenCasterDoc>();
|
|
|
|
|
|
|
|
|
|
for (MethodDoc method : doc.getDoc().methods()) {
|
|
|
|
|
for (AnnotationDesc annotation : method.annotations()) {
|
|
|
|
|
String fullName = annotation.annotationType().qualifiedName();
|
|
|
|
|
|
|
|
|
|
if (fullName.equals("stanhebben.zenscript.annotations.ZenMethod")
|
|
|
|
|
|| fullName.equals("stanhebben.zenscript.annotations.ZenMethodStatic")) {
|
|
|
|
|
String name = annotation.elementValues().length > 0
|
|
|
|
|
? (String) (annotation.elementValues()[0].value().value())
|
|
|
|
|
: "";
|
|
|
|
|
|
|
|
|
|
if (name.length() == 0) {
|
|
|
|
|
name = method.name();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<ZenParameterDoc> parameters = new ArrayList<ZenParameterDoc>();
|
|
|
|
|
for (Parameter parameter : method.parameters()) {
|
|
|
|
|
parameters.add(new ZenParameterDoc(parameter));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (method.isStatic()) {
|
|
|
|
|
staticMethods.add(new ZenMethodDoc(name, method, parameters));
|
|
|
|
|
} else {
|
|
|
|
|
instanceMethods.add(new ZenMethodDoc(name, method, parameters));
|
|
|
|
|
}
|
|
|
|
|
} else if (fullName.equals("stanhebben.zenscript.annotations.ZenGetter")) {
|
|
|
|
|
String name = annotation.elementValues().length > 0
|
|
|
|
|
? (String) (annotation.elementValues()[0].value().value())
|
|
|
|
|
: "";
|
|
|
|
|
|
|
|
|
|
if (name.length() == 0) {
|
|
|
|
|
name = method.name();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Type type = method.returnType();
|
|
|
|
|
String[] comment = StringUtil.splitParagraphs(method.commentText());
|
|
|
|
|
|
|
|
|
|
if (!method.isStatic()) {
|
|
|
|
|
if (instanceProperties.containsKey(name)) {
|
|
|
|
|
ZenPropertyDoc property = instanceProperties.get(name);
|
|
|
|
|
property.setCanGet(true);
|
|
|
|
|
property.setComment(comment);
|
|
|
|
|
} else {
|
|
|
|
|
ZenPropertyDoc property = new ZenPropertyDoc(name, type);
|
|
|
|
|
property.setCanGet(true);
|
|
|
|
|
property.setComment(comment);
|
|
|
|
|
instanceProperties.put(name, property);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (staticProperties.containsKey(name)) {
|
|
|
|
|
ZenPropertyDoc property = staticProperties.get(name);
|
|
|
|
|
property.setCanGet(true);
|
|
|
|
|
property.setComment(comment);
|
|
|
|
|
} else {
|
|
|
|
|
ZenPropertyDoc property = new ZenPropertyDoc(name, type);
|
|
|
|
|
property.setCanGet(true);
|
|
|
|
|
property.setComment(comment);
|
|
|
|
|
staticProperties.put(name, property);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (fullName.equals("stanhebben.zenscript.annotations.ZenSetter")) {
|
|
|
|
|
String name = annotation.elementValues().length > 0
|
|
|
|
|
? (String) (annotation.elementValues()[0].value().value())
|
|
|
|
|
: "";
|
|
|
|
|
|
|
|
|
|
if (name.length() == 0) {
|
|
|
|
|
name = method.name();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Type type = method.parameters()[0].type();
|
|
|
|
|
String[] comment = StringUtil.splitParagraphs(method.commentText());
|
|
|
|
|
|
|
|
|
|
if (!method.isStatic()) {
|
|
|
|
|
if (instanceProperties.containsKey(name)) {
|
|
|
|
|
ZenPropertyDoc property = instanceProperties.get(name);
|
|
|
|
|
property.setCanSet(true);
|
|
|
|
|
} else {
|
|
|
|
|
ZenPropertyDoc property = new ZenPropertyDoc(name, type);
|
|
|
|
|
property.setCanGet(true);
|
|
|
|
|
property.setComment(comment);
|
|
|
|
|
instanceProperties.put(name, property);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (staticProperties.containsKey(name)) {
|
|
|
|
|
ZenPropertyDoc property = staticProperties.get(name);
|
|
|
|
|
property.setCanSet(true);
|
|
|
|
|
} else {
|
|
|
|
|
ZenPropertyDoc property = new ZenPropertyDoc(name, type);
|
|
|
|
|
property.setCanGet(true);
|
|
|
|
|
property.setComment(comment);
|
|
|
|
|
staticProperties.put(name, property);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (fullName.equals("stanhebben.zenscript.annotations.ZenOperator")) {
|
|
|
|
|
String operator = annotation.elementValues()[0].value().value().toString();
|
|
|
|
|
operators.add(new ZenOperatorDoc(operator, method));
|
|
|
|
|
} else if (fullName.equals("stanhebben.zenscript.annotations.ZenCaster")) {
|
|
|
|
|
casters.add(new ZenCasterDoc(method));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (ZenExpansionDoc expansion : doc.getExpansions()) {
|
2014-07-09 12:29:46 +02:00
|
|
|
for (MethodDoc method : expansion.getDoc().methods()) {
|
|
|
|
|
for (AnnotationDesc annotation : method.annotations()) {
|
|
|
|
|
String fullName = annotation.annotationType().qualifiedName();
|
|
|
|
|
|
|
|
|
|
if (fullName.equals("stanhebben.zenscript.annotations.ZenMethod")
|
|
|
|
|
|| fullName.equals("stanhebben.zenscript.annotations.ZenMethodStatic")) {
|
|
|
|
|
String name = annotation.elementValues().length > 0
|
|
|
|
|
? (String) (annotation.elementValues()[0].value().value())
|
|
|
|
|
: "";
|
|
|
|
|
|
|
|
|
|
if (name.length() == 0) {
|
|
|
|
|
name = method.name();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<ZenParameterDoc> parameters = new ArrayList<ZenParameterDoc>();
|
|
|
|
|
for (Parameter parameter : method.parameters()) {
|
|
|
|
|
parameters.add(new ZenParameterDoc(parameter));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (fullName.equals("stanhebben.zenscript.annotations.ZenMethodStatic")) {
|
|
|
|
|
staticMethods.add(new ZenMethodDoc(name, method, parameters));
|
|
|
|
|
} else {
|
|
|
|
|
instanceMethods.add(new ZenMethodDoc(name, method, parameters.subList(1, parameters.size())));
|
|
|
|
|
}
|
|
|
|
|
} else if (fullName.equals("stanhebben.zenscript.annotations.ZenGetter")) {
|
|
|
|
|
String name = annotation.elementValues().length > 0
|
|
|
|
|
? (String) (annotation.elementValues()[0].value().value())
|
|
|
|
|
: "";
|
|
|
|
|
|
|
|
|
|
if (name.length() == 0) {
|
|
|
|
|
name = method.name();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Type type = method.returnType();
|
|
|
|
|
String[] comment = StringUtil.splitParagraphs(method.commentText());
|
|
|
|
|
|
|
|
|
|
if (!method.isStatic()) {
|
|
|
|
|
if (instanceProperties.containsKey(name)) {
|
|
|
|
|
ZenPropertyDoc property = instanceProperties.get(name);
|
|
|
|
|
property.setCanGet(true);
|
|
|
|
|
property.setComment(comment);
|
|
|
|
|
} else {
|
|
|
|
|
ZenPropertyDoc property = new ZenPropertyDoc(name, type);
|
|
|
|
|
property.setCanGet(true);
|
|
|
|
|
property.setComment(comment);
|
|
|
|
|
instanceProperties.put(name, property);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (staticProperties.containsKey(name)) {
|
|
|
|
|
ZenPropertyDoc property = staticProperties.get(name);
|
|
|
|
|
property.setCanGet(true);
|
|
|
|
|
property.setComment(comment);
|
|
|
|
|
} else {
|
|
|
|
|
ZenPropertyDoc property = new ZenPropertyDoc(name, type);
|
|
|
|
|
property.setCanGet(true);
|
|
|
|
|
property.setComment(comment);
|
|
|
|
|
staticProperties.put(name, property);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (fullName.equals("stanhebben.zenscript.annotations.ZenSetter")) {
|
|
|
|
|
String name = annotation.elementValues().length > 0
|
|
|
|
|
? (String) (annotation.elementValues()[0].value().value())
|
|
|
|
|
: "";
|
|
|
|
|
|
|
|
|
|
if (name.length() == 0) {
|
|
|
|
|
name = method.name();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Type type = method.parameters()[1].type();
|
|
|
|
|
String[] comment = StringUtil.splitParagraphs(method.commentText());
|
|
|
|
|
|
|
|
|
|
if (!method.isStatic()) {
|
|
|
|
|
if (instanceProperties.containsKey(name)) {
|
|
|
|
|
ZenPropertyDoc property = instanceProperties.get(name);
|
|
|
|
|
property.setCanSet(true);
|
|
|
|
|
} else {
|
|
|
|
|
ZenPropertyDoc property = new ZenPropertyDoc(name, type);
|
|
|
|
|
property.setCanGet(true);
|
|
|
|
|
property.setComment(comment);
|
|
|
|
|
instanceProperties.put(name, property);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (staticProperties.containsKey(name)) {
|
|
|
|
|
ZenPropertyDoc property = staticProperties.get(name);
|
|
|
|
|
property.setCanSet(true);
|
|
|
|
|
} else {
|
|
|
|
|
ZenPropertyDoc property = new ZenPropertyDoc(name, type);
|
|
|
|
|
property.setCanGet(true);
|
|
|
|
|
property.setComment(comment);
|
|
|
|
|
staticProperties.put(name, property);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (fullName.equals("stanhebben.zenscript.annotations.ZenOperator")) {
|
|
|
|
|
String operator = annotation.elementValues()[0].value().value().toString();
|
|
|
|
|
operators.add(new ZenOperatorDoc(operator, method));
|
|
|
|
|
} else if (fullName.equals("stanhebben.zenscript.annotations.ZenCaster")) {
|
|
|
|
|
casters.add(new ZenCasterDoc(method));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-06-12 21:37:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!staticProperties.isEmpty()) {
|
|
|
|
|
writer.append("<div class=\"panel panel-info panel-memberlist\">");
|
|
|
|
|
writer.append("<div class=\"panel-heading\">Static Properties</div>");
|
|
|
|
|
writer.append("<div class=\"panel-body\">");
|
|
|
|
|
writer.append("<table class=\"table table-properties table-bordered\"><tbody>");
|
|
|
|
|
|
|
|
|
|
String[] names = new String[staticProperties.size()];
|
|
|
|
|
int namei = 0;
|
|
|
|
|
for (String name : staticProperties.keySet()) {
|
|
|
|
|
names[namei++] = name;
|
|
|
|
|
}
|
|
|
|
|
Arrays.sort(names);
|
|
|
|
|
|
|
|
|
|
for (String name : names) {
|
|
|
|
|
ZenPropertyDoc property = staticProperties.get(name);
|
|
|
|
|
|
|
|
|
|
writer.append("<tr>");
|
|
|
|
|
writer.append("<td class=\"property-type\">");
|
2014-07-09 12:29:46 +02:00
|
|
|
outputType(writer, property.getType(), classesByJavaName, baseUrl);
|
2014-06-12 21:37:56 +02:00
|
|
|
writer.append("</td>");
|
|
|
|
|
writer.append("<td>");
|
|
|
|
|
writer.append("<div class=\"property-name\">");
|
|
|
|
|
if (!property.isCanSet()) writer.append("<span class=\"fa fa-lock\" style=\"color: #ccc;\" title=\"cannot be set\"></span> ");
|
|
|
|
|
writer.append("<a href=\"#property-staticvalue\">")
|
|
|
|
|
.append(property.getName())
|
|
|
|
|
.append("</a></div>");
|
|
|
|
|
if (property.getComment() != null && property.getComment().length > 0) {
|
|
|
|
|
writer.append("<div class=\"property-intro\">")
|
|
|
|
|
.append(property.getComment()[0])
|
|
|
|
|
.append("</div>");
|
|
|
|
|
}
|
|
|
|
|
writer.append("</td></tr>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
writer.append("</tbody></table></div></div>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!instanceProperties.isEmpty()) {
|
|
|
|
|
writer.append("<div class=\"panel panel-info panel-memberlist\">");
|
|
|
|
|
writer.append("<div class=\"panel-heading\">Properties</div>");
|
|
|
|
|
writer.append("<div class=\"panel-body\">");
|
|
|
|
|
writer.append("<table class=\"table table-properties table-bordered\"><tbody>");
|
|
|
|
|
|
|
|
|
|
String[] names = new String[instanceProperties.size()];
|
|
|
|
|
int namei = 0;
|
|
|
|
|
for (String name : instanceProperties.keySet()) {
|
|
|
|
|
names[namei++] = name;
|
|
|
|
|
}
|
|
|
|
|
Arrays.sort(names);
|
|
|
|
|
|
|
|
|
|
for (String name : names) {
|
|
|
|
|
ZenPropertyDoc property = instanceProperties.get(name);
|
|
|
|
|
|
|
|
|
|
writer.append("<tr>");
|
|
|
|
|
writer.append("<td class=\"property-type\">");
|
2014-07-09 12:29:46 +02:00
|
|
|
outputType(writer, property.getType(), classesByJavaName, baseUrl);
|
2014-06-12 21:37:56 +02:00
|
|
|
writer.append("</td>");
|
|
|
|
|
writer.append("<td>");
|
|
|
|
|
writer.append("<div class=\"property-name\">");
|
|
|
|
|
if (!property.isCanSet()) writer.append("<span class=\"fa fa-lock\" style=\"color: #ccc;\" title=\"cannot be set\"></span> ");
|
|
|
|
|
writer.append("<a href=\"#property-staticvalue\">")
|
|
|
|
|
.append(property.getName())
|
|
|
|
|
.append("</a></div>");
|
|
|
|
|
if (property.getComment() != null && property.getComment().length > 0) {
|
|
|
|
|
writer.append("<div class=\"property-intro\">")
|
|
|
|
|
.append(property.getComment()[0])
|
|
|
|
|
.append("</div>");
|
|
|
|
|
}
|
|
|
|
|
writer.append("</td></tr>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
writer.append("</tbody></table></div></div>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!staticMethods.isEmpty()) {
|
|
|
|
|
writer.append("<div class=\"panel panel-info panel-memberlist\">");
|
|
|
|
|
writer.append("<div class=\"panel-heading\">Static Methods</div>");
|
|
|
|
|
writer.append("<div class=\"panel-body\">");
|
|
|
|
|
writer.append("<table class=\"table table-properties table-bordered\"><tbody>");
|
|
|
|
|
|
|
|
|
|
for (ZenMethodDoc method : staticMethods) {
|
|
|
|
|
writer.append("<tr>");
|
|
|
|
|
writer.append("<td class=\"property-type\">");
|
2014-07-09 12:29:46 +02:00
|
|
|
outputType(writer, method.getDoc().returnType(), classesByJavaName, baseUrl);
|
2014-06-12 21:37:56 +02:00
|
|
|
writer.append("</td>");
|
|
|
|
|
writer.append("<td>");
|
|
|
|
|
writer.append("<div class=\"property-name\">");
|
|
|
|
|
writer.append("<a href=\"#property-staticvalue\">")
|
|
|
|
|
.append(method.getName())
|
|
|
|
|
.append("</a>(");
|
|
|
|
|
boolean first = true;
|
|
|
|
|
|
|
|
|
|
for (ZenParameterDoc param : method.getParameters()) {
|
|
|
|
|
if (param.isOptional()) writer.append("<span class=\"param-optional\">");
|
|
|
|
|
if (first) {
|
|
|
|
|
first = false;
|
|
|
|
|
} else {
|
|
|
|
|
writer.append(", ");
|
|
|
|
|
}
|
|
|
|
|
writer.append(param.getName());
|
|
|
|
|
writer.append(" as ");
|
2014-07-09 12:29:46 +02:00
|
|
|
outputType(writer, param.getType(), classesByJavaName, baseUrl);
|
2014-06-12 21:37:56 +02:00
|
|
|
}
|
|
|
|
|
writer.append(")</div>");
|
|
|
|
|
|
|
|
|
|
String[] comment = StringUtil.splitParagraphs(method.getDoc().commentText());
|
|
|
|
|
if (comment.length > 0) {
|
|
|
|
|
writer.append("<div class=\"property-intro\">")
|
|
|
|
|
.append(comment[0])
|
|
|
|
|
.append("</div>");
|
|
|
|
|
}
|
|
|
|
|
writer.append("</td></tr>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
writer.append("</tbody></table></div></div>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!instanceMethods.isEmpty()) {
|
|
|
|
|
writer.append("<div class=\"panel panel-info panel-memberlist\">");
|
|
|
|
|
writer.append("<div class=\"panel-heading\">Methods</div>");
|
|
|
|
|
writer.append("<div class=\"panel-body\">");
|
|
|
|
|
writer.append("<table class=\"table table-properties table-bordered\"><tbody>");
|
|
|
|
|
|
|
|
|
|
for (ZenMethodDoc method : instanceMethods) {
|
|
|
|
|
writer.append("<tr>");
|
|
|
|
|
writer.append("<td class=\"property-type\">");
|
2014-07-09 12:29:46 +02:00
|
|
|
outputType(writer, method.getDoc().returnType(), classesByJavaName, baseUrl);
|
2014-06-12 21:37:56 +02:00
|
|
|
writer.append("</td>");
|
|
|
|
|
writer.append("<td>");
|
|
|
|
|
writer.append("<div class=\"property-name\">");
|
|
|
|
|
writer.append("<a href=\"#property-staticvalue\">")
|
|
|
|
|
.append(method.getName())
|
|
|
|
|
.append("</a>(");
|
|
|
|
|
boolean first = true;
|
|
|
|
|
|
|
|
|
|
for (ZenParameterDoc param : method.getParameters()) {
|
|
|
|
|
if (param.isOptional()) writer.append("<span class=\"param-optional\">");
|
|
|
|
|
if (first) {
|
|
|
|
|
first = false;
|
|
|
|
|
} else {
|
|
|
|
|
writer.append(", ");
|
|
|
|
|
}
|
|
|
|
|
writer.append(param.getName());
|
|
|
|
|
writer.append(" as ");
|
2014-07-09 12:29:46 +02:00
|
|
|
outputType(writer, param.getType(), classesByJavaName, baseUrl);
|
2014-06-12 21:37:56 +02:00
|
|
|
}
|
|
|
|
|
writer.append(")</div>");
|
|
|
|
|
|
|
|
|
|
String[] comment = StringUtil.splitParagraphs(method.getDoc().commentText());
|
|
|
|
|
if (comment.length > 0) {
|
|
|
|
|
writer.append("<div class=\"property-intro\">")
|
|
|
|
|
.append(comment[0])
|
|
|
|
|
.append("</div>");
|
|
|
|
|
}
|
|
|
|
|
writer.append("</td></tr>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
writer.append("</tbody></table></div></div>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!operators.isEmpty()) {
|
2014-07-09 12:29:46 +02:00
|
|
|
writer.append("<div class=\"panel panel-info panel-memberlist\">");
|
|
|
|
|
writer.append("<div class=\"panel-heading\">Casters</div>");
|
|
|
|
|
writer.append("<div class=\"panel-body\">");
|
|
|
|
|
writer.append("<table class=\"table table-properties table-bordered\"><tbody>");
|
|
|
|
|
|
|
|
|
|
for (ZenOperatorDoc operator : operators) {
|
|
|
|
|
writer.append("<tr>");
|
|
|
|
|
writer.append("<td>");
|
|
|
|
|
writer.append("<div class=\"property-name\">");
|
|
|
|
|
/*writer.append("as <a href=\"#property-staticvalue\">");
|
|
|
|
|
outputTypeRaw(writer, caster.getMethod().returnType(), classesByJavaName);
|
|
|
|
|
writer.append("</a></div>");*/
|
|
|
|
|
|
|
|
|
|
writer.append(operator.getOperator());
|
|
|
|
|
|
|
|
|
|
String[] comment = StringUtil.splitParagraphs(operator.getMethod().commentText());
|
|
|
|
|
if (comment.length > 0) {
|
|
|
|
|
writer.append("<div class=\"property-intro\">")
|
|
|
|
|
.append(comment[0])
|
|
|
|
|
.append("</div>");
|
|
|
|
|
}
|
|
|
|
|
writer.append("</td></tr>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
writer.append("</tbody></table></div></div>");
|
2014-06-12 21:37:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!casters.isEmpty()) {
|
|
|
|
|
writer.append("<div class=\"panel panel-info panel-memberlist\">");
|
|
|
|
|
writer.append("<div class=\"panel-heading\">Casters</div>");
|
|
|
|
|
writer.append("<div class=\"panel-body\">");
|
|
|
|
|
writer.append("<table class=\"table table-properties table-bordered\"><tbody>");
|
|
|
|
|
|
|
|
|
|
for (ZenCasterDoc caster : casters) {
|
|
|
|
|
writer.append("<tr>");
|
|
|
|
|
writer.append("<td>");
|
|
|
|
|
writer.append("<div class=\"property-name\">");
|
|
|
|
|
writer.append("as <a href=\"#property-staticvalue\">");
|
|
|
|
|
outputTypeRaw(writer, caster.getMethod().returnType(), classesByJavaName);
|
|
|
|
|
writer.append("</a></div>");
|
|
|
|
|
|
|
|
|
|
String[] comment = StringUtil.splitParagraphs(caster.getMethod().commentText());
|
|
|
|
|
if (comment.length > 0) {
|
|
|
|
|
writer.append("<div class=\"property-intro\">")
|
|
|
|
|
.append(comment[0])
|
|
|
|
|
.append("</div>");
|
|
|
|
|
}
|
|
|
|
|
writer.append("</td></tr>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
writer.append("</tbody></table></div></div>");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
writer.append("</div></div></div>");
|
|
|
|
|
writer.append("<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js\"></script>");
|
|
|
|
|
writer.append("<script src=\"/js/bootstrap.min.js\"></script>");
|
|
|
|
|
writer.append("<script type=\"application/javascript\">");
|
|
|
|
|
writer.append("$('#collapse-");
|
|
|
|
|
writer.append(pkgName.replace('.', '-'));
|
|
|
|
|
writer.append("').collapse('show');");
|
|
|
|
|
writer.append("</script>");
|
|
|
|
|
writer.append("</body></html>");
|
|
|
|
|
writer.close();
|
|
|
|
|
} catch (IOException ex) {
|
|
|
|
|
System.out.println(ex.getMessage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-10 21:12:55 +02:00
|
|
|
return true;
|
|
|
|
|
}
|
2014-06-12 21:37:56 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* NOTE: Without this method present and returning LanguageVersion.JAVA_1_5,
|
|
|
|
|
* Javadoc will not process generics because it assumes LanguageVersion.JAVA_1_1
|
|
|
|
|
* @return language version (hard coded to LanguageVersion.JAVA_1_5)
|
|
|
|
|
*/
|
|
|
|
|
public static LanguageVersion languageVersion() {
|
|
|
|
|
return LanguageVersion.JAVA_1_5;
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-09 12:29:46 +02:00
|
|
|
private static String buildPackageList(List<ZenClassDoc> classes, String baseurl) {
|
2014-06-12 21:37:56 +02:00
|
|
|
// collect package list
|
|
|
|
|
Map<String, List<ZenClassDoc>> packages = new HashMap<String, List<ZenClassDoc>>();
|
|
|
|
|
for (ZenClassDoc cls : classes) {
|
|
|
|
|
String pkg = cls.getName().substring(0, cls.getName().lastIndexOf('.'));
|
|
|
|
|
if (packages.containsKey(pkg)) {
|
|
|
|
|
packages.get(pkg).add(cls);
|
|
|
|
|
} else {
|
|
|
|
|
ArrayList<ZenClassDoc> classList = new ArrayList<ZenClassDoc>();
|
|
|
|
|
classList.add(cls);
|
|
|
|
|
packages.put(pkg, classList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] packageSorted = new String[packages.size()];
|
|
|
|
|
int packageIndex = 0;
|
|
|
|
|
for (String packageName : packages.keySet()) {
|
|
|
|
|
packageSorted[packageIndex++] = packageName;
|
|
|
|
|
}
|
|
|
|
|
Arrays.sort(packageSorted);
|
|
|
|
|
|
|
|
|
|
// output data
|
|
|
|
|
StringBuilder output = new StringBuilder();
|
|
|
|
|
output.append("<div class=\"col-md-3\">");
|
|
|
|
|
output.append("<div class=\"panel panel-group\"><div class=\"panel-body\">");
|
|
|
|
|
output.append("<div class=\"panel-heading\"><h3>Packages</h3></div>");
|
|
|
|
|
output.append("<div class=\"panel-scroll\">");
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < packageSorted.length; i++) {
|
|
|
|
|
String pkgId = extractId(packageSorted[i]);
|
2014-07-09 12:29:46 +02:00
|
|
|
String pkgDir = baseurl + packageSorted[i].replace('.', '/');
|
2014-06-12 21:37:56 +02:00
|
|
|
|
|
|
|
|
output.append("<div class=\"panel panel-default\">");
|
|
|
|
|
output.append("<div class=\"panel-heading\"><h4 class=\"panel-title package-title\">");
|
|
|
|
|
output.append("<a data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#collapse-")
|
|
|
|
|
.append(pkgId)
|
|
|
|
|
.append("\"><span class=\"glyphicon glyphicon-th-large\"></span> ")
|
|
|
|
|
.append(packageSorted[i])
|
|
|
|
|
.append("</a>");
|
|
|
|
|
output.append("</h4></div>");
|
|
|
|
|
|
|
|
|
|
output.append("<div id=\"collapse-")
|
|
|
|
|
.append(pkgId)
|
|
|
|
|
.append("\" class=\"panel-collapse collapse\">");
|
|
|
|
|
output.append("<div class=\"panel-body\">");
|
|
|
|
|
|
|
|
|
|
// assemble lists
|
|
|
|
|
List<String> interfaceNames = new ArrayList<String>();
|
|
|
|
|
List<String> classNames = new ArrayList<String>();
|
|
|
|
|
|
|
|
|
|
for (ZenClassDoc cls : packages.get(packageSorted[i])) {
|
|
|
|
|
if (cls.getDoc().isInterface()) {
|
|
|
|
|
interfaceNames.add(cls.getDoc().name());
|
|
|
|
|
} else {
|
|
|
|
|
classNames.add(cls.getDoc().name());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Collections.sort(interfaceNames);
|
|
|
|
|
Collections.sort(classNames);
|
|
|
|
|
|
|
|
|
|
if (!interfaceNames.isEmpty()) {
|
|
|
|
|
output.append("<h4 class=\"interfaces-title\">Interfaces</h4>");
|
|
|
|
|
output.append("<table class=\"table table-classes\"><tbody>");
|
|
|
|
|
|
|
|
|
|
for (String ifaceName : interfaceNames) {
|
|
|
|
|
output.append("<tr><td><a href=\"")
|
|
|
|
|
.append(pkgDir).append('/').append(ifaceName).append(".html")
|
|
|
|
|
.append("\">")
|
|
|
|
|
.append(ifaceName)
|
|
|
|
|
.append("</a></td></tr>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
output.append("</tbody></table>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!classNames.isEmpty()) {
|
|
|
|
|
output.append("<h4 class=\"classes-title\">Classes</h4>");
|
|
|
|
|
output.append("<table class=\"table table-classes\"><tbody>");
|
|
|
|
|
|
|
|
|
|
for (String className : classNames) {
|
|
|
|
|
output.append("<tr><td><a href=\"")
|
|
|
|
|
.append(pkgDir).append('/').append(className).append(".html")
|
|
|
|
|
.append("\">")
|
|
|
|
|
.append(className)
|
|
|
|
|
.append("</a></td></tr>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
output.append("</tbody></table>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
output.append("</div></div></div>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
output.append("</div></div></div></div>");
|
|
|
|
|
return output.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static String extractId(String pkg) {
|
|
|
|
|
return pkg.replace('.', '-');
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-09 12:29:46 +02:00
|
|
|
private static void outputType(Writer output, Type type, Map<String, ZenClassDoc> javaClasses, String baseUrl) throws IOException {
|
2014-06-12 21:37:56 +02:00
|
|
|
if (javaClasses.containsKey(type.qualifiedTypeName())) {
|
|
|
|
|
ZenClassDoc doc = javaClasses.get(type.qualifiedTypeName());
|
|
|
|
|
output.append("<a href=\"");
|
2014-07-09 12:29:46 +02:00
|
|
|
output.append(makeLink(doc.getName(), baseUrl));
|
2014-06-12 21:37:56 +02:00
|
|
|
output.append("\">");
|
|
|
|
|
output.append(doc.getName().substring(doc.getName().lastIndexOf('.') + 1));
|
|
|
|
|
output.append("</a>");
|
|
|
|
|
} else if (type.qualifiedTypeName().equals("java.util.List")) {
|
|
|
|
|
Type base = type.asParameterizedType().typeArguments()[0];
|
2014-07-09 12:29:46 +02:00
|
|
|
outputType(output, base, javaClasses, baseUrl);
|
2014-06-12 21:37:56 +02:00
|
|
|
output.append("[]");
|
|
|
|
|
} else if (type.qualifiedTypeName().equals("java.util.Map")) {
|
|
|
|
|
Type key = type.asParameterizedType().typeArguments()[0];
|
|
|
|
|
Type value = type.asParameterizedType().typeArguments()[1];
|
2014-07-09 12:29:46 +02:00
|
|
|
outputType(output, value, javaClasses, baseUrl);
|
2014-06-12 21:37:56 +02:00
|
|
|
output.append('[');
|
2014-07-09 12:29:46 +02:00
|
|
|
outputType(output, key, javaClasses, baseUrl);
|
2014-06-12 21:37:56 +02:00
|
|
|
output.append(']');
|
|
|
|
|
} else if (type.qualifiedTypeName().equals("java.lang.String")) {
|
|
|
|
|
output.append("string");
|
|
|
|
|
} else {
|
|
|
|
|
output.append(type.qualifiedTypeName());
|
|
|
|
|
}
|
2014-07-09 12:29:46 +02:00
|
|
|
|
|
|
|
|
output.append(type.dimension());
|
2014-06-12 21:37:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void outputTypeRaw(Writer output, Type type, Map<String, ZenClassDoc> javaClasses) throws IOException {
|
|
|
|
|
if (javaClasses.containsKey(type.qualifiedTypeName())) {
|
|
|
|
|
ZenClassDoc doc = javaClasses.get(type.qualifiedTypeName());
|
|
|
|
|
output.append(doc.getName().substring(doc.getName().lastIndexOf('.') + 1));
|
|
|
|
|
} else if (type.qualifiedTypeName().equals("java.util.List")) {
|
|
|
|
|
Type base = type.asParameterizedType().typeArguments()[0];
|
|
|
|
|
outputTypeRaw(output, base, javaClasses);
|
|
|
|
|
output.append("[]");
|
|
|
|
|
} else if (type.qualifiedTypeName().equals("java.util.Map")) {
|
|
|
|
|
Type key = type.asParameterizedType().typeArguments()[0];
|
|
|
|
|
Type value = type.asParameterizedType().typeArguments()[1];
|
|
|
|
|
outputTypeRaw(output, value, javaClasses);
|
|
|
|
|
output.append('[');
|
|
|
|
|
outputTypeRaw(output, key, javaClasses);
|
|
|
|
|
output.append(']');
|
|
|
|
|
} else if (type.qualifiedTypeName().equals("java.lang.String")) {
|
|
|
|
|
output.append("string");
|
|
|
|
|
} else {
|
|
|
|
|
output.append(type.qualifiedTypeName());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-09 12:29:46 +02:00
|
|
|
private static String makeLink(String className, String baseUrl) {
|
|
|
|
|
return baseUrl + className.replace('.', '/') + ".html";
|
2014-06-12 21:37:56 +02:00
|
|
|
}
|
2014-06-10 21:12:55 +02:00
|
|
|
}
|