Package | Class | Use | Tree | Deprecated | Index | Help
| Doclet API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.javadoc
Class Doclet

    java.lang.Object
      com.sun.javadoc.Doclet

public abstract class Doclet
extends Object

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`. To start the doclet, you pass `-doclet` followed by the fully-qualified name of the starting class on the javadoc tool command line.

Constructor Summary
`Doclet()`

Method Summary
`static int` | `optionLength(String option)` Check for doclet-added options.
`static boolean` | `start(RootDoc root)` Generate documentation here.
`static boolean` | `validOptions(String[][] options, DocErrorReporter reporter)` Check that options have the correct arguments.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Doclet

    public Doclet()

Method Detail

### start

    public static boolean start(RootDoc root)

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

  Returns:
    true on success.

### optionLength

    public static int optionLength(String option)

  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.

  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)

  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.

  Returns:
    true if the options are valid.

Package | Class | Use | Tree | Deprecated | Index | Help
| Doclet API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a bug or feature
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2003 Sun Microsystems, Inc. 4150 Network Circle
Santa Clara, California, 95054, U.S.A. All Rights Reserved.