Search in sources :

Example 1 with ApiClassDocumentation

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);
    }
}
Also used : FieldDoc(com.sun.javadoc.FieldDoc) MethodDoc(com.sun.javadoc.MethodDoc) ApiClassDocumentation(com.zimbra.doc.soap.ApiClassDocumentation)

Example 2 with ApiClassDocumentation

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;
}
Also used : ApiReferenceTemplateHandler(com.zimbra.doc.soap.template.ApiReferenceTemplateHandler) Root(com.zimbra.doc.soap.Root) SoapApiDescription(com.zimbra.doc.soap.apidesc.SoapApiDescription) Properties(java.util.Properties) File(java.io.File) ApiClassDocumentation(com.zimbra.doc.soap.ApiClassDocumentation)

Aggregations

ApiClassDocumentation (com.zimbra.doc.soap.ApiClassDocumentation)2 FieldDoc (com.sun.javadoc.FieldDoc)1 MethodDoc (com.sun.javadoc.MethodDoc)1 Root (com.zimbra.doc.soap.Root)1 SoapApiDescription (com.zimbra.doc.soap.apidesc.SoapApiDescription)1 ApiReferenceTemplateHandler (com.zimbra.doc.soap.template.ApiReferenceTemplateHandler)1 File (java.io.File)1 Properties (java.util.Properties)1