Search in sources :

Example 1 with ControllerBuilder

use of com.iggroup.oss.restdoclet.doclet.type.builder.ControllerBuilder in project RESTdoclet by IG-Group.

the class XmlDoclet method controllerDocs.

/**
    * Generates Java documentation for controllers.
    * 
    * @param rootDoc the root Java documentation object.
    * @throws IoException
    * @throws JiBXException
    */
public static void controllerDocs(final RootDoc rootDoc) throws IOException, JiBXException {
    LOG.info("Finding controllers.....");
    Boolean found = false;
    for (ClassDoc classDoc : rootDoc.classes()) {
        LOG.debug("Controller? " + classDoc.qualifiedName() + ".java");
        if (isAnnotated(classDoc, org.springframework.stereotype.Controller.class)) {
            LOG.info("Found controller.  Generating javadoc xml for " + classDoc.qualifiedName() + ".java");
            marshallController(new ControllerBuilder().build(new Controller(), classDoc), DocletUtils.documentationFile(classDoc));
            found = true;
        }
    }
    if (!found) {
        throw new IllegalArgumentException("No controllers with Spring @Controller annotation found");
    }
    LOG.info("Done finding controllers.");
}
Also used : ControllerBuilder(com.iggroup.oss.restdoclet.doclet.type.builder.ControllerBuilder) Controller(com.iggroup.oss.restdoclet.doclet.type.Controller) JiBXUtils.marshallController(com.iggroup.oss.restdoclet.doclet.util.JiBXUtils.marshallController) ClassDoc(com.sun.javadoc.ClassDoc)

Aggregations

Controller (com.iggroup.oss.restdoclet.doclet.type.Controller)1 ControllerBuilder (com.iggroup.oss.restdoclet.doclet.type.builder.ControllerBuilder)1 JiBXUtils.marshallController (com.iggroup.oss.restdoclet.doclet.util.JiBXUtils.marshallController)1 ClassDoc (com.sun.javadoc.ClassDoc)1