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 37 KiB

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