The ChainDoclet is useful when producing documentation in a variety of formats (possibly using multiple doclets) in very large projects (i.e. projects where it takes a lot of time for javadoc to analyze and process the source code). Using the ChainDoclet allows you to save time by only having to analyze the source code once and then sending the metadata to multiple doclets without re-analyzing the source code between each doclet invokation.

Using multiple doclets in a single Javadoc invokation is useful, for example, when generating Maven sites and it is desired to use multiple doclets to produce a set of "reports" instead of only the usual Javadoc API "reports".

Using this doclet is pretty straight forward. In your pom.xml you define a sequence of doclets to run, assign an identifier to each of them and add this identifier to all doclet parameters that should be sent to that particular doclet.

Example:

<additionalparam xmlns="http://maven.apache.org/POM/4.0.0"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                                -format.name extensive
                                -format.property.wrapListElements true
                                -format.property.showAnnotations true
                                -output ${project.build.sourceDirectory}/../../site/xdoc/index.xml
                                -transformer ${project.build.sourceDirectory}/../../site/index.xslt
                                -untransformedoutput ./source-code-documentation.xml
                            </additionalparam>

Required Javadoc Configuration

Make sure Javadoc is started with these options:

  • doclet set to info.mikaelsvensson.devtools.doclet.chain.ChainDoclet
  • docletpath set to the path of doclet.jar.

For more information about how to make Javadoc use this Doclet, check out the Getting Started pages:

Doclet Configuration Options

These options are used only by the ChainDoclet doclet (they are specified in the same way as other Javadoc options).

chain

The doclet's only configuration option, but it is used for two things:

  1. to define a custom prefix used to determine which options should be relayed to the doclet at hand
  2. to define the doclet at hand

The format is simple: prefix:full-doclet-class-name.

Example:

firstdocet:full.doclet.class.name

Back to top

Reflow Maven skin by Andrius Velykis.