use of com.zimbra.doc.soap.ApiClassDocumentation in project zm-mailbox by Zimbra.
the class DocletApiListener method processClass.
private void processClass(ClassDoc classDoc) {
ApiClassDocumentation doc = new ApiClassDocumentation();
processClassTags(doc, classDoc.tags());
for (FieldDoc fieldDoc : classDoc.fields()) {
processFieldTags(doc, fieldDoc);
}
for (MethodDoc methodDoc : classDoc.methods()) {
processMethodTags(doc, methodDoc);
}
if (doc.hasDocumentation()) {
docMap.put(classDoc.toString(), doc);
}
}
use of com.zimbra.doc.soap.ApiClassDocumentation in project zm-mailbox by Zimbra.
the class ZmApiDoclet method start.
/**
* Starts processing the classes at the root document
*
* @param root the root document
* @throws IOException
* @throws SoapDocException
*/
public static boolean start(RootDoc root) throws IOException, SoapDocException {
if (apiListener == null) {
setListener(new DocletApiListener());
}
apiListener.processJavadocResults(root);
// map between class name and associated documentation
Map<String, ApiClassDocumentation> javadocInfo = apiListener.getDocMap();
readOptions(root.options());
Root soapApiDataModelRoot = WsdlDocGenerator.processJaxbClasses(javadocInfo);
// process FreeMarker templates
Properties templateContext = new Properties();
templateContext.setProperty(TemplateHandler.PROP_TEMPLATES_DIR, templatesDir);
templateContext.setProperty(TemplateHandler.PROP_OUTPUT_DIR, outputDir);
templateContext.setProperty(TemplateHandler.PROP_BUILD_VERSION, buildVersion);
templateContext.setProperty(TemplateHandler.PROP_BUILD_DATE, buildDate);
// generate the API Reference documentation
ApiReferenceTemplateHandler templateHandler = new ApiReferenceTemplateHandler(templateContext);
templateHandler.process(soapApiDataModelRoot);
// generate a JSON representation of the API used when creating a changelog
SoapApiDescription jsonDesc = new SoapApiDescription(buildVersion, buildDate);
jsonDesc.build(soapApiDataModelRoot);
File json = new File(apiDescriptionJson);
jsonDesc.serializeToJson(json);
return true;
}
Aggregations