Search in sources :

Example 1 with ClassExtensionDoc

use of org.gradle.build.docs.dsl.docbook.model.ClassExtensionDoc in project gradle by gradle.

the class BlocksRenderer method renderDetailsTo.

public void renderDetailsTo(ClassDoc classDoc, Element parent) {
    if (hasBlocks(classDoc)) {
        Document document = parent.getOwnerDocument();
        Element detailsSection = document.createElement("section");
        parent.appendChild(detailsSection);
        Element title = document.createElement("title");
        detailsSection.appendChild(title);
        title.appendChild(document.createTextNode("Script block details"));
        for (BlockDoc blockDoc : classDoc.getClassBlocks()) {
            blockDetailRenderer.renderTo(blockDoc, detailsSection);
        }
        for (ClassExtensionDoc extensionDoc : classDoc.getClassExtensions()) {
            for (BlockDoc blockDoc : extensionDoc.getExtensionBlocks()) {
                blockDetailRenderer.renderTo(blockDoc, detailsSection);
            }
        }
    }
}
Also used : ClassExtensionDoc(org.gradle.build.docs.dsl.docbook.model.ClassExtensionDoc) BlockDoc(org.gradle.build.docs.dsl.docbook.model.BlockDoc) Element(org.w3c.dom.Element) Document(org.w3c.dom.Document)

Example 2 with ClassExtensionDoc

use of org.gradle.build.docs.dsl.docbook.model.ClassExtensionDoc in project gradle by gradle.

the class MethodsRenderer method renderSummaryTo.

public void renderSummaryTo(ClassDoc classDoc, Element parent) {
    Document document = parent.getOwnerDocument();
    Element summarySection = document.createElement("section");
    parent.appendChild(summarySection);
    Element title = document.createElement("title");
    summarySection.appendChild(title);
    title.appendChild(document.createTextNode("Methods"));
    Collection<MethodDoc> classMethods = classDoc.getClassMethods();
    if (!classMethods.isEmpty()) {
        Element table = document.createElement("table");
        summarySection.appendChild(table);
        title = document.createElement("title");
        table.appendChild(title);
        title.appendChild(document.createTextNode("Methods - " + classDoc.getSimpleName()));
        methodTableRenderer.renderTo(classMethods, table);
    }
    for (ClassExtensionDoc extensionDoc : classDoc.getClassExtensions()) {
        extensionMethodsSummaryRenderer.renderTo(extensionDoc, summarySection);
    }
    if (!hasMethods(classDoc)) {
        Element para = document.createElement("para");
        summarySection.appendChild(para);
        para.appendChild(document.createTextNode("No methods"));
    }
}
Also used : ClassExtensionDoc(org.gradle.build.docs.dsl.docbook.model.ClassExtensionDoc) MethodDoc(org.gradle.build.docs.dsl.docbook.model.MethodDoc) Element(org.w3c.dom.Element) Document(org.w3c.dom.Document)

Example 3 with ClassExtensionDoc

use of org.gradle.build.docs.dsl.docbook.model.ClassExtensionDoc in project gradle by gradle.

the class PropertiesRenderer method renderSummaryTo.

public void renderSummaryTo(ClassDoc classDoc, Element parent) {
    Document document = parent.getOwnerDocument();
    Element summarySection = document.createElement("section");
    parent.appendChild(summarySection);
    Element title = document.createElement("title");
    summarySection.appendChild(title);
    title.appendChild(document.createTextNode("Properties"));
    Collection<PropertyDoc> classProperties = classDoc.getClassProperties();
    if (!classProperties.isEmpty()) {
        Element table = document.createElement("table");
        summarySection.appendChild(table);
        title = document.createElement("title");
        table.appendChild(title);
        title.appendChild(document.createTextNode("Properties - " + classDoc.getSimpleName()));
        propertyTableRenderer.renderTo(classProperties, table);
    }
    for (ClassExtensionDoc extensionDoc : classDoc.getClassExtensions()) {
        extensionPropertiesSummaryRenderer.renderTo(extensionDoc, summarySection);
    }
    if (!hasProperties(classDoc)) {
        Element para = document.createElement("para");
        summarySection.appendChild(para);
        para.appendChild(document.createTextNode("No properties"));
    }
}
Also used : ClassExtensionDoc(org.gradle.build.docs.dsl.docbook.model.ClassExtensionDoc) Element(org.w3c.dom.Element) PropertyDoc(org.gradle.build.docs.dsl.docbook.model.PropertyDoc) Document(org.w3c.dom.Document)

