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

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