Class Doclet

@Deprecated(since="9",
            forRemoval=true)
public abstract class Doclet
extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
The declarations in this package have been superseded by those in the package jdk.javadoc.doclet. For more information, see the Migration Guide in the documentation for that package.

This is an example of a starting class for a doclet, showing the entry-point methods. A starting class must import com.sun.javadoc.* and implement the start(RootDoc) method, as described in the package description. If the doclet takes command line options, it must also implement optionLength and validOptions.

A doclet supporting the language features added since 1.1 (such as generics and annotations) should indicate this by implementing languageVersion. In the absence of this the doclet should not invoke any of the Doclet API methods added since 1.5, and the results of several other methods are modified so as to conceal the new constructs (such as type parameters) from the doclet.

To start the doclet, pass -doclet followed by the fully-qualified name of the starting class on the javadoc tool command line.

Constructors

Constructor Description
Doclet()

Deprecated, for removal: This API element is subject to removal in a future version.

Methods

Modifier and Type Method Description
static LanguageVersion languageVersion()

Deprecated, for removal: This API element is subject to removal in a future version.

Return the version of the Java Programming Language supported by this doclet.

static int optionLength​(String option)

Deprecated, for removal: This API element is subject to removal in a future version.

Check for doclet-added options.

static boolean start​(RootDoc root)

Deprecated, for removal: This API element is subject to removal in a future version.

Generate documentation here.

static boolean validOptions​(String[][] options, DocErrorReporter reporter)

Deprecated, for removal: This API element is subject to removal in a future version.

Check that options have the correct arguments.

Methods declared in class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

Doclet

public Doclet()
Deprecated, for removal: This API element is subject to removal in a future version.

Methods

start

public static boolean start(RootDoc root)
Deprecated, for removal: This API element is subject to removal in a future version.

Generate documentation here. This method is required for all doclets.

Parameters:
root - Supply the RootDoc to the method.
Returns:
true on success.

optionLength

public static int optionLength(String option)
Deprecated, for removal: This API element is subject to removal in a future version.

Check for doclet-added options. Returns the number of arguments you must specify on the command line for the given option. For example, "-d docs" would return 2.

This method is required if the doclet contains any options. If this method is missing, Javadoc will print an invalid flag error for every option.

Parameters:
option - the option for which the number of arguements is returned.
Returns:
number of arguments on the command line for an option including the option name itself. Zero return means option not known. Negative value means error occurred.

validOptions

public static boolean validOptions(String[][] options,
                                   DocErrorReporter reporter)
Deprecated, for removal: This API element is subject to removal in a future version.

Check that options have the correct arguments.

This method is not required, but is recommended, as every option will be considered valid if this method is not present. It will default gracefully (to true) if absent.

Printing option related error messages (using the provided DocErrorReporter) is the responsibility of this method.

Parameters:
options - Supply valid options as an array of Strings.
reporter - The DocErrorReporter responsible for these options.
Returns:
true if the options are valid.

languageVersion

public static LanguageVersion languageVersion()
Deprecated, for removal: This API element is subject to removal in a future version.

Return the version of the Java Programming Language supported by this doclet.

This method is required by any doclet supporting a language version newer than 1.1.

Returns:
the language version supported by this doclet.
Since:
1.5

© 1993, 2020, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/11/docs/api/jdk.javadoc/com/sun/javadoc/Doclet.html