HomeDownloadsUser GuideDevelopmentLegal

User Guide: Shutdown Taglets

This section of the user guide describes the shutdown taglets of the Taglets Collection.

Overview

Shutdown taglets are handy taglets that perform cleanup operations once JavaDoc has finished its work.

To define a shutdown taglet use the following options (example shows the default stylesheet file copier):

Taglets.shutdown.javadoc-stylesheet-copy= net.sourceforge.taglets.simple.shutdown.FileCopier
Taglets.shutdown.javadoc-stylesheet-copy.files= rsrc/stylesheet.css
Taglets.shutdown.javadoc-stylesheet-copy.todir= .

Basic syntax of shutdown taglets is:

Taglets.shutdown.<name>= <taglet-class>
Taglets.shutdown.<name>.someoption= SomeValue

You can define any number of shutdown taglets, the Taglets Collection picks them up from the merged configuration at the startup.

Default Shutdown Taglets

At the time of this writing the following shutdown taglet names are used by the default configuration:

Taglets.shutdown.javadoc-overview-fixup
Used to adjust the font size in the overview HTML file generated.
Taglets.shutdown.javadoc-html-fixup
Used to adjust font sizes, table classes, invalid image and link references as well as to remove the superfluous constant see also link generated.
Taglets.shutdown.javadoc-stylesheet-copy
Copies the Taglets Collection stylesheet to the documentation generated.
Taglets.shutdown.javadoc-resource-copy
Copies images and resources required by the stylesheet to the documentation directory generated.
Taglets.shutdown.javadoc-prettify-fixup
Inserts the code prettifier script into all HTML files generated.
Taglets.shutdown.javadoc-prettify-copy
Copies the code prettifier resources to the documentation directory generated.

To see a list of default taglet shutdown hooks please refer to the /META-INF/taglets-default.properties included in taglets.jar.

Shutdown Taglet Classes

The Taglets Collection defines the following taglets that should be used exclusively as shutdown taglets.

Use them in your own configuration files to perform shutdown operations.

Shutdown Taglet Classes Overview

FileCopier

Taglet Class net.sourceforge.taglets.simple.shutdown.FileCopier
Description Copies files from the classpath, the documentation directory or any absolute location to the generated documentation directory (or any absolute location).
Options
*.files= <comma-separated-file-list>
Describes the files to operate on. Comma separate the file names. Since the file copier usually copies files from the classpath to the documentation directory wildcards of any sort are not supported.
*.todir= <directory>
Describes the directory to copy the files to. Relative path names are treated relative to the generated documentation directory. If you need to copy to several directories define more than one shutdown action.

RegexReplacer

Taglet Class net.sourceforge.taglets.simple.shutdown.RegexReplacer
Description Performs text replacements using regular expression patterns on a set of files.
Options
*.files= <pattern>
Describes the files to operate on. Use an Ant file pattern, relative pathes are treated relative to the root directory of the JavaDoc generated.
Example: **/*.html works on all generated HTML files.
*.token.<number>= <regex-token>
Describes a search token. Use any Java compliant regular expression, supports matcher groups.
Numbering of the tokens has to start at zero and for each token defined a corresponding value option has to be defined.
Note: Take care that the backslash has to be escaped in property files, e.g. to escape a '(' in the regular expression use '\\('.
*.value.<number>= <regex-replacement>
Replacement value for token <number>. Matcher groups are supported, e.g. use $1 to include the first group matched in the token.
The value ${docRoot} has a special meaning and is replaced by the relative path to the documentation root.