Class Javadoc
- All Implemented Interfaces:
Generator, Renamable, ResourceProvider
The Javadoc generator provides the resource JavadocDirectory,
a directory that contains generated javadoc files.
No attempt is made to define dedicated types for Javadoc tool options.
Instead, options are passed as strings, as suggested by the
ToolProvider API. Notable exceptions exist for options that are
directly related to resource types originating from the builder
context (such as files, directory trees, and paths).
By default, the generator builds the Javadoc for the project passed
to the constructor. In some cases – such as generating a shared
Javadoc for multiple projects – this behavior is not desired. In
these cases, the project(s) for which Javadoc is generated can be
configured via projects(Stream).
The classpath for the Javadoc tool invocation is assembled by requesting
the ClasspathElements with intents Consume,
Reveal and Expose from the configured
project(s).
The JavaSourceFiles to be processed are obtained by requesting
resources of JavaTypes.JavaSourceTreeType with intents
Supply and Expose from the configured
project(s). This default behavior can be overridden by setting the
sources explicitly using one or more invocations of the addSources
methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal JavadocaddSources(Path directory, String pattern) Adds the files from the given directory matching the given pattern.final JavadocaddSources(Stream<FileTree<JavaSourceFile>> sources) Adds the sources.final JavadocaddSources(FileTree<JavaSourceFile>... sources) Adds the source tree.Returns the destination directory.destination(Path destination) Sets the destination directory.protected <T extends Resource>
Collection<T> doProvide(ResourceRequest<T> requested) Invoked byResourceProviderSpi.provide(ResourceRequest)after checking if the invocation is allowed.Sets the projects to generate javadoc for.tagletpath(Stream<ClasspathElement> classpathElements) Adds the given elements to the taglepath.Adds the given taglets.Methods inherited from class JavaTool
logDiagnostic, logDiagnostics, optionArgument, options, options, optionsMethods inherited from class AbstractGenerator
cleanup, name, project, toStringMethods inherited from class AbstractProvider
context, name, of, rename, vavrStreamMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ResourceProvider
context, name, of, resources
-
Constructor Details
-
Javadoc
-
-
Method Details
-
projects
-
destination
Returns the destination directory. Defaults to "doc".- Returns:
- the destination
-
destination
Sets the destination directory. ThePathis resolved against the project's build directory (seeProject.buildDirectory()).- Parameters:
destination- the new destination- Returns:
- the javadoc generator
-
addSources
Adds the source tree.- Parameters:
sources- the sources- Returns:
- the javadoc generator
-
addSources
Adds the files from the given directory matching the given pattern. Short foraddSources(project().newFileTree(directory, pattern, JavaSourceFile.class)).- Parameters:
directory- the directorypattern- the pattern- Returns:
- the javadoc generator
-
addSources
Adds the sources.- Parameters:
sources- the sources- Returns:
- the java compiler
-
tagletpath
Adds the given elements to the taglepath.- Parameters:
classpathElements- the classpath elements- Returns:
- the javadoc
-
taglets
-
doProvide
Description copied from class:AbstractProviderInvoked byResourceProviderSpi.provide(ResourceRequest)after checking if the invocation is allowed.- Specified by:
doProvidein classAbstractProvider- Type Parameters:
T- the generic type- Parameters:
requested- the request for resources- Returns:
- the stream
-