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 32 kB

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