public class Javadoc extends Task
Current known limitations are:
If no doclet
is set, then the version
and
author
are by default "yes"
.
Note: This task is run on another VM because the Javadoc code calls
System.exit()
which would break Ant functionality.
Modifier and Type | Class and Description |
---|---|
static class |
Javadoc.AccessType
EnumeratedAttribute implementation supporting the Javadoc scoping
values.
|
class |
Javadoc.DocletInfo
This class stores info about doclets.
|
class |
Javadoc.DocletParam
Inner class used to manage doclet parameters.
|
static class |
Javadoc.ExtensionInfo
A project aware class used for Javadoc extensions which take a name
and a path such as doclet and taglet arguments.
|
class |
Javadoc.GroupArgument
A class corresponding to the group nested element.
|
static class |
Javadoc.Html
An HTML element in the Javadoc.
|
class |
Javadoc.LinkArgument
Represents a link triplet (href, whether link is offline,
location of the package list if off line)
|
static class |
Javadoc.PackageName
Used to track info about the packages to be javadoc'd
|
class |
Javadoc.ResourceCollectionContainer
Holds a collection of ResourceCollections.
|
static class |
Javadoc.SourceFile
This class is used to manage the source files to be processed.
|
class |
Javadoc.TagArgument
Class representing a -tag argument.
|
description, location, project
Constructor and Description |
---|
Javadoc() |
Modifier and Type | Method and Description |
---|---|
void |
addBottom(Javadoc.Html text)
Set the text to be placed at the bottom of each output file.
|
void |
addDoctitle(Javadoc.Html text)
Add a document title to use for the overview page.
|
void |
addExcludePackage(Javadoc.PackageName pn)
Add a package to be excluded from the Javadoc run.
|
void |
addFileset(FileSet fs)
Adds a fileset.
|
void |
addFooter(Javadoc.Html text)
Set the footer text to be placed at the bottom of each output file.
|
void |
addHeader(Javadoc.Html text)
Set the header text to be placed at the top of each output file.
|
void |
addModule(Javadoc.PackageName mn)
Add a single module to be processed.
|
void |
addPackage(Javadoc.PackageName pn)
Add a single package to be processed.
|
void |
addPackageset(DirSet packageSet)
Adds a packageset.
|
void |
addSource(Javadoc.SourceFile sf)
Add a single source file.
|
void |
addTaglet(Javadoc.ExtensionInfo tagletInfo)
Add a taglet
|
Commandline.Argument |
createArg()
Adds a command-line argument.
|
Path |
createBootclasspath()
Create a Path to be configured with the boot classpath
|
Path |
createClasspath()
Create a Path to be configured with the classpath to use
|
Javadoc.DocletInfo |
createDoclet()
Create a doclet to be used in the documentation generation.
|
Javadoc.GroupArgument |
createGroup()
Separates packages on the overview page into whatever
groups you specify, one group per table.
|
Javadoc.LinkArgument |
createLink()
Create link to Javadoc output at the given URL.
|
Path |
createModulePath()
Create a path to be configured with the locations of the module
files.
|
Path |
createModuleSourcePath()
Create a path to be configured with the locations of the module
source files.
|
Javadoc.ResourceCollectionContainer |
createSourceFiles()
Adds a container for resource collections.
|
Path |
createSourcepath()
Create a path to be configured with the locations of the source
files.
|
Javadoc.TagArgument |
createTag()
Creates and adds a -tag argument.
|
void |
execute()
Execute the task.
|
protected java.lang.String |
expand(java.lang.String content)
Convenience method to expand properties.
|
void |
setAccess(Javadoc.AccessType at)
Set the scope to be processed.
|
void |
setAdditionalparam(java.lang.String add)
Set an additional parameter on the command line
|
void |
setAuthor(boolean b)
Include the author tag in the generated documentation.
|
void |
setBootclasspath(Path path)
Set the boot classpath to use.
|
void |
setBootClasspathRef(Reference r)
Adds a reference to a CLASSPATH defined elsewhere.
|
void |
setBottom(java.lang.String bottom)
Set the text to be placed at the bottom of each output file.
|
void |
setBreakiterator(boolean b)
Enables the -linksource switch, will be ignored if Javadoc is not
the 1.4 version.
|
void |
setCharset(java.lang.String src)
Charset for cross-platform viewing of generated documentation.
|
void |
setClasspath(Path path)
Set the classpath to be used for this Javadoc run.
|
void |
setClasspathRef(Reference r)
Adds a reference to a CLASSPATH defined elsewhere.
|
void |
setDefaultexcludes(boolean useDefaultExcludes)
Sets whether default exclusions should be used or not.
|
void |
setDestdir(java.io.File dir)
Set the directory where the Javadoc output will be generated.
|
void |
setDocencoding(java.lang.String enc)
Output file encoding name.
|
void |
setDocFilesSubDirs(boolean b)
Enables deep-copying of
doc-files directories. |
void |
setDoclet(java.lang.String docletName)
Set the class that starts the doclet used in generating the
documentation.
|
void |
setDocletPath(Path docletPath)
Set the classpath used to find the doclet class.
|
void |
setDocletPathRef(Reference r)
Set the classpath used to find the doclet class by reference.
|
void |
setDoctitle(java.lang.String doctitle)
Set the title of the generated overview page.
|
void |
setEncoding(java.lang.String enc)
Set the encoding name of the source files,
|
void |
setExcludeDocFilesSubDir(java.lang.String s)
Colon-separated list of
doc-files subdirectories
to skip if docFilesSubDirs is true . |
void |
setExcludePackageNames(java.lang.String packages)
Set the list of packages to be excluded.
|
void |
setExecutable(java.lang.String executable)
Sets the actual executable command to invoke, instead of the binary
javadoc found in Ant's JDK. |
void |
setExtdirs(Path path)
Set the location of the extensions directories.
|
void |
setExtdirs(java.lang.String path)
Deprecated.
since 1.5.x.
Use the
setExtdirs(Path) version. |
void |
setFailonerror(boolean b)
Should the build process fail if Javadoc fails (as indicated by
a non zero return code)?
|
void |
setFailonwarning(boolean b)
Should the build process fail if Javadoc warns (as indicated by
the word "warning" on stdout)?
|
void |
setFooter(java.lang.String footer)
Set the footer text to be placed at the bottom of each output file.
|
void |
setGroup(java.lang.String src)
Group specified packages together in overview page.
|
void |
setHeader(java.lang.String header)
Set the header text to be placed at the top of each output file.
|
void |
setHelpfile(java.io.File f)
Specifies the HTML help file to use.
|
void |
setIncludeNoSourcePackages(boolean b)
If set to true, Ant will also accept packages that only hold
package.html files but no Java sources.
|
void |
setLink(java.lang.String src)
Create links to Javadoc output at the given URL.
|
void |
setLinkoffline(java.lang.String src)
Link to docs at "url" using package list at "url2"
- separate the URLs by using a space character.
|
void |
setLinksource(boolean b)
Enables the -linksource switch, will be ignored if Javadoc is not
the 1.4 version.
|
void |
setLocale(java.lang.String locale)
Set the local to use in documentation generation.
|
void |
setMaxmemory(java.lang.String max)
Set the maximum memory to be used by the javadoc process
|
void |
setModulenames(java.lang.String modules)
Set the module names to be processed.
|
void |
setModulePath(Path mp)
Specify where to find modules
|
void |
setModulePathref(Reference r)
Adds a reference to a path defined elsewhere that defines the module path.
|
void |
setModuleSourcePath(Path mp)
Specify where to find sources for modules
|
void |
setModuleSourcePathref(Reference r)
Adds a reference to a path defined elsewhere that defines the module source path.
|
void |
setNodeprecated(boolean b)
Control deprecation information
|
void |
setNodeprecatedlist(boolean b)
Control deprecated list generation
|
void |
setNohelp(boolean b)
Control generation of help link.
|
void |
setNoindex(boolean b)
Control generation of index.
|
void |
setNonavbar(boolean b)
Control generation of the navigation bar.
|
void |
setNoqualifier(java.lang.String noqualifier)
Enables the -noqualifier switch, will be ignored if Javadoc is not
the 1.4 version.
|
void |
setNotree(boolean b)
Control class tree generation.
|
void |
setOld(boolean b)
Indicate whether Javadoc should produce old style (JDK 1.1)
documentation.
|
void |
setOverview(java.io.File f)
Specify the file containing the overview to be included in the generated
documentation.
|
void |
setPackage(boolean b)
Indicate whether only package, protected and public classes and
members are to be included in the scope processed
|
void |
setPackageList(java.lang.String src)
The name of a file containing the packages to process.
|
void |
setPackagenames(java.lang.String packages)
Set the package names to be processed.
|
void |
setPostProcessGeneratedJavadocs(boolean b)
Whether to post-process the generated javadocs in order to mitigate CVE-2013-1571.
|
void |
setPrivate(boolean b)
Indicate whether all classes and
members are to be included in the scope processed
|
void |
setProtected(boolean b)
Indicate whether only protected and public classes and members are to
be included in the scope processed
|
void |
setPublic(boolean b)
Indicate whether only public classes and members are to be included in
the scope processed
|
void |
setSerialwarn(boolean b)
Control warnings about serial tag.
|
void |
setSource(java.lang.String source)
Enables the -source switch, will be ignored if Javadoc is not
the 1.4 version.
|
void |
setSourcefiles(java.lang.String src)
Set the list of source files to process.
|
void |
setSourcepath(Path src)
Specify where to find source file
|
void |
setSourcepathRef(Reference r)
Adds a reference to a CLASSPATH defined elsewhere.
|
void |
setSplitindex(boolean b)
Generate a split index
|
void |
setStylesheetfile(java.io.File f)
Specifies the CSS stylesheet file to use.
|
void |
setUse(boolean b)
Generate the "use" page for each package.
|
void |
setUseExternalFile(boolean b)
Work around command line length limit by using an external file
for the sourcefiles.
|
void |
setVerbose(boolean b)
Run javadoc in verbose mode
|
void |
setVersion(boolean b)
Include the version tag in the generated documentation.
|
void |
setWindowtitle(java.lang.String title)
Set the title to be placed in the HTML <title> tag of the
generated documentation.
|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
public void setUseExternalFile(boolean b)
b
- true if an external file is to be used.public void setDefaultexcludes(boolean useDefaultExcludes)
useDefaultExcludes
- "true"|"on"|"yes" when default exclusions
should be used, "false"|"off"|"no" when they
shouldn't be used.public void setMaxmemory(java.lang.String max)
max
- a string indicating the maximum memory according to the
JVM conventions (e.g. 128m is 128 Megabytes)public void setAdditionalparam(java.lang.String add)
add
- the additional command line parameter for the javadoc task.public Commandline.Argument createArg()
public void setSourcepath(Path src)
src
- a Path instance containing the various source directories.public Path createSourcepath()
public void setSourcepathRef(Reference r)
r
- the reference containing the source path definition.public void setModulePath(Path mp)
mp
- a Path instance containing the modules.public Path createModulePath()
public void setModulePathref(Reference r)
r
- the reference containing the module path definition.public void setModuleSourcePath(Path mp)
mp
- a Path instance containing the sources for modules.public Path createModuleSourcePath()
public void setModuleSourcePathref(Reference r)
r
- the reference containing the module source path definition.public void setDestdir(java.io.File dir)
dir
- the destination directory.public void setSourcefiles(java.lang.String src)
src
- a comma separated list of source files.public void addSource(Javadoc.SourceFile sf)
sf
- the source file to be processed.public void setPackagenames(java.lang.String packages)
packages
- a comma separated list of packages specs
(may be wildcarded).for wildcard information.
public void setModulenames(java.lang.String modules)
modules
- a comma separated list of module namespublic void addPackage(Javadoc.PackageName pn)
pn
- the package name, possibly wildcarded.public void addModule(Javadoc.PackageName mn)
mn
- the module namepublic void setExcludePackageNames(java.lang.String packages)
packages
- a comma separated list of packages to be excluded.
This may not include wildcards.public void addExcludePackage(Javadoc.PackageName pn)
pn
- the name of the package (wildcards are not permitted).public void setOverview(java.io.File f)
f
- the file containing the overview.public void setPublic(boolean b)
b
- true if scope is to be public.public void setProtected(boolean b)
b
- true if scope is to be protected.public void setPackage(boolean b)
b
- true if scope is to be package level.public void setPrivate(boolean b)
b
- true if scope is to be private level.public void setAccess(Javadoc.AccessType at)
at
- the scope to be processed.public void setDoclet(java.lang.String docletName)
docletName
- the name of the doclet class.public void setDocletPath(Path docletPath)
docletPath
- the doclet classpath.public void setDocletPathRef(Reference r)
r
- the reference to the Path instance to use as the doclet
classpath.public Javadoc.DocletInfo createDoclet()
public void addTaglet(Javadoc.ExtensionInfo tagletInfo)
tagletInfo
- information about the taglet.public void setOld(boolean b)
b
- if true attempt to generate old style documentation.public void setClasspath(Path path)
path
- an Ant Path object containing the compilation
classpath.public Path createClasspath()
public void setClasspathRef(Reference r)
r
- the reference to an instance defining the classpath.public void setBootclasspath(Path path)
path
- the boot classpath.public Path createBootclasspath()
public void setBootClasspathRef(Reference r)
r
- the reference to an instance defining the bootclasspath.@Deprecated public void setExtdirs(java.lang.String path)
setExtdirs(Path)
version.path
- the string version of the path.public void setExtdirs(Path path)
path
- a path containing the extension directories.public void setVerbose(boolean b)
b
- true if operation is to be verbose.public void setLocale(java.lang.String locale)
locale
- the locale to use.public void setEncoding(java.lang.String enc)
enc
- the name of the encoding for the source files.public void setVersion(boolean b)
b
- true if the version tag should be included.public void setUse(boolean b)
b
- true if the use page should be generated.public void setAuthor(boolean b)
b
- true if the author tag should be included.public void setSplitindex(boolean b)
b
- true if the index should be split into a file per letter.public void setWindowtitle(java.lang.String title)
title
- the window title to use.public void setDoctitle(java.lang.String doctitle)
doctitle
- the Document title.public void addDoctitle(Javadoc.Html text)
text
- the HTML element containing the document title.public void setHeader(java.lang.String header)
header
- the header textpublic void addHeader(Javadoc.Html text)
text
- the header textpublic void setFooter(java.lang.String footer)
footer
- the footer text.public void addFooter(Javadoc.Html text)
text
- the footer text.public void setBottom(java.lang.String bottom)
bottom
- the bottom text.public void addBottom(Javadoc.Html text)
text
- the bottom text.public void setLinkoffline(java.lang.String src)
src
- the offline link specification (url and package list)public void setGroup(java.lang.String src)
src
- the group packages - a command separated list of group specs,
each one being a group name and package specification separated
by a space.public void setLink(java.lang.String src)
src
- the URL to link topublic void setNodeprecated(boolean b)
b
- If true, do not include deprecated information.public void setNodeprecatedlist(boolean b)
b
- if true, do not generate deprecated list.public void setNotree(boolean b)
b
- if true, do not generate class hierarchy.public void setNoindex(boolean b)
b
- if true, do not generate index.public void setNohelp(boolean b)
b
- if true, do not generate help linkpublic void setNonavbar(boolean b)
b
- if true, do not generate navigation bar.public void setSerialwarn(boolean b)
b
- if true, generate warning about the serial tag.public void setStylesheetfile(java.io.File f)
f
- the file with the CSS to use.public void setHelpfile(java.io.File f)
f
- the file containing help content.public void setDocencoding(java.lang.String enc)
enc
- name of the encoding to use.public void setPackageList(java.lang.String src)
src
- the file containing the package list.public Javadoc.LinkArgument createLink()
public Javadoc.TagArgument createTag()
public Javadoc.GroupArgument createGroup()
public void setCharset(java.lang.String src)
src
- the name of the charsetpublic void setFailonerror(boolean b)
Default is false.
b
- a boolean
valuepublic void setFailonwarning(boolean b)
Default is false.
b
- a boolean
valuepublic void setSource(java.lang.String source)
source
- a String
valuepublic void setExecutable(java.lang.String executable)
javadoc
found in Ant's JDK.executable
- the command to invoke.public void addPackageset(DirSet packageSet)
All included directories will be translated into package names be converting the directory separator into dots.
packageSet
- a directory setpublic void addFileset(FileSet fs)
All included files will be added as sourcefiles. The task
will automatically add
includes="**/*.java"
to the
fileset.
fs
- a file setpublic Javadoc.ResourceCollectionContainer createSourceFiles()
All included files will be added as sourcefiles.
public void setLinksource(boolean b)
b
- a String
valuepublic void setBreakiterator(boolean b)
b
- a String
valuepublic void setNoqualifier(java.lang.String noqualifier)
noqualifier
- the parameter to the -noqualifier switchpublic void setIncludeNoSourcePackages(boolean b)
b
- a boolean
value.public void setDocFilesSubDirs(boolean b)
doc-files
directories.b
- booleanpublic void setExcludeDocFilesSubDir(java.lang.String s)
doc-files
subdirectories
to skip if docFilesSubDirs is true
.s
- Stringpublic void setPostProcessGeneratedJavadocs(boolean b)
b
- booleanpublic void execute() throws BuildException
execute
in class Task
BuildException
- on errorprotected java.lang.String expand(java.lang.String content)
content
- the string to expand