Example 4 with ClassExtensionDoc

use of org.gradle.build.docs.dsl.docbook.model.ClassExtensionDoc in project gradle by gradle.

the class BlocksRenderer method renderSummaryTo.

public void renderSummaryTo(ClassDoc classDoc, Element parent) {
    Document document = parent.getOwnerDocument();
    Element summarySection = document.createElement("section");
    parent.appendChild(summarySection);
    Element title = document.createElement("title");
    summarySection.appendChild(title);
    title.appendChild(document.createTextNode("Script blocks"));
    Collection<BlockDoc> classBlocks = classDoc.getClassBlocks();
    if (!classBlocks.isEmpty()) {
        Element table = document.createElement("table");
        summarySection.appendChild(table);
        title = document.createElement("title");
        table.appendChild(title);
        title.appendChild(document.createTextNode("Script blocks - " + classDoc.getSimpleName()));
        blockTableRenderer.renderTo(classBlocks, table);
    }
    for (ClassExtensionDoc extensionDoc : classDoc.getClassExtensions()) {
        extensionBlocksSummaryRenderer.renderTo(extensionDoc, summarySection);
    }
    if (!hasBlocks(classDoc)) {
        Element para = document.createElement("para");
        summarySection.appendChild(para);
        para.appendChild(document.createTextNode("No script blocks"));
    }
}
Also used : ClassExtensionDoc(org.gradle.build.docs.dsl.docbook.model.ClassExtensionDoc) BlockDoc(org.gradle.build.docs.dsl.docbook.model.BlockDoc) Element(org.w3c.dom.Element) Document(org.w3c.dom.Document)

Example 5 with ClassExtensionDoc

use of org.gradle.build.docs.dsl.docbook.model.ClassExtensionDoc in project gradle by gradle.

the class MethodsRenderer method renderDetailsTo.

public void renderDetailsTo(ClassDoc classDoc, Element parent) {
    if (hasMethods(classDoc)) {
        Document document = parent.getOwnerDocument();
        Element detailsSection = document.createElement("section");
        parent.appendChild(detailsSection);
        Element title = document.createElement("title");
        detailsSection.appendChild(title);
        title.appendChild(document.createTextNode("Method details"));
        for (MethodDoc methodDoc : classDoc.getClassMethods()) {
            methodDetailRenderer.renderTo(methodDoc, detailsSection);
        }
        for (ClassExtensionDoc extensionDoc : classDoc.getClassExtensions()) {
            for (MethodDoc methodDoc : extensionDoc.getExtensionMethods()) {
                methodDetailRenderer.renderTo(methodDoc, detailsSection);
            }
        }
    }
}
Also used : ClassExtensionDoc(org.gradle.build.docs.dsl.docbook.model.ClassExtensionDoc) MethodDoc(org.gradle.build.docs.dsl.docbook.model.MethodDoc) Element(org.w3c.dom.Element) Document(org.w3c.dom.Document)

Aggregations

ClassExtensionDoc (org.gradle.build.docs.dsl.docbook.model.ClassExtensionDoc)6 Document (org.w3c.dom.Document)6 Element (org.w3c.dom.Element)6 BlockDoc (org.gradle.build.docs.dsl.docbook.model.BlockDoc)2 MethodDoc (org.gradle.build.docs.dsl.docbook.model.MethodDoc)2 PropertyDoc (org.gradle.build.docs.dsl.docbook.model.PropertyDoc)2