APIdia Launch Partner
Top Description Inners Methods
jdk.javadoc.doclet

public Interface Doclet

Known Direct Implementers
jdk.javadoc.doclet.StandardDoclet, jdk.javadoc.internal.doclets.toolkit.AbstractDoclet
Imports
java.util.List, .Locale, .Set, javax.lang.model.SourceVersion

The user doclet must implement this interface, as described in the package description. Each implementation of a Doclet must provide a public no-argument constructor to be used by tools to instantiate the doclet. The tool infrastructure will interact with classes implementing this interface as follows:
  1. The tool will create an instance of a doclet using the no-arg constructor of the doclet class.
  2. Next, the tool calls the init method with an appropriate locale and reporter.
  3. Afterwards, the tool calls getSupportedOptions, and getSupportedSourceVersion. These methods are only called once.
  4. As appropriate, the tool calls the run method on the doclet object, giving it a DocletEnvironment object, from which the doclet can determine the elements to be included in the documentation.

If a doclet object is created and used without the above protocol being followed, then the doclet's behavior is not defined by this interface specification.

To start the doclet, pass -doclet followed by the fully-qualified name of the entry point class (i.e. the implementation of this interface) on the javadoc tool command line.

Since
9

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
Doclet.Option

An encapsulation of option name, aliases, parameters and descriptions as used by the Doclet.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

name of the Doclet
getName
()

Returns a name identifying the doclet.

public Set<? extends Doclet.Option>

Returns:

a set containing all the supported options, an empty set if none
getSupportedOptions
()

Returns all the supported options.

public SourceVersion

Returns:

the language version supported by this doclet, usually the latest version
getSupportedSourceVersion
()

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

public void
init(Locale
the locale to be used
locale
,
Reporter
the reporter to be used
reporter
)

Initializes this doclet with the given locale and error reporter.

public boolean

Returns:

true on success
run
(DocletEnvironment
from which essential information can be extracted
environment
)

The entry point of the doclet.

Method Detail

getNameback to summary
public String getName()

Returns a name identifying the doclet. A name is a simple identifier without white spaces, as defined in The Java Language Specification, section 6.2 "Names and Identifiers".

Returns:String

name of the Doclet

getSupportedOptionsback to summary
public Set<? extends Doclet.Option> getSupportedOptions()

Returns all the supported options.

Returns:Set<? extends Doclet.Option>

a set containing all the supported options, an empty set if none

getSupportedSourceVersionback to summary
public SourceVersion getSupportedSourceVersion()

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

Returns:SourceVersion

the language version supported by this doclet, usually the latest version

initback to summary
public void init(Locale locale, Reporter reporter)

Initializes this doclet with the given locale and error reporter. This locale will be used by the reporter and the doclet components.

Parameters
locale:Locale

the locale to be used

reporter:Reporter

the reporter to be used

runback to summary
public boolean run(DocletEnvironment environment)

The entry point of the doclet. Further processing will commence as instructed by this method.

Parameters
environment:DocletEnvironment

from which essential information can be extracted

Returns:boolean

true on success

jdk.javadoc.doclet back to summary

public Interface Doclet.Option

Known Direct Implementers
jdk.javadoc.internal.doclets.toolkit.BaseOptions.Option

An encapsulation of option name, aliases, parameters and descriptions as used by the Doclet.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
Doclet.Option.Kind

The kind of an option.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

number of consumed arguments
getArgumentCount
()

Returns the number of arguments, this option will consume.

public String

Returns:

description if set, otherwise an empty String
getDescription
()

Returns the description of the option.

public Doclet.Option.Kind

Returns:

the kind of this option
getKind
()

Returns the option kind.

public List<String>

Returns:

the names of the option
getNames
()

Returns the list of names that may be used to identify the option.

public String

Returns:

parameters if set, otherwise an empty String
getParameters
()

Returns the parameters of the option.

public boolean

Returns:

true if operation succeeded, false otherwise
process
(String
the option
option
,
List<String>
a list encapsulating the arguments
arguments
)

Processes the option and arguments as needed.

Method Detail

getArgumentCountback to summary
public int getArgumentCount()

Returns the number of arguments, this option will consume.

Returns:int

number of consumed arguments

getDescriptionback to summary
public String getDescription()

Returns the description of the option. For instance, the option "group", would return the synopsis of the option such as, "groups the documents".

Returns:String

description if set, otherwise an empty String

getKindback to summary
public Doclet.Option.Kind getKind()

Returns the option kind.

Returns:Doclet.Option.Kind

the kind of this option

getNamesback to summary
public List<String> getNames()

Returns the list of names that may be used to identify the option. For instance, the list could be ["-classpath", "--class-path"] for the option "-classpath", with an alias "--class-path".

Returns:List<String>

the names of the option

getParametersback to summary
public String getParameters()

Returns the parameters of the option. For instance "name <p1>:<p2>.."

Returns:String

parameters if set, otherwise an empty String

processback to summary
public boolean process(String option, List<String> arguments)

Processes the option and arguments as needed. This method will be invoked if the given option name matches the option.

Parameters
option:String

the option

arguments:List<String>

a list encapsulating the arguments

Returns:boolean

true if operation succeeded, false otherwise

jdk.javadoc.doclet back to summary

public final Enum Doclet.Option.Kind

extends Enum<Doclet.Option.Kind>
Class Inheritance

The kind of an option.

Field Summary

Modifier and TypeField and Description
public static final Doclet.Option.Kind
EXTENDED

An extended option, such as those prefixed with -X.

public static final Doclet.Option.Kind
OTHER

An implementation-reserved option.

public static final Doclet.Option.Kind
STANDARD

A standard option.

Constructor Summary

AccessConstructor and Description
private
Kind()

Method Summary

Modifier and TypeMethod and Description
public static Doclet.Option.Kind
public static Doclet.Option.Kind[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

EXTENDEDback to summary
public static final Doclet.Option.Kind EXTENDED

An extended option, such as those prefixed with -X.

OTHERback to summary
public static final Doclet.Option.Kind OTHER

An implementation-reserved option.

STANDARDback to summary
public static final Doclet.Option.Kind STANDARD

A standard option.

Constructor Detail

Kindback to summary
private Kind()

Method Detail

valueOfback to summary
public static Doclet.Option.Kind valueOf(String name)
valuesback to summary
public static Doclet.Option.Kind[] values()