You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

javadoc.html 31 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852
  1. <!DOCTYPE html>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. https://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <html lang="en">
  17. <head>
  18. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  19. <title>Javadoc Task</title>
  20. </head>
  21. <body>
  22. <h2 id="javadoc">Javadoc/<em>Javadoc2</em></h2>
  23. <p><em><u>Deprecation</u>: the <code>javadoc2</code> task simply points to the <code>javadoc</code>
  24. task and it's there for backwards compatibility reasons. Since this task will be removed in future
  25. versions, you are strongly encouraged to use <a href="javadoc.html">javadoc</a> instead.</em></p>
  26. <h3>Description</h3>
  27. <p>Generates code documentation using the <kbd>javadoc</kbd> tool.</p>
  28. <p>The source directory will be recursively scanned for Java source files to process but only those
  29. matching the inclusion rules, and not matching the exclusions rules will be passed to
  30. the <kbd>javadoc</kbd> tool. This allows wildcards to be used to choose between package names,
  31. reducing verbosity and management costs over time. This task, however, has no notion of
  32. &quot;changed&quot; files, unlike the <a href="javac.html">javac</a> task. This means all packages
  33. will be processed each time this task is run. In general, however, this task is used much less
  34. frequently.</p>
  35. <p><strong>Note</strong>: since <kbd>javadoc</kbd>
  36. calls <code class="code">System.exit()</code>, <kbd>javadoc</kbd> cannot be run inside the same
  37. JVM as Apache Ant without breaking functionality. For this reason, this task always forks JVM. This
  38. overhead is not significant since <kbd>javadoc</kbd> is normally a heavy application and will be
  39. called infrequently.</p>
  40. <p><strong>Note</strong>: the <var>packagelist</var> attribute allows you to specify the list of
  41. packages to document outside of the Ant file. It's a much better practice to include everything
  42. inside the <code>build.xml</code> file. This option was added in order to make it easier to migrate
  43. from regular makefiles, where you would use this option of <kbd>javadoc</kbd>. The packages
  44. listed in <var>packagelist</var> are not checked, so the task performs even if some packages are
  45. missing or broken. Use this option if you wish to convert from an existing makefile. Once things are
  46. running you should then switch to the regular notation.</p>
  47. <p><strong>Note</strong>: When generating the JavaDocs for classes which contains annotations you
  48. maybe get a <code class="output">java.lang.ClassCastException:
  49. com.sun.tools.javadoc.ClassDocImpl</code>. This is
  50. due <a href="https://bugs.openjdk.java.net/browse/JDK-6442982" target="_top">bug 6442982</a>. The
  51. cause is that <kbd>javadoc</kbd> cannot find the implementations of used annotations. The
  52. workaround is providing the jars with these implementations (like
  53. JAXBs <code class="code">@XmlType</code>, ...) to <code>&lt;javadoc&gt;</code>
  54. using <var>classpath</var>, <var>classpathref</var> attributes or
  55. nested <code>&lt;classpath&gt;</code> element.</p>
  56. <p><strong>Note</strong>: many problems with running <kbd>javadoc</kbd> stem from command lines
  57. that have become too long&mdash;even though the error message doesn't give the slightest hint this
  58. may be the problem. If you encounter problems with the task, try to set
  59. the <var>useexternalfile</var> attribute to <q>true</q> first.</p>
  60. <p>If you use multiple ways to specify where <kbd>javadoc</kbd> should be looking for sources, your
  61. result will be the union of all specified documentations. If you, e.g., specify
  62. a <var>sourcepath</var> attribute and also a nested <code>packageset</code> both pointing at the
  63. same directory your <var>excludepackagenames</var> attribute won't have any effect unless it agrees
  64. with the <var>exclude</var> patterns of the <code>packageset</code> (and vice versa).</p>
  65. <h3>Parameters</h3>
  66. <table class="attr">
  67. <tr>
  68. <th scope="col">Attribute</th>
  69. <th scope="col">Description</th>
  70. <th scope="col">Required</th>
  71. </tr>
  72. <tr>
  73. <td>sourcepath</td>
  74. <td>Specify where to find source files</td>
  75. <td rowspan="4">At least one of the four or
  76. nested <code>&lt;sourcepath&gt;</code>, <code>&lt;fileset&gt;</code>,
  77. <code>module</code> or <code>&lt;packageset&gt;</code></td>
  78. </tr>
  79. <tr>
  80. <td>sourcepathref</td>
  81. <td>Specify where to find source files by <a href="../using.html#references">reference</a> to a
  82. <var>sourcepath</var> defined elsewhere.</td>
  83. </tr>
  84. <tr>
  85. <td>sourcefiles</td>
  86. <td>Comma separated list of source files&mdash;see also the nested <code>source</code>
  87. element.</td>
  88. </tr>
  89. <tr>
  90. <td>modulenames</td>
  91. <td>Comma separated list of module names -- see also
  92. the nested <code>module</code> element. <em>since Ant 1.10.6</em></td>
  93. </tr>
  94. <tr>
  95. <td>destdir</td>
  96. <td>Destination directory for output files</td>
  97. <td>Yes, unless a <var>doclet</var> has been specified.</td>
  98. </tr>
  99. <tr>
  100. <td>maxmemory</td>
  101. <td>Max amount of memory to allocate to the <kbd>javadoc</kbd> JVM</td>
  102. <td>No</td>
  103. </tr>
  104. <tr>
  105. <td>packagenames</td>
  106. <td>Comma separated list of package files (with terminating wildcard)&mdash;see also the
  107. nested <code>package</code> element.</td>
  108. <td>No</td>
  109. </tr>
  110. <tr>
  111. <td>packageList</td>
  112. <td>The name of a file containing the packages to process</td>
  113. <td>No</td>
  114. </tr>
  115. <tr>
  116. <td>classpath</td>
  117. <td>Specify where to find user class files</td>
  118. <td>No</td>
  119. </tr>
  120. <tr>
  121. <td>Bootclasspath</td>
  122. <td>Override location of class files loaded by the bootstrap class loader</td>
  123. <td>No</td>
  124. </tr>
  125. <tr>
  126. <td>classpathref</td>
  127. <td>Specify where to find user class files by <a href="../using.html#references">reference</a>
  128. to a <var>classpath</var> defined elsewhere.</td>
  129. <td>No</td>
  130. </tr>
  131. <tr>
  132. <td>bootclasspathref</td>
  133. <td>Override location of class files loaded by the bootstrap class loader
  134. by <a href="../using.html#references">reference</a> to a <var>bootclasspath</var> defined
  135. elsewhere.</td>
  136. <td>No</td>
  137. </tr>
  138. <tr>
  139. <td>Extdirs</td>
  140. <td>Override location of installed extensions</td>
  141. <td>No</td>
  142. </tr>
  143. <tr>
  144. <td>Overview</td>
  145. <td>Read overview documentation from HTML file</td>
  146. <td>No</td>
  147. </tr>
  148. <tr>
  149. <td>access</td>
  150. <td>Access mode: one of <q>public</q>, <q>protected</q>, <q>package</q>, or <q>private</q></td>
  151. <td>No; default is <q>protected</q></td>
  152. </tr>
  153. <tr>
  154. <td>Public</td>
  155. <td>Show only public classes and members</td>
  156. <td>No</td>
  157. </tr>
  158. <tr>
  159. <td>Protected</td>
  160. <td>Show protected/public classes and members (default)</td>
  161. <td>No</td>
  162. </tr>
  163. <tr>
  164. <td>Package</td>
  165. <td>Show package/protected/public classes and members</td>
  166. <td>No</td>
  167. </tr>
  168. <tr>
  169. <td>Private</td>
  170. <td>Show all classes and members</td>
  171. <td>No</td>
  172. </tr>
  173. <tr>
  174. <td>Old</td>
  175. <td>Generate output using JDK 1.1 emulating doclet.<br/><strong>Note</strong>:
  176. This attribute has no effect unless you're using an pre jdk 1.4 external <kbd>javadoc</kbd>
  177. </td>
  178. <td>No</td>
  179. </tr>
  180. <tr>
  181. <td>Verbose</td>
  182. <td>Output messages about what <kbd>javadoc</kbd> is doing</td>
  183. <td>No</td>
  184. </tr>
  185. <tr>
  186. <td>Locale</td>
  187. <td>Locale to be used, e.g. <q>en_US</q> or <q>en_US_WIN</q></td>
  188. <td>No</td>
  189. </tr>
  190. <tr>
  191. <td>Encoding</td>
  192. <td>Source file encoding name</td>
  193. <td>No</td>
  194. </tr>
  195. <tr>
  196. <td>Version</td>
  197. <td>Include <code>@version</code> paragraphs</td>
  198. <td>No</td>
  199. </tr>
  200. <tr>
  201. <td>Use</td>
  202. <td>Create class and package usage pages</td>
  203. <td>No</td>
  204. </tr>
  205. <tr>
  206. <td>Author</td>
  207. <td>Include <code>@author</code> paragraphs</td>
  208. <td>No</td>
  209. </tr>
  210. <tr>
  211. <td>Splitindex</td>
  212. <td>Split index into one file per letter</td>
  213. <td>No</td>
  214. </tr>
  215. <tr>
  216. <td>Windowtitle</td>
  217. <td>Browser window title for the documentation (text)</td>
  218. <td>No</td>
  219. </tr>
  220. <tr>
  221. <td>Doctitle</td>
  222. <td>Include title for the package index (first) page (HTML code)</td>
  223. <td>No</td>
  224. </tr>
  225. <tr>
  226. <td>Header</td>
  227. <td>Include header text for each page (HTML code)</td>
  228. <td>No</td>
  229. </tr>
  230. <tr>
  231. <td>Footer</td>
  232. <td>Include footer text for each page (HTML code)</td>
  233. <td>No</td>
  234. </tr>
  235. <tr>
  236. <td>bottom</td>
  237. <td>Include bottom text for each page (HTML code)</td>
  238. <td>No</td>
  239. </tr>
  240. <tr>
  241. <td>link</td>
  242. <td>Create links to <code>javadoc</code> output at the given URL&mdash;see also the
  243. nested <code>link</code> element.</td>
  244. <td>No</td>
  245. </tr>
  246. <tr>
  247. <td>linkoffline</td>
  248. <td>Link to docs at <samp><em>url</em></samp> using package list
  249. at <samp><em>alt-url</em></samp> by specifying a
  250. value <q><em>url</em>&nbsp;<em>alt-url</em></q> (space as separator). A shorthand for the
  251. nested <code>link</code> element with <var>offline</var>=<q>true</q>.</td>
  252. <td>No</td>
  253. </tr>
  254. <tr>
  255. <td>group</td>
  256. <td>Group specified packages together in overview page. The format is as
  257. described <a href="#groupattribute">below</a>&mdash;see also the nested <code>group</code>
  258. element.</td>
  259. <td>No</td>
  260. </tr>
  261. <tr>
  262. <td>nodeprecated</td>
  263. <td>Do not include <code>@deprecated</code> information</td>
  264. <td>No</td>
  265. </tr>
  266. <tr>
  267. <td>nodeprecatedlist</td>
  268. <td>Do not generate deprecated list</td>
  269. <td>No</td>
  270. </tr>
  271. <tr>
  272. <td>notree</td>
  273. <td>Do not generate class hierarchy</td>
  274. <td>No</td>
  275. </tr>
  276. <tr>
  277. <td>noindex</td>
  278. <td>Do not generate index</td>
  279. <td>No</td>
  280. </tr>
  281. <tr>
  282. <td>nohelp</td>
  283. <td>Do not generate help link</td>
  284. <td>No</td>
  285. </tr>
  286. <tr>
  287. <td>nonavbar</td>
  288. <td>Do not generate navigation bar</td>
  289. <td>No</td>
  290. </tr>
  291. <tr>
  292. <td>serialwarn</td>
  293. <td>Generate warning about <code>@serial</code> tag</td>
  294. <td>No</td>
  295. </tr>
  296. <tr>
  297. <td>helpfile</td>
  298. <td>Specifies the HTML help file to use</td>
  299. <td>No</td>
  300. </tr>
  301. <tr>
  302. <td>stylesheetfile</td>
  303. <td>Specifies the CSS stylesheet to use</td>
  304. <td>No</td>
  305. </tr>
  306. <tr>
  307. <td>charset</td>
  308. <td>Charset for cross-platform viewing of generated documentation</td>
  309. <td>No</td>
  310. </tr>
  311. <tr>
  312. <td>docencoding</td>
  313. <td>Output file encoding name</td>
  314. <td>No</td>
  315. </tr>
  316. <tr>
  317. <td>doclet</td>
  318. <td>Specifies the class file that starts the doclet used in generating the
  319. documentation&mdash;see also the nested <code>doclet</code> element.</td>
  320. <td>No</td>
  321. </tr>
  322. <tr>
  323. <td>docletpath</td>
  324. <td>Specifies the path to the doclet class file that is specified with the <kbd>-doclet</kbd>
  325. option.</td>
  326. <td>No</td>
  327. </tr>
  328. <tr>
  329. <td>docletpathref</td>
  330. <td>Specifies the path to the doclet class file that is specified with the <kbd>-doclet</kbd>
  331. option by <a href="../using.html#references">reference</a> to a path defined elsewhere.</td>
  332. <td>No</td>
  333. </tr>
  334. <tr>
  335. <td>additionalparam</td>
  336. <td>Lets you add additional parameters to the <kbd>javadoc</kbd> command line. Useful for
  337. doclets. Parameters containing spaces need to be quoted using &amp;quot;&mdash;see also the
  338. nested <code>arg</code> element.</td>
  339. <td>No</td>
  340. </tr>
  341. <tr>
  342. <td>failonerror</td>
  343. <td>Stop the build process if the command exits with a return code other than <q>0</q>.</td>
  344. <td>No</td>
  345. </tr>
  346. <tr>
  347. <td>failonwarning</td>
  348. <td>Stop the build process if a warning is emitted&mdash;i.e. if <kbd>javadoc</kbd>'s output
  349. contains the word <q>warning</q>. <em>since Ant 1.9.4</em></td>
  350. <td>No</td>
  351. </tr>
  352. <tr>
  353. <td>excludepackagenames</td>
  354. <td>comma separated list of packages you don't want docs for&mdash;see also the
  355. nested <code>excludepackage</code> element.</td>
  356. <td>No</td>
  357. </tr>
  358. <tr>
  359. <td>defaultexcludes</td>
  360. <td>indicates whether default excludes should be used (<q>yes|no</q>).</td>
  361. <td>No; defaults to <q>yes</q></td>
  362. </tr>
  363. <tr>
  364. <td>useexternalfile</td>
  365. <td>indicates whether the source file names specified in <var>srcfiles</var> or as
  366. nested <code>source</code> elements should be written to a temporary file to make the command
  367. line shorter. Also applies to the package names specified via the <var>packagenames</var>
  368. attribute or nested <code>package</code> elements. <em>Since Ant 1.7.0</em>, also applies to
  369. all the other command line options. (<q>yes|no</q>).<br/>
  370. If enabled, the file will be written to
  371. the <a href="../running.html#tmpdir">temporary
  372. directory</a>.</td>
  373. <td>No; default is <q>no</q></td>
  374. </tr>
  375. <tr>
  376. <td>source</td>
  377. <td>Enable <kbd>javadoc</kbd> to handle Java language features. Set this to <q>1.4</q> to
  378. document code that compiles using <kbd>javac -source 1.4</kbd>, etc.</td>
  379. <td>No; default can be provided using the magic
  380. <a href="../javacprops.html#source"><code>ant.build.javac.source</code></a> property.</td>
  381. </tr>
  382. <tr>
  383. <td>linksource</td>
  384. <td>Generate hyperlinks to source files. <em>since Ant 1.6</em>. (<q>yes|no</q>).</td>
  385. <td>No; default is <q>no</q></td>
  386. </tr>
  387. <tr>
  388. <td>breakiterator</td>
  389. <td>Use the new break iterator algorithm. <em>since Ant 1.6</em>. (<q>yes|no</q>).</td>
  390. <td>No; default is <q>no</q></td>
  391. </tr>
  392. <tr>
  393. <td>noqualifier</td>
  394. <td>Enables the <kbd>-noqualifier</kbd> argument&mdash;must be <q>all</q> or a colon separated
  395. list of packages. <em>since Ant 1.6</em>.</td>
  396. <td>No</td>
  397. </tr>
  398. <tr>
  399. <td>includenosourcepackages</td>
  400. <td>If set to <q>true</q>, packages that don't contain Java source but
  401. a <samp>package.html</samp> will get documented as well. <em>since Ant 1.6.3</em>.</td>
  402. <td>No; default is <q>false</q></td>
  403. </tr>
  404. <tr>
  405. <td>executable</td>
  406. <td>Specify a particular <kbd>javadoc</kbd> executable to use in place of the default binary
  407. (found in the same JDK as Ant is running in). <em>since Ant 1.6.3</em>. <b>Note:</b>
  408. <em>It is up to you to ensure that this command supports the attributes you wish to use.</em></td>
  409. <td>No</td>
  410. </tr>
  411. <tr>
  412. <td>docfilessubdirs</td>
  413. <td>Enables deep-copying of <samp>doc-files</samp> subdirectories. <em>since Ant
  414. 1.8.0</em>.</td>
  415. <td>No; defaults to <q>false</q></td>
  416. </tr>
  417. <tr>
  418. <td>excludedocfilessubdir</td>
  419. <td>Colon-separated list of <samp>doc-files</samp> subdirectories to exclude
  420. if <var>docfilessubdirs</var> is true. <em>since Ant 1.8.0</em>.</td>
  421. <td>No</td>
  422. </tr>
  423. <tr>
  424. <td>postProcessGeneratedJavadocs</td>
  425. <td>Whether to post-process the generated javadocs in order to mitigate
  426. CVE-2013-1571. <em>Since Ant 1.9.2</em><br/> There is a frame injection attack possible in
  427. javadocs generated by Oracle JDKs prior to Java 7 update 25
  428. (<a href="https://www.oracle.com/technetwork/java/javase/7u25-relnotes-1955741.html#jpi-upt"
  429. target="_top">details</a>). When this flag is set to <q>true</q>, Ant will check whether the
  430. docs are vulnerable and will try to fix them.</td>
  431. <td>No; defaults to <q>true</q></td>
  432. </tr>
  433. <tr>
  434. <td>modulesourcepath</td>
  435. <td>Specify where to find module source files
  436. <em>since Ant 1.10.6</em></td>
  437. <td>No</td>
  438. </tr>
  439. <tr>
  440. <td>modulesourcepathref</td>
  441. <td>Specify where to find module source files by <a
  442. href="../using.html#references">reference</a> to a PATH defined elsewhere.
  443. <em>since Ant 1.10.6</em></td>
  444. <td>No</td>
  445. </tr>
  446. <tr>
  447. <td>modulepath</td>
  448. <td>Specify where to find module files
  449. <em>since Ant 1.10.6</em></td>
  450. <td>No</td>
  451. </tr>
  452. <tr>
  453. <td>modulepathref</td>
  454. <td>Specify where to find module files by <a
  455. href="../using.html#references">reference</a> to a PATH defined elsewhere.
  456. <em>since Ant 1.10.6</em></td>
  457. <td>No</td>
  458. </tr>
  459. </table>
  460. <h4 id="groupattribute">Format of the group attribute</h4>
  461. <p>The arguments are comma-delimited. Each single argument is 2 space-delimited strings, where the
  462. first one is the group's title and the second one a colon delimited list of packages.</p>
  463. <p>If you need to specify more than one group, or a group whose title contains a comma or a space
  464. character, using <a href="#groupelement">nested <code>group</code> elements</a> is highly
  465. recommended.</p>
  466. <p>E.g.:</p>
  467. <pre>group=&quot;XSLT_Packages org.apache.xalan.xslt*,XPath_Packages org.apache.xalan.xpath*&quot;</pre>
  468. <h3>Parameters specified as nested elements</h3>
  469. <h4>packageset</h4>
  470. <p>A <a href="../Types/dirset.html">DirSet</a>. All matched directories that contain Java source
  471. files will be passed to <kbd>javadoc</kbd> as package names. Package names are created from the
  472. directory names by translating the directory separator into dots. Ant assumes the base directory of
  473. the <code>packageset</code> points to the root of a package hierarchy.</p>
  474. <p>The <var>packagenames</var>, <var>excludepackagenames</var> and <var>defaultexcludes</var>
  475. attributes of the task have no effect on the nested <code>&lt;packageset&gt;</code> elements.</p>
  476. <h4>fileset</h4>
  477. <p>A <a href="../Types/fileset.html">FileSet</a>. All matched files will be passed
  478. to <kbd>javadoc</kbd> as source files. Ant will automatically add the include
  479. pattern <samp>**/*.java</samp> (and <samp>**/package.html</samp>
  480. if <var>includenosourcepackages</var> is <q>true</q>) to these filesets.</p>
  481. <p>Nested filesets can be used to document sources that are in the default package or if you want to
  482. exclude certain files from documentation. If you want to document all source files and don't use
  483. the default package, <code>packageset</code>s should be used instead as this increases performance
  484. of <kbd>javadoc</kbd>.</p>
  485. <p>The <var>packagenames</var>, <var>excludepackagenames</var> and <var>defaultexcludes</var>
  486. attributes of the task have no effect on the nested <code>&lt;fileset&gt;</code> elements.</p>
  487. <h4>sourcefiles</h4>
  488. <p>A container for arbitrary file system based <a href="../Types/resources.html#collection">resource
  489. collections</a>. All files contained in any of the nested collections (this includes nested
  490. filesets, filelists or paths) will be passed to javadoc as source files.</p>
  491. <h4>package</h4>
  492. <p>Same as one entry in the list given by <var>packagenames</var>.</p>
  493. <h5>Parameters</h5>
  494. <table class="attr">
  495. <tr>
  496. <th scope="col">Attribute</th>
  497. <th scope="col">Description</th>
  498. <th scope="col">Required</th>
  499. </tr>
  500. <tr>
  501. <td>name</td>
  502. <td>The package name (may be a wildcard)</td>
  503. <td>Yes</td>
  504. </tr>
  505. </table>
  506. <h4>excludepackage</h4>
  507. <p>Same as one entry in the list given by <var>excludepackagenames</var>.</p>
  508. <h5>Parameters</h5>
  509. Same as for <code>package</code>.
  510. <h4>module</h4>
  511. <p><em>since Ant 1.10.6</em></p>
  512. <p>Same as one entry in the list given by <code>modulenames</code>.</p>
  513. <h5>Parameters</h5>
  514. <table class="attr">
  515. <tr>
  516. <th scope="col">Attribute</th>
  517. <th scope="col">Description</th>
  518. <th scope="col">Required</th>
  519. </tr>
  520. <tr>
  521. <td>name</td>
  522. <td>The module name</td>
  523. <td>Yes</td>
  524. </tr>
  525. </table>
  526. <h4>source</h4>
  527. <p>Same as one entry in the list given by <var>sourcefiles</var>.</p>
  528. <h5>Parameters</h5>
  529. <table class="attr">
  530. <tr>
  531. <th scope="col">Attribute</th>
  532. <th scope="col">Description</th>
  533. <th scope="col">Required</th>
  534. </tr>
  535. <tr>
  536. <td>file</td>
  537. <td>The source file to document</td>
  538. <td>Yes</td>
  539. </tr>
  540. </table>
  541. <h4>doctitle</h4>
  542. <p>Same as the <var>doctitle</var> attribute, but you can nest text inside the element this way.</p>
  543. <p>If the nested text contains line breaks, you must use the <var>useexternalfile</var> attribute
  544. and set it to <q>true</q>.</p>
  545. <h4>header</h4>
  546. <p>Similar to <code>&lt;doctitle&gt;</code>.</p>
  547. <h4>footer</h4>
  548. <p>Similar to <code>&lt;doctitle&gt;</code>.</p>
  549. <h4>bottom</h4>
  550. <p>Similar to <code>&lt;doctitle&gt;</code>.</p>
  551. <h4>link</h4>
  552. <p>Create link to <kbd>javadoc</kbd> output at the given URL. This performs the same role as
  553. the <var>link</var> and <var>linkoffline</var> attributes. You can use either syntax (or both at
  554. once), but with the nested elements you can easily specify multiple occurrences of the
  555. arguments.</p>
  556. <h5>Parameters</h5>
  557. <table class="attr">
  558. <tr>
  559. <th scope="col">Attribute</th>
  560. <th scope="col">Description</th>
  561. <th scope="col">Required</th>
  562. </tr>
  563. <tr>
  564. <td>href</td>
  565. <td>The URL for the external documentation you wish to link to. This can be an absolute URL, or
  566. a relative file name.</td>
  567. <td>Yes</td>
  568. </tr>
  569. <tr>
  570. <td>offline</td>
  571. <td><q>true</q> if this link is not available online at the time of generating the
  572. documentation</td>
  573. <td>No</td>
  574. </tr>
  575. <tr>
  576. <td>packagelistLoc</td>
  577. <td>The location to the directory containing the package-list file for the external
  578. documentation</td>
  579. <td rowspan="2">One of the two if the <var>offline</var> attribute is <q>true</q></td>
  580. </tr>
  581. <tr>
  582. <td>packagelistURL</td>
  583. <td class="left">The URL of the the directory containing the package-list file for the external
  584. documentation</td>
  585. </tr>
  586. <tr>
  587. <td>resolveLink</td>
  588. <td>If the <var>link</var> attribute is a relative file name, Ant will first try to locate the
  589. file relative to the current project's <var>basedir</var> and if it finds a file there use an
  590. absolute URL for the <var>link</var> attribute, otherwise it will pass the file name verbatim
  591. to the <kbd>javadoc</kbd> command.</td>
  592. <td>No; default is <q>false</q></td>
  593. </tr>
  594. </table>
  595. <h4 id="groupelement">group</h4>
  596. <p>Separates packages on the overview page into whatever groups you specify, one group per
  597. table. This performs the same role as the <var>group</var> attribute. You can use either syntax (or
  598. both at once), but with the nested elements you can easily specify multiple occurrences of the
  599. arguments.</p>
  600. <h5>Parameters</h5>
  601. <table class="attr">
  602. <tr>
  603. <th scope="col">Attribute</th>
  604. <th scope="col">Description</th>
  605. <th scope="col">Required</th>
  606. </tr>
  607. <tr>
  608. <td>title</td>
  609. <td>Title of the group</td>
  610. <td>Yes, unless nested <code>&lt;title&gt;</code> given</td>
  611. </tr>
  612. <tr>
  613. <td>packages</td>
  614. <td>List of packages to include in that group. Multiple packages are separated with <q>:</q>.</td>
  615. <td>Yes, unless nested <code>&lt;package&gt;</code>s given</td>
  616. </tr>
  617. </table>
  618. <p>The title may be specified as a nested <code>&lt;title&gt;</code> element with text contents, and
  619. the packages may be listed with nested <code>&lt;package&gt;</code> elements as for the main
  620. task.</p>
  621. <h4>doclet</h4>
  622. <p>The doclet nested element is used to specify
  623. the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/doclet/overview.html"
  624. target="_top">doclet</a> that <kbd>javadoc</kbd> will use to process the input source files. A
  625. number of the standard <kbd>javadoc</kbd> arguments are actually arguments of the standard
  626. doclet. If these are specified in the <code>javadoc</code> task's attributes, they will be passed to
  627. the doclet specified in the <code>&lt;doclet&gt;</code> nested element. Such attributes should only
  628. be specified, therefore, if they can be interpreted by the doclet in use.</p>
  629. <p>If the doclet requires additional parameters, these can be specified
  630. with <code>&lt;param&gt;</code> elements within the <code>&lt;doclet&gt;</code> element. These
  631. parameters are restricted to simple strings. An example usage of the <code>doclet</code> element is
  632. shown below:</p>
  633. <pre>
  634. &lt;javadoc ... &gt;
  635. &lt;doclet name=&quot;theDoclet&quot;
  636. path=&quot;path/to/theDoclet&quot;&gt;
  637. &lt;param name=&quot;-foo&quot; value=&quot;foovalue&quot;/&gt;
  638. &lt;param name=&quot;-bar&quot; value=&quot;barvalue&quot;/&gt;
  639. &lt;/doclet&gt;
  640. &lt;/javadoc&gt;</pre>
  641. <h4 id="tagelement">tag</h4>
  642. <p>If you want to specify a standard tag using a nested <code>tag</code> element because you want to
  643. determine the order the tags are output, you must not set the <var>description</var> attribute for
  644. those tags.</p>
  645. <h5>Parameters</h5>
  646. <table class="attr">
  647. <tr>
  648. <th scope="col">Attribute</th>
  649. <th scope="col">Description</th>
  650. <th scope="col">Required</th>
  651. </tr>
  652. <tr>
  653. <td>name</td>
  654. <td>Name of the tag (e.g. <q>todo</q>)</td>
  655. <td>Yes, unless the <var>dir</var> attribute is specified</td>
  656. </tr>
  657. <tr>
  658. <td>description</td>
  659. <td>Description for tag (e.g. <q>To do:</q>)</td>
  660. <td>
  661. No, the <kbd>javadoc</kbd> executable will pick a default if this is not specified
  662. </td>
  663. </tr>
  664. <tr>
  665. <td>enabled</td>
  666. <td>Whether or not the tag is enabled</td>
  667. <td>No; defaults to <q>true</q></td>
  668. </tr>
  669. <tr>
  670. <td>scope</td>
  671. <td>Scope for the tag&mdash;the elements in which it can be used. This is a comma separated list
  672. of some of the
  673. elements: <q>overview</q>, <q>packages</q>, <q>types</q>, <q>constructors</q>, <q>methods</q>, <q>fields</q>
  674. or the default, <q>all</q>.</td>
  675. <td>No; defaults to <q>all</q></td>
  676. </tr>
  677. <tr>
  678. <td>dir</td>
  679. <td>If this attribute is specified, this element will behave as an
  680. implicit <a href="../Types/fileset.html">fileset</a>. The files included by this fileset
  681. should contain each tag definition on a separate line, as described in
  682. the <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html#javadoctags"
  683. target="_top">Javadoc reference guide</a>:
  684. <pre>ejb.bean:t:XDoclet EJB Tag
  685. todo:a:To Do</pre>
  686. <strong>Note</strong>: The Javadoc reference quide has double quotes around the description
  687. part of the definition. This will not work when used in a file, as the definition is quoted
  688. again when given to the <kbd>javadoc</kbd> program.<br/>
  689. <strong>Note</strong>: If this attribute is specified, all the other attributes in this
  690. element will be ignored.</td>
  691. <td>No</td>
  692. </tr>
  693. </table>
  694. <h4 id="tagletelement">taglet</h4>
  695. <p>The taglet nested element is used to specify
  696. custom <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/taglet/overview.html"
  697. target="_top">taglets</a>
  698. beyond <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html#javadoctags"
  699. target="_top">the default taglets</a>.</p>
  700. <h5>Parameters</h5>
  701. <table class="attr">
  702. <tr>
  703. <th scope="col">Attribute</th>
  704. <th scope="col">Description</th>
  705. <th scope="col">Required</th>
  706. </tr>
  707. <tr>
  708. <td>name</td>
  709. <td>The name of the taglet class
  710. (e.g. <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/taglet/ToDoTaglet.java"
  711. target="_top"><code>com.sun.tools.doclets.ToDoTaglet</code></a>)</td>
  712. <td>Yes</td>
  713. </tr>
  714. <tr>
  715. <td>path</td>
  716. <td>A path specifying the search path for the taglet class (e.g. <samp>/home/taglets</samp>).
  717. The path may also be specified by a nested <code>&lt;path&gt;</code> element</td>
  718. <td>No</td>
  719. </tr>
  720. </table>
  721. <h4>sourcepath, classpath, bootclasspath, modulepath, modulesourcepath</h4>
  722. <p><code>Javadoc</code>'s <i>sourcepath</i>, <i>classpath</i>,
  723. <i>bootclasspath</i>, <i>modulepath</i>, and <i>modulesourcepath</i>
  724. attributes are <a href="../using.html#path">PATH like structure</a>
  725. and can also be set via nested <i>sourcepath</i>,
  726. <i>classpath</i>, <i>bootclasspath</i>, <i>modulepath</i>,
  727. and <i>modulesourcepath</i> elements respectively.</p>
  728. <h4>arg</h4>
  729. <p><em>Since Ant 1.6</em></p>
  730. <p>Use nested <code>&lt;arg&gt;</code> to specify additional arguments.
  731. See <a href="../using.html#arg">Command line arguments</a>.</p>
  732. <h3>Example</h3>
  733. <pre>
  734. &lt;javadoc packagenames=&quot;com.dummy.test.*&quot;
  735. sourcepath=&quot;src&quot;
  736. excludepackagenames=&quot;com.dummy.test.doc-files.*&quot;
  737. defaultexcludes=&quot;yes&quot;
  738. destdir=&quot;docs/api&quot;
  739. author=&quot;true&quot;
  740. version=&quot;true&quot;
  741. use=&quot;true&quot;
  742. windowtitle=&quot;Test API&quot;&gt;
  743. &lt;doctitle&gt;&lt;![CDATA[&lt;h1&gt;Test&lt;/h1&gt;]]&gt;&lt;/doctitle&gt;
  744. &lt;bottom&gt;&lt;![CDATA[&lt;i&gt;Copyright &amp;#169; 2000 Dummy Corp. All Rights Reserved.&lt;/i&gt;]]&gt;&lt;/bottom&gt;
  745. &lt;tag name=&quot;todo&quot; scope=&quot;all&quot; description=&quot;To do:&quot;/&gt;
  746. &lt;group title=&quot;Group 1 Packages&quot; packages=&quot;com.dummy.test.a*&quot;/&gt;
  747. &lt;group title=&quot;Group 2 Packages&quot; packages=&quot;com.dummy.test.b*:com.dummy.test.c*&quot;/&gt;
  748. &lt;link offline=&quot;true&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/&quot; packagelistLoc=&quot;C:\tmp&quot;/&gt;
  749. &lt;link href=&quot;https://docs.oracle.com/javase/8/docs/api/&quot;/&gt;
  750. &lt;/javadoc&gt;</pre>
  751. <p>is the same as</p>
  752. <pre>
  753. &lt;javadoc destdir=&quot;docs/api&quot;
  754. author=&quot;true&quot;
  755. version=&quot;true&quot;
  756. use=&quot;true&quot;
  757. windowtitle=&quot;Test API&quot;&gt;
  758. &lt;packageset dir=&quot;src&quot; defaultexcludes=&quot;yes&quot;&gt;
  759. &lt;include name=&quot;com/dummy/test/**&quot;/&gt;
  760. &lt;exclude name=&quot;com/dummy/test/doc-files/**&quot;/&gt;
  761. &lt;/packageset&gt;
  762. &lt;doctitle&gt;&lt;![CDATA[&lt;h1&gt;Test&lt;/h1&gt;]]&gt;&lt;/doctitle&gt;
  763. &lt;bottom&gt;&lt;![CDATA[&lt;i&gt;Copyright &amp;#169; 2000 Dummy Corp. All Rights Reserved.&lt;/i&gt;]]&gt;&lt;/bottom&gt;
  764. &lt;tag name=&quot;todo&quot; scope=&quot;all&quot; description=&quot;To do:&quot;/&gt;
  765. &lt;group title=&quot;Group 1 Packages&quot; packages=&quot;com.dummy.test.a*&quot;/&gt;
  766. &lt;group title=&quot;Group 2 Packages&quot; packages=&quot;com.dummy.test.b*:com.dummy.test.c*&quot;/&gt;
  767. &lt;link offline=&quot;true&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/&quot; packagelistLoc=&quot;C:\tmp&quot;/&gt;
  768. &lt;link href=&quot;https://docs.oracle.com/javase/8/docs/api/&quot;/&gt;
  769. &lt;/javadoc&gt;</pre>
  770. <p>or</p>
  771. <pre>
  772. &lt;javadoc destdir=&quot;docs/api&quot;
  773. author=&quot;true&quot;
  774. version=&quot;true&quot;
  775. use=&quot;true&quot;
  776. windowtitle=&quot;Test API&quot;&gt;
  777. &lt;fileset dir=&quot;src&quot; defaultexcludes=&quot;yes&quot;&gt;
  778. &lt;include name=&quot;com/dummy/test/**&quot;/&gt;
  779. &lt;exclude name=&quot;com/dummy/test/doc-files/**&quot;/&gt;
  780. &lt;/fileset&gt;
  781. &lt;doctitle&gt;&lt;![CDATA[&lt;h1&gt;Test&lt;/h1&gt;]]&gt;&lt;/doctitle&gt;
  782. &lt;bottom&gt;&lt;![CDATA[&lt;i&gt;Copyright &amp;#169; 2000 Dummy Corp. All Rights Reserved.&lt;/i&gt;]]&gt;&lt;/bottom&gt;
  783. &lt;tag name=&quot;todo&quot; scope=&quot;all&quot; description=&quot;To do:&quot;/&gt;
  784. &lt;group title=&quot;Group 1 Packages&quot; packages=&quot;com.dummy.test.a*&quot;/&gt;
  785. &lt;group title=&quot;Group 2 Packages&quot; packages=&quot;com.dummy.test.b*:com.dummy.test.c*&quot;/&gt;
  786. &lt;link offline=&quot;true&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/&quot; packagelistLoc=&quot;C:\tmp&quot;/&gt;
  787. &lt;link href=&quot;https://docs.oracle.com/javase/8/docs/api/&quot;/&gt;
  788. &lt;/javadoc&gt;</pre>
  789. </body>
  790. </html>