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

